| 1 | // Copyright (C) 2009 - 2012 Mathias Froehlich - [email protected] |
| 2 | // |
| 3 | // This library is free software; you can redistribute it and/or |
| 4 | // modify it under the terms of the GNU Library General Public |
| 5 | // License as published by the Free Software Foundation; either |
| 6 | // version 2 of the License, or (at your option) any later version. |
| 7 | // |
| 8 | // This library is distributed in the hope that it will be useful, |
| 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 | // Library General Public License for more details. |
| 12 | // |
| 13 | // You should have received a copy of the GNU General Public License |
| 14 | // along with this program; if not, write to the Free Software |
| 15 | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 16 | // |
| 17 | |
| 18 | #ifndef HLACamera_hxx |
| 19 | #define HLACamera_hxx |
| 20 | |
| 21 | #include <simgear/hla/HLAArrayDataElement.hxx> |
| 22 | #include <simgear/hla/HLAObjectClass.hxx> |
| 23 | |
| 24 | namespace fgviewer { |
| 25 | |
| 26 | class HLACameraClass; |
| 27 | |
| 28 | class HLACamera : public simgear::HLAObjectInstance { |
| 29 | public: |
| 30 | HLACamera(HLACameraClass* objectClass = 0); |
| 31 | virtual ~HLACamera(); |
| 32 | |
| 33 | virtual void createAttributeDataElements(); |
| 34 | |
| 35 | const std::string& getName() const |
| 36 | { return _name.getValue(); } |
| 37 | void setName(const std::string& name) |
| 38 | { _name.setValue(name); } |
| 39 | |
| 40 | const std::string& getViewer() const |
| 41 | { return _viewer.getValue(); } |
| 42 | void setViewer(const std::string& viewer) |
| 43 | { _viewer.setValue(viewer); } |
| 44 | |
| 45 | const std::string& getDrawable() const |
| 46 | { return _drawable.getValue(); } |
| 47 | void setDrawable(const std::string& drawable) |
| 48 | { _drawable.setValue(drawable); } |
| 49 | |
| 50 | const SGVec4i& getViewport() const |
| 51 | { return _viewport.getValue(); } |
| 52 | void setViewport(const SGVec4i& viewport) |
| 53 | { _viewport.setValue(viewport); } |
| 54 | |
| 55 | const SGVec3d& getPosition() const |
| 56 | { return _position.getValue(); } |
| 57 | void setPosition(const SGVec3d& position) |
| 58 | { _position.setValue(position); } |
| 59 | |
| 60 | const SGQuatd& getOrientation() const |
| 61 | { return _orientation.getValue(); } |
| 62 | void setOrientation(const SGQuatd& orientation) |
| 63 | { _orientation.setValue(orientation); } |
| 64 | |
| 65 | SGLocationd getLocation() const |
| 66 | { return SGLocationd(getPosition(), getOrientation()); } |
| 67 | void setLocation(const SGLocationd& location) |
| 68 | { setPosition(location.getPosition()); setOrientation(location.getOrientation()); } |
| 69 | |
| 70 | private: |
| 71 | simgear::HLAStringData _name; |
| 72 | simgear::HLAStringData _viewer; |
| 73 | simgear::HLAStringData _drawable; |
| 74 | simgear::HLAVec4iData _viewport; |
| 75 | simgear::HLAVec3dData _position; |
| 76 | simgear::HLAQuat3dData _orientation; |
| 77 | }; |
| 78 | |
| 79 | } // namespace fgviewer |
| 80 | |
| 81 | #endif |