VR-Forces 4.1.1 Class Documentation
DtTerrainPatch.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtTerrainPatch.h,v $ $Revision: 1.46 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #ifndef DtTerrainPatch_H_
14 #define DtTerrainPatch_H_
15 
16 #include <vrvCore/vrvCore.h>
17 #include <vrvCore/DtTerrainLayer.h>
21 
23 
24 #include <string>
25 #include <map>
26 #include <vector>
27 #include <list>
28 
29 namespace makVrv
30 {
31  class DtTerrainPatchObject;
32  class DtTerrainPatchObjectAgent;
33  class DtSceneObjectAgent;
34  class DtAgentManagerInterface;
35  class DtModelAgent;
36  class DtDe;
37 
41  {
42  public:
43 
45  enum GdbSurface {
48  Building=2,
50  DeepBrook=4,
51  DeepLake=5,
52  DeepPond=6,
53  DeepRiver=7,
54  DeepStream=8,
56  DryGround=10,
58  Flimsy=12,
59  Forest=13,
60  Grass=14,
62  Icy=16,
63  IcyGround=17,
64  Moon=18,
65  Mud=19,
67  Ocean=21,
70  Rock=24,
71  Sand=25,
72  ShallowBrook=26,
73  ShallowLake=27,
74  ShallowPond=28,
75  ShallowRiver=29,
76  ShallowStream=30,
77  SnowGround=31,
79  Swamp=33,
80  Tree=34,
83  Unspecified=37,
86  UnspecifiedEnvStateGround=40,
87  WetGround=41,
88  };
89 
91  DtTerrainPatch(DtDe& de, DtAgentManagerInterface& sceneInterface,
92  const std::string& terrainDefinition);
93 
95  ~DtTerrainPatch();
96 
97  private:
98  //not copyable.
99  DtTerrainPatch(const DtTerrainPatch& copy);
100  DtTerrainPatch& operator=(const DtTerrainPatch& copy);
101 
102  public:
103 
105 
106 
108  virtual void getRecord(makArchives::DtTerrainPatchRecord& rec) const;
109 
111  virtual void setFromRecord(const makArchives::DtTerrainPatchRecord& rec);
112 
114 
116 
117 
119  const std::string& definition() const;
120 
122  DtUniqueID uniqueID() const;
123 
125  DtTerrainPatchObjectAgent* agent();
126 
128  const DtTerrainPatchObjectAgent* agent() const;
129 
131  inline DtDe& de() { return myDe;}
132 
134  inline const DtDe& de() const { return myDe; }
135 
137  DtOverlaySettings& overlaySettings();
138 
140  const DtOverlaySettings& overlaySettings() const;
141 
144  extractionOperations() const;
146 
148 
149 
151  void setSurfaceVisible(int surfaceId, bool state);
152 
154  bool surfaceVisible(int surfaceId);
155 
157  DtSurfacesSettings::SurfaceIdList const& surfaceIds();
158 
160  void loadSurfacesSettings();
161 
163 
165 
166 
171  virtual void setExtractedNodeAsPropModel( DtProp* prop ,
172  bool setObjectPosition = false);
173 
175  virtual int countNodes(const std::string& rules) const;
176 
178  virtual void extractNodes(const std::string& rule, bool isRegEx);
179 
182  virtual void moveNode(DtSceneObjectAgent* objectDriver,
183  DtModelAgent* model, const std::string& rule, unsigned int index);
184 
186  virtual void addExtractNodeOperation(std::string const& searchExp,
187  bool isRegEx, std::string const& propType, unsigned int count);
188 
189 
191  void extractNodesToProps(const std::string& exp, bool isRegEx,
192  const std::string& type, const std::string& modelDefinition);
193 
195  void executeExtractionOperation( const
197 
198  typedef std::pair<std::string, std::string> ExtractionRule;
199  typedef std::vector<ExtractionRule> ExtractionRuleList;
201  ExtractionRuleList extractionRules();
202 
204 
207  void extractNodesToTrees(std::string const& searchExp, bool isRegEx,
208  std::string const& treeSpecies);
209 
210 
211  protected:
212 
214  void onTerrainPatchObjectAvailable(DtUniqueID id);
215 
218  void executeExtractionOperations( const
220 
222  void createPropsFromRecord(const
223  makArchives::DtPropSettingsRecord& propSettings);
224 
226  void getPropSettingsRecord(
227  makArchives::DtPropSettingsRecord& record) const;
228 
233  void createPropsFromExtraction( DtTerrainPatchObject& tpo,
234  makArchives::DtPropRecord* protoTypeRecord,
235  const std::string& exp, bool isRegEx, std::vector<std::string> matches);//unsigned int numProps);
236 
237  protected:
238 
239  std::string myDefinition;
240 
241  DtTerrainPatchObjectAgent* myTerrainAgent;
242 
245 
247  };
248 
252  {
253  public:
254 
256  static DtTerrainPatchSignaler& instance(DtDe& de);
257 
259  virtual ~DtTerrainPatchSignaler();
260 
262  boost::signal<void (DtTerrainPatch&,int surfaceId, bool state)>
264 
265  protected:
267 
268  };
269 }
270 
271 #endif
272 

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)