![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /********************************************************************* 00002 ** Copyright (c) 2004 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: terrainModelData.h,v $ $Revision: 1.11 $ $State: Exp $ 00007 *********************************************************************/ 00008 00011 00012 #ifndef DTTERRAINMODELDATA_H_ 00013 #define DTTERRAINMODELDATA_H_ 00014 00015 #include "symbolMapper/envModelData.h" 00016 #include "symbolMapper/symbolMapperDefines.h" 00017 00018 #include <QtCore/QHash> 00019 00020 class DtNetworkElement; 00021 class DtNetworkSpecElement; 00022 class DT_DLL_symbolMapper DtSegmentElement 00023 { 00024 public: 00025 DtSegmentElement(const DtNetworkElement* e, bool on = true); 00026 DtSegmentElement(const DtSegmentElement& orig); 00027 00028 const DtNetworkElement* element() const; 00029 void setNetworkElement(const DtNetworkElement*); 00030 00031 bool on() const; 00032 void setOn(bool); 00033 00034 protected: 00035 const DtNetworkElement* myElement; 00036 bool myOn; 00037 }; 00038 00039 class DT_DLL_symbolMapper DtSegmentList 00040 { 00041 public: 00042 DtSegmentList(const DtNetworkSpecElement* me); 00043 DtSegmentList(const DtSegmentList&); 00044 00045 void activateAll(bool b); 00046 bool active() const; 00047 void setOn(const DtNetworkElement* element, bool onOff); 00048 bool segmentActive(const DtNetworkElement*) const; 00049 00050 const QList<DtSegmentElement>& segments() const; 00051 QList<DtSegmentElement>& segments(); 00052 const QVector<DtPoint>& points() const; 00053 00056 void setPoints(const QVector<DtPoint>&); 00057 00058 void setDirty(bool); 00059 bool dirty() const; 00060 00061 void setElement(const DtNetworkSpecElement*); 00062 const DtNetworkSpecElement* element() const; 00063 00064 protected: 00065 QList<DtSegmentElement> mySegments; 00066 QVector<DtPoint> myPoints; 00067 bool myDirty; 00068 const DtNetworkSpecElement* myElement; 00069 }; 00070 00071 class DT_DLL_symbolMapper DtTerrainModelData : public DtEnvironmentalModelData 00072 { 00073 00074 public: 00075 DtTerrainModelData(); 00076 virtual ~DtTerrainModelData(); 00077 00078 DtTerrainModelData(const DtTerrainModelData& orig); 00079 DtTerrainModelData& operator=(const DtTerrainModelData& rhs); 00080 00082 virtual void activateAll(bool); 00083 00084 virtual bool pruneInactiveVectorFeatures(); 00085 00087 virtual bool active() const; 00088 00090 virtual DtTerrainModelData* clone() const; 00091 00096 virtual void activateSegment(const DtNetworkSpecElement* parent, const DtNetworkElement* segment); 00097 virtual void deactivateSegment(const DtNetworkSpecElement* parent, const DtNetworkElement* segment); 00098 virtual bool segmentActive(const DtNetworkSpecElement* parent, const DtNetworkElement* segment) const; 00099 00100 void setIsPoint(bool b); 00101 bool isPoint() const; 00102 int numElements() const; 00103 const QHash<void*, DtSegmentList>& vectorFeatures() const; 00104 QHash<void*, DtSegmentList>& vectorFeatures(); 00105 00106 virtual const QVector<DtPoint>* getAllPoints() const; 00107 00109 virtual DtModelDataType type() const; 00110 00111 protected: 00112 00113 void copyList(const QHash<void*, DtSegmentList>&); 00114 virtual DtSegmentList& segmentList(const DtNetworkSpecElement* parent); 00115 virtual void setOn(DtSegmentList& list, const DtNetworkElement* segment, bool onOff); 00116 00117 protected: 00118 mutable QHash<void*, DtSegmentList> myVectorFeatures; 00119 bool myIsPoint; 00120 }; 00121 00122 inline void DtTerrainModelData::setIsPoint(bool b) 00123 { 00124 myIsPoint = b; 00125 } 00126 00127 inline bool DtTerrainModelData::isPoint() const 00128 { 00129 return myIsPoint; 00130 } 00131 00132 inline int DtTerrainModelData::numElements() const 00133 { 00134 return myVectorFeatures.count(); 00135 } 00136 00137 inline const QHash<void*, DtSegmentList>& DtTerrainModelData::vectorFeatures() const 00138 { 00139 return myVectorFeatures; 00140 } 00141 00142 inline QHash<void*, DtSegmentList>& DtTerrainModelData::vectorFeatures() 00143 { 00144 return myVectorFeatures; 00145 } 00146 00147 inline const DtNetworkElement* DtSegmentElement::element() const 00148 { 00149 return myElement; 00150 } 00151 00152 inline void DtSegmentElement::setNetworkElement(const DtNetworkElement* e) 00153 { 00154 myElement = e; 00155 } 00156 00157 inline bool DtSegmentElement::on() const 00158 { 00159 return myOn; 00160 } 00161 00162 inline void DtSegmentElement::setOn(bool b) 00163 { 00164 myOn = b; 00165 } 00166 00167 inline const QList<DtSegmentElement>& DtSegmentList::segments() const 00168 { 00169 return mySegments; 00170 } 00171 00172 inline QList<DtSegmentElement>& DtSegmentList::segments() 00173 { 00174 return mySegments; 00175 } 00176 00177 inline const QVector<DtPoint>& DtSegmentList::points() const 00178 { 00179 return myPoints; 00180 } 00181 00182 inline void DtSegmentList::setDirty(bool b) 00183 { 00184 myDirty = b; 00185 } 00186 00187 inline bool DtSegmentList::dirty() const 00188 { 00189 return myDirty; 00190 } 00191 00192 inline void DtSegmentList::setElement(const DtNetworkSpecElement* e) 00193 { 00194 myElement = e; 00195 } 00196 00197 inline const DtNetworkSpecElement* DtSegmentList::element() const 00198 { 00199 return myElement; 00200 } 00201 00202 #endif //DTTERRAINMODELDATA_H_