VR-Forces 4.1.1 Class Documentation
terrainModelData.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2004 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: terrainModelData.h,v $ $Revision: 1.11 $ $State: Exp $
7 *********************************************************************/
8 
11 
12 #ifndef DTTERRAINMODELDATA_H_
13 #define DTTERRAINMODELDATA_H_
14 
17 
18 #include <QtCore/QHash>
19 
20 class DtNetworkElement;
23 {
24 public:
25  DtSegmentElement(const DtNetworkElement* e, bool on = true);
27 
28  const DtNetworkElement* element() const;
29  void setNetworkElement(const DtNetworkElement*);
30 
31  bool on() const;
32  void setOn(bool);
33 
34 protected:
36  bool myOn;
37 };
38 
40 {
41 public:
44 
45  void activateAll(bool b);
46  bool active() const;
47  void setOn(const DtNetworkElement* element, bool onOff);
48  bool segmentActive(const DtNetworkElement*) const;
49 
50  const QList<DtSegmentElement>& segments() const;
51  QList<DtSegmentElement>& segments();
52  const QVector<DtPoint>& points() const;
53 
56  void setPoints(const QVector<DtPoint>&);
57 
58  void setDirty(bool);
59  bool dirty() const;
60 
61  void setElement(const DtNetworkSpecElement*);
62  const DtNetworkSpecElement* element() const;
63 
64 protected:
66  QVector<DtPoint> myPoints;
67  bool myDirty;
69 };
70 
72 {
73 
74 public:
76  virtual ~DtTerrainModelData();
77 
80 
82  virtual void activateAll(bool);
83 
84  virtual bool pruneInactiveVectorFeatures();
85 
87  virtual bool active() const;
88 
90  virtual DtTerrainModelData* clone() const;
91 
96  virtual void activateSegment(const DtNetworkSpecElement* parent, const DtNetworkElement* segment);
97  virtual void deactivateSegment(const DtNetworkSpecElement* parent, const DtNetworkElement* segment);
98  virtual bool segmentActive(const DtNetworkSpecElement* parent, const DtNetworkElement* segment) const;
99 
100  void setIsPoint(bool b);
101  bool isPoint() const;
102  int numElements() const;
103  const QHash<void*, DtSegmentList>& vectorFeatures() const;
104  QHash<void*, DtSegmentList>& vectorFeatures();
105 
106  virtual const QVector<DtPoint>* getAllPoints() const;
107 
109  virtual DtModelDataType type() const;
110 
111 protected:
112 
113  void copyList(const QHash<void*, DtSegmentList>&);
114  virtual DtSegmentList& segmentList(const DtNetworkSpecElement* parent);
115  virtual void setOn(DtSegmentList& list, const DtNetworkElement* segment, bool onOff);
116 
117 protected:
118  mutable QHash<void*, DtSegmentList> myVectorFeatures;
119  bool myIsPoint;
120 };
121 
123 {
124  myIsPoint = b;
125 }
126 
127 inline bool DtTerrainModelData::isPoint() const
128 {
129  return myIsPoint;
130 }
131 
133 {
134  return myVectorFeatures.count();
135 }
136 
137 inline const QHash<void*, DtSegmentList>& DtTerrainModelData::vectorFeatures() const
138 {
139  return myVectorFeatures;
140 }
141 
142 inline QHash<void*, DtSegmentList>& DtTerrainModelData::vectorFeatures()
143 {
144  return myVectorFeatures;
145 }
146 
148 {
149  return myElement;
150 }
151 
153 {
154  myElement = e;
155 }
156 
157 inline bool DtSegmentElement::on() const
158 {
159  return myOn;
160 }
161 
162 inline void DtSegmentElement::setOn(bool b)
163 {
164  myOn = b;
165 }
166 
168 {
169  return mySegments;
170 }
171 
173 {
174  return mySegments;
175 }
176 
177 inline const QVector<DtPoint>& DtSegmentList::points() const
178 {
179  return myPoints;
180 }
181 
182 inline void DtSegmentList::setDirty(bool b)
183 {
184  myDirty = b;
185 }
186 
187 inline bool DtSegmentList::dirty() const
188 {
189  return myDirty;
190 }
191 
193 {
194  myElement = e;
195 }
196 
198 {
199  return myElement;
200 }
201 
202 #endif //DTTERRAINMODELDATA_H_

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)