X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fhla%2FHLAArrayDataElement.hxx;h=b7c9c1e3dc46631eb0617225fa6486d112b540d5;hb=bd999ca090853e68acb7b0f4aab3d875afd8c010;hp=f1acf8ef096a012dcdc4fcf370126e947609a1eb;hpb=feab25d0bee2c65a9b5c0a27802fb71c9a1a1190;p=simgear.git diff --git a/simgear/hla/HLAArrayDataElement.hxx b/simgear/hla/HLAArrayDataElement.hxx index f1acf8ef..b7c9c1e3 100644 --- a/simgear/hla/HLAArrayDataElement.hxx +++ b/simgear/hla/HLAArrayDataElement.hxx @@ -248,6 +248,43 @@ private: SGVec2 _value; }; +template +class HLAVec2Data { +public: + HLAVec2Data() : + _value(new HLAVec2DataElement(0)) + { } + HLAVec2Data(const SGVec2& value) : + _value(new HLAVec2DataElement(0, value)) + { } + + operator const SGVec2&() const + { return _value->getValue(); } + HLAVec2Data& operator=(const SGVec2& value) + { _value->setValue(value); return *this; } + + const SGVec2& getValue() const + { return _value->getValue(); } + void setValue(const SGVec2& value) + { _value->setValue(value); } + + const HLAVec2DataElement* getDataElement() const + { return _value.get(); } + HLAVec2DataElement* getDataElement() + { return _value.get(); } + + const HLAArrayDataType* getDataType() const + { return _value->getDataType(); } + void setDataType(const HLAArrayDataType* dataType) + { _value->setDataType(dataType); } + +private: + SGSharedPtr > _value; +}; + +typedef HLAVec2Data HLAVec2fData; +typedef HLAVec2Data HLAVec2dData; + template class HLAVec3DataElement : public HLAAbstractArrayDataElement { public: @@ -303,6 +340,43 @@ private: SGVec3 _value; }; +template +class HLAVec3Data { +public: + HLAVec3Data() : + _value(new HLAVec3DataElement(0)) + { } + HLAVec3Data(const SGVec3& value) : + _value(new HLAVec3DataElement(0, value)) + { } + + operator const SGVec3&() const + { return _value->getValue(); } + HLAVec3Data& operator=(const SGVec3& value) + { _value->setValue(value); return *this; } + + const SGVec3& getValue() const + { return _value->getValue(); } + void setValue(const SGVec3& value) + { _value->setValue(value); } + + const HLAVec3DataElement* getDataElement() const + { return _value.get(); } + HLAVec3DataElement* getDataElement() + { return _value.get(); } + + const HLAArrayDataType* getDataType() const + { return _value->getDataType(); } + void setDataType(const HLAArrayDataType* dataType) + { _value->setDataType(dataType); } + +private: + SGSharedPtr > _value; +}; + +typedef HLAVec3Data HLAVec3fData; +typedef HLAVec3Data HLAVec3dData; + template class HLAVec4DataElement : public HLAAbstractArrayDataElement { public: @@ -358,6 +432,43 @@ private: SGVec4 _value; }; +template +class HLAVec4Data { +public: + HLAVec4Data() : + _value(new HLAVec4DataElement(0)) + { } + HLAVec4Data(const SGVec4& value) : + _value(new HLAVec4DataElement(0, value)) + { } + + operator const SGVec4&() const + { return _value->getValue(); } + HLAVec4Data& operator=(const SGVec4& value) + { _value->setValue(value); return *this; } + + const SGVec4& getValue() const + { return _value->getValue(); } + void setValue(const SGVec4& value) + { _value->setValue(value); } + + const HLAVec4DataElement* getDataElement() const + { return _value.get(); } + HLAVec4DataElement* getDataElement() + { return _value.get(); } + + const HLAArrayDataType* getDataType() const + { return _value->getDataType(); } + void setDataType(const HLAArrayDataType* dataType) + { _value->setDataType(dataType); } + +private: + SGSharedPtr > _value; +}; + +typedef HLAVec4Data HLAVec4fData; +typedef HLAVec4Data HLAVec4dData; + template class HLAQuatDataElement : public HLAAbstractArrayDataElement { public: