VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtDynamicTerrainWorld.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2016 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/vrvCore.h>
13 
16 
17 #include <list>
18 #include <vector>
19 
20 #include <boost/shared_ptr.hpp>
21 #include <boost/weak_ptr.hpp>
22 #include <boost/function.hpp>
23 
24 class DtString;
25 
26 namespace makVrv
27 {
28  class DtDe;
29  class DtDynamicTerrainChange;
30  class DtDynamicTerrainIndex;
31  class DtDynamicTerrainChanges;
32  class DtDynamicTerrainGeometry;
33 
72  {
73  public:
74  class Config;
75  class QueryInfo;
76 
78  static DtDynamicTerrainWorld& instance(DtDe&);
79 
81  static void setInstance(DtDe& de, DtDynamicTerrainWorld* world);
82 
83  static unsigned long long GetQueryCount();
84 
86  DtDynamicTerrainWorld(Config* config = 0);
87 
89  virtual ~DtDynamicTerrainWorld();
90 
94 
95 
100  {
101  public:
102  typedef std::vector< boost::weak_ptr<DtDynamicTerrainFeature> > FeatureVector;
103 
105  FeatureHandle();
106 
108  void pageOut();
109 
112  void releaseOwnership();
113 
117  void addFeatureHandles(const FeatureHandle& from);
118 
120  const FeatureVector& features() const;
121 
122  private:
123  friend class DtDynamicTerrainWorld;
124  explicit FeatureHandle(const boost::shared_ptr<DtDynamicTerrainFeature>&);
125 
127  };
128 
133  virtual FeatureHandle pageInFeature(const boost::shared_ptr<DtDynamicTerrainFeature>& feature);
134 
136 
145 
146 
148 
153  virtual RequestHandle addChangeRequest(DtDynamicTerrainChange* command);
154 
158  virtual RequestHandle addChangeRequest(
160  DtDynamicTerrainChange* command);
162 
169 
170 
175  {
176  public:
178  QueryHandle();
179 
181  void removeQuery();
182 
185  void releaseOwnership();
186 
187  private:
188  friend class DtDynamicTerrainWorld;
189  explicit QueryHandle(const boost::shared_ptr<QueryInfo>&);
190 
191  boost::weak_ptr<QueryInfo> myQuery;
192  };
193 
196 
207  virtual QueryHandle queryFeatures(
208  const boost::function<void (const DtDynamicTerrainFeature&)>& callback,
209  DtDynamicTerrainChange* command = 0,
210  bool useOriginalGeometry = false);
211 
212  virtual QueryHandle queryFeatures(
213  const boost::function<void (const DtDynamicTerrainFeature&)>& callback,
214  DtDynamicTerrainGeometry* geometry,
215  bool useOriginalGeometry = false);
216 
217  virtual void queryCurrentFeatures(
218  const boost::function<void (const DtDynamicTerrainFeature&)>&,
219  DtDynamicTerrainChange* command = 0,
220  bool useOriginalGeometry = false);
221 
222  virtual void queryCurrentFeatures(
223  const boost::function<void (const DtDynamicTerrainFeature&)>&,
224  DtDynamicTerrainGeometry* geometry,
225  bool useOriginalGeometry = false);
227 
234  void setDisabled();
235 
236  bool isDisabled() const;
237 
238  class Impl;
239  class Cell;
240 
241  protected:
242  virtual QueryHandle queryFeatures(QueryInfo* query);
243 
244  Impl* myImpl;
245 
246  private:
248 
250  DtDynamicTerrainWorld& operator=(const DtDynamicTerrainWorld&);
252  };
253 
255  {
256  public:
257  virtual ~Config();
258 
259  virtual double minTileArea() const = 0;
260  virtual double maxTileArea() const = 0;
261  };
262 }
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
Represents (possibly infinite) area of space.
Definition: DtDynamicTerrainGeometry.h:20
std::vector< boost::weak_ptr< DtDynamicTerrainFeature > > FeatureVector
Definition: DtDynamicTerrainWorld.h:102
Queries. Queries work very much like change requests except instead of changing the state of the feat...
Definition: DtDynamicTerrainWorld.h:174
Can be thrown from query callback to remove query.
Definition: DtDynamicTerrainWorld.h:195
DtDynamicTerrainFeature::RequestHandle RequestHandle
Change Requests. Change requests are added to the terrain to cause the contained features to change s...
Definition: DtDynamicTerrainWorld.h:147
Contains makVrv::DtVirtualBaseClass class.
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
Interface which abstracts the concept of a individually identifiable &quot;thing&quot; in the terrain...
Definition: DtDynamicTerrainFeature.h:83
Contains makVrv::DtDynamicTerrainFeature class.
boost::weak_ptr< QueryInfo > myQuery
Definition: DtDynamicTerrainWorld.h:191
Command which can be given to the dynamic terrain system to perform some change. This class is a simp...
Definition: DtDynamicTerrainChange.h:42
Feature Insertion/Removal/Paging Features represent parts of the terrain which are individually ident...
Definition: DtDynamicTerrainWorld.h:99
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:70
Impl * myImpl
Definition: DtDynamicTerrainWorld.h:244
Container for dynamic terrain features, change requests, and queries.
Definition: DtDynamicTerrainWorld.h:71
FeatureVector myFeatureInfos
Definition: DtDynamicTerrainWorld.h:126
Resource handle for a change request which has been added to the system. Returned from addChangeReque...
Definition: DtDynamicTerrainFeature.h:95
Contains DLL export macros.

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)