| 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 HLAView_hxx |
| 19 | #define HLAView_hxx |
| 20 | |
| 21 | #include <simgear/hla/HLAArrayDataElement.hxx> |
| 22 | #include <simgear/hla/HLAObjectInstance.hxx> |
| 23 | |
| 24 | #include "HLAObjectReferenceData.hxx" |
| 25 | #include "HLASceneObject.hxx" |
| 26 | |
| 27 | namespace fgviewer { |
| 28 | |
| 29 | class HLAViewClass; |
| 30 | |
| 31 | class HLAView : public simgear::HLAObjectInstance { |
| 32 | public: |
| 33 | HLAView(HLAViewClass* objectClass, const SGWeakPtr<simgear::HLAFederate>& federate); |
| 34 | virtual ~HLAView(); |
| 35 | |
| 36 | virtual void createAttributeDataElements(); |
| 37 | |
| 38 | virtual void discoverInstance(const simgear::RTIData& tag); |
| 39 | virtual void removeInstance(const simgear::RTIData& tag); |
| 40 | |
| 41 | virtual void registerInstance(simgear::HLAObjectClass* objectClass); |
| 42 | virtual void deleteInstance(const simgear::RTIData& tag); |
| 43 | |
| 44 | const std::string& getNameAttribute() const |
| 45 | { return _name.getValue(); } |
| 46 | void setNameAttribute(const std::string& name) |
| 47 | { _name.setValue(name); } |
| 48 | |
| 49 | const SGVec3d& getPosition() const |
| 50 | { return _position.getValue(); } |
| 51 | void setPosition(const SGVec3d& position) |
| 52 | { _position.setValue(position); } |
| 53 | |
| 54 | const SGQuatd& getOrientation() const |
| 55 | { return _orientation.getValue(); } |
| 56 | void setOrientation(const SGQuatd& orientation) |
| 57 | { _orientation.setValue(orientation); } |
| 58 | |
| 59 | const HLASceneObject* getSceneObject() const; |
| 60 | HLASceneObject* getSceneObject(); |
| 61 | void setSceneObject(HLASceneObject* sceneObject); |
| 62 | |
| 63 | virtual SGLocationd getLocation(const SGTimeStamp& simTime) const; |
| 64 | |
| 65 | private: |
| 66 | simgear::HLAStringData _name; |
| 67 | |
| 68 | simgear::HLAVec3dData _position; |
| 69 | simgear::HLAQuat3dData _orientation; |
| 70 | |
| 71 | simgear::HLAObjectReferenceData<HLASceneObject> _sceneObject; |
| 72 | }; |
| 73 | |
| 74 | } // namespace fgviewer |
| 75 | |
| 76 | #endif |