VR-Vantage API Documentation
DtScene.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/vrvCore.h>
14 #include <vrvCore/DtUniqueID.h>
15 
16 #include <boost/signal.hpp>
17 
18 #include <string>
19 #include <vector>
20 
21 namespace makArchives
22 {
23  class DtSceneRecord;
24  class DtTerrainRecord;
25  class DtEnvironmentRecord;
26  class DtDateTimeRecord;
27 }
28 
29 namespace makVrv
30 {
31  class DtAgentManagerInterface;
32  class DtDe;
33  class DtEnvironment;
34  class DtFeature;
35  class DtProp;
36  class DtSceneSignaler;
37  class DtTerrain;
38  class DtTerrainLayer;
39 
43  {
44  public:
45 
47  DtScene(DtDe& de,DtAgentManagerInterface& agentManager);
48 
50  virtual ~DtScene();
51 
53 
54  inline DtTerrain& terrain() { return *myTerrain; }
55  inline const DtTerrain& terrain() const { return *myTerrain; }
57 
59  void getRecord(makArchives::DtSceneRecord& record) const;
60 
62  void setFromRecord(const makArchives::DtSceneRecord& record);
63 
69  bool saveTerrain( const std::string& filePath, bool saveAs = true );
70 
72  bool loadTerrain( const std::string& filePath );
73 
75  bool loadTerrain( const makArchives::DtTerrainRecord& terrainRecord );
76 
78 
79  inline DtEnvironment& environment() { return *myEnvironment; }
80  inline const DtEnvironment& environment() const { return *myEnvironment; }
82 
88  bool saveEnvironment( const std::string& filePath, bool saveAs = true );
89 
91  bool loadEnvironment( const std::string& filePath );
92 
94  bool loadEnvironment( const makArchives::DtEnvironmentRecord& envRecord );
95 
97  bool loadDateAndTime( const makArchives::DtDateTimeRecord& dateTimeRecord );
98 
100  virtual void resetScene();
101 
103  virtual void resetTerrain();
104 
106 
107 
109  typedef std::vector<DtProp*> ScenePropReferences;
110 
112  virtual void getScenePropReferences(ScenePropReferences& props);
113 
116  virtual DtProp* findProp(DtElementID id);
117 
120  virtual bool destroyProp(DtElementID id);
121 
123 
125  virtual DtFeature* findFeature(DtElementID id);
126 
129  virtual bool destroyFeature(DtElementID id);
130 
132  const std::string& terrainFileName() const;
133 
135  const std::string& enviromentFileName() const;
136 
137  protected:
138 
139  void copyPropReferences( DtTerrainLayer* patch, DtScene::ScenePropReferences &spRefs );
140 
141  protected:
143 
147 
150  };
151 
155  {
156  public:
157 
159  static DtSceneSignaler& instance(DtDe& de);
160 
162  virtual ~DtSceneSignaler();
163 
165  boost::signal<void ()> signal_sceneCreated;
166 
168  boost::signal<void (DtScene&)> signal_sceneToBeCleared;
169 
171  boost::signal<void (DtScene&)> signal_sceneCleared;
172 
174  boost::signal<void ()> signal_sceneToBeDeleted;
175 
176  protected:
177 
178  DtSceneSignaler();
179 
180  };
181 }


Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)