VR-Forces 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) 2024 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 #include <memory>
20 #include <boost/function.hpp>
21 
22 class DtString;
23 
24 namespace makVrv
25 {
26  class DtDe;
27  class DtDynamicTerrainChange;
28  class DtDynamicTerrainIndex;
29  class DtDynamicTerrainChanges;
30  class DtDynamicTerrainGeometry;
31 
70  {
71  public:
72  class Config;
73  class QueryInfo;
74 
76  static DtDynamicTerrainWorld& instance(DtDe&);
77 
79  static void setInstance(DtDe& de, DtDynamicTerrainWorld* world);
80 
81  static unsigned long long GetQueryCount();
82 
84  DtDynamicTerrainWorld(Config* config = 0);
85 
87  virtual ~DtDynamicTerrainWorld();
88 
92 
93 
98  {
99  public:
100  typedef std::vector< std::weak_ptr<DtDynamicTerrainFeature> > FeatureVector;
101 
103  FeatureHandle();
104 
106  void pageOut();
107 
110  void releaseOwnership();
111 
115  void addFeatureHandles(const FeatureHandle& from);
116 
118  const FeatureVector& features() const;
119 
120  private:
121  friend class DtDynamicTerrainWorld;
122  explicit FeatureHandle(const std::shared_ptr<DtDynamicTerrainFeature>&);
123 
125  };
126 
131  virtual FeatureHandle pageInFeature(const std::shared_ptr<DtDynamicTerrainFeature>& feature);
132 
134 
143 
144 
146 
151  virtual RequestHandle addChangeRequest(DtDynamicTerrainChange* command);
152 
157  virtual RequestHandle addChangeRequest(
159  DtDynamicTerrainChange* command);
161 
168 
169 
174  {
175  public:
177  QueryHandle();
178 
180  void removeQuery();
181 
184  void releaseOwnership();
185 
186  private:
187  friend class DtDynamicTerrainWorld;
188  explicit QueryHandle(const std::shared_ptr<QueryInfo>&);
189 
190  std::weak_ptr<QueryInfo> myQuery;
191  };
192 
195 
206  virtual QueryHandle queryFeatures(
207  const boost::function<void (const DtDynamicTerrainFeature&)>& callback,
208  DtDynamicTerrainChange* command = 0,
209  bool useOriginalGeometry = false);
210 
211  virtual QueryHandle queryFeatures(
212  const boost::function<void (const DtDynamicTerrainFeature&)>& callback,
213  DtDynamicTerrainGeometry* geometry,
214  bool useOriginalGeometry = false);
215 
216  virtual void queryCurrentFeatures(
217  const boost::function<void (const DtDynamicTerrainFeature&)>&,
218  DtDynamicTerrainChange* command = 0,
219  bool useOriginalGeometry = false);
220 
221  virtual void queryCurrentFeatures(
222  const boost::function<void (const DtDynamicTerrainFeature&)>&,
223  DtDynamicTerrainGeometry* geometry,
224  bool useOriginalGeometry = false);
226 
233  void setDisabled();
234 
235  bool isDisabled() const;
236 
237  class Impl;
238  class Cell;
239 
240  protected:
241  virtual QueryHandle queryFeatures(QueryInfo* query);
242 
243  Impl* myImpl;
244 
245  private:
247 
249  DtDynamicTerrainWorld& operator=(const DtDynamicTerrainWorld&);
251  };
252 
254  {
255  public:
256  virtual ~Config();
257 
258  virtual double minTileArea() const = 0;
259  virtual double maxTileArea() const = 0;
260  };
261 }
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
Queries. Queries work very much like change requests except instead of changing the state of the feat...
Definition: DtDynamicTerrainWorld.h:173
Can be thrown from query callback to remove query.
Definition: DtDynamicTerrainWorld.h:194
std::vector< std::weak_ptr< DtDynamicTerrainFeature > > FeatureVector
Definition: DtDynamicTerrainWorld.h:100
DtDynamicTerrainFeature::RequestHandle RequestHandle
Change Requests. Change requests are added to the terrain to cause the contained features to change s...
Definition: DtDynamicTerrainWorld.h:145
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.
Command which can be given to the dynamic terrain system to perform some change. This class is a simp...
Definition: DtDynamicTerrainChange.h:44
Feature Insertion/Removal/Paging Features represent parts of the terrain which are individually ident...
Definition: DtDynamicTerrainWorld.h:97
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:76
Impl * myImpl
Definition: DtDynamicTerrainWorld.h:243
std::weak_ptr< QueryInfo > myQuery
Definition: DtDynamicTerrainWorld.h:190
Container for dynamic terrain features, change requests, and queries.
Definition: DtDynamicTerrainWorld.h:69
FeatureVector myFeatureInfos
Definition: DtDynamicTerrainWorld.h:124
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 Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)