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 
156  virtual RequestHandle addChangeRequest(
158  DtDynamicTerrainChange* command);
160 
167 
168 
173  {
174  public:
176  QueryHandle();
177 
179  void removeQuery();
180 
183  void releaseOwnership();
184 
185  private:
186  friend class DtDynamicTerrainWorld;
187  explicit QueryHandle(const std::shared_ptr<QueryInfo>&);
188 
189  std::weak_ptr<QueryInfo> myQuery;
190  };
191 
194 
205  virtual QueryHandle queryFeatures(
206  const boost::function<void (const DtDynamicTerrainFeature&)>& callback,
207  DtDynamicTerrainChange* command = 0,
208  bool useOriginalGeometry = false);
209 
210  virtual QueryHandle queryFeatures(
211  const boost::function<void (const DtDynamicTerrainFeature&)>& callback,
212  DtDynamicTerrainGeometry* geometry,
213  bool useOriginalGeometry = false);
214 
215  virtual void queryCurrentFeatures(
216  const boost::function<void (const DtDynamicTerrainFeature&)>&,
217  DtDynamicTerrainChange* command = 0,
218  bool useOriginalGeometry = false);
219 
220  virtual void queryCurrentFeatures(
221  const boost::function<void (const DtDynamicTerrainFeature&)>&,
222  DtDynamicTerrainGeometry* geometry,
223  bool useOriginalGeometry = false);
225 
232  void setDisabled();
233 
234  bool isDisabled() const;
235 
236  class Impl;
237  class Cell;
238 
239  protected:
240  virtual QueryHandle queryFeatures(QueryInfo* query);
241 
242  Impl* myImpl;
243 
244  private:
246 
248  DtDynamicTerrainWorld& operator=(const DtDynamicTerrainWorld&);
250  };
251 
253  {
254  public:
255  virtual ~Config();
256 
257  virtual double minTileArea() const = 0;
258  virtual double maxTileArea() const = 0;
259  };
260 }
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:172
Can be thrown from query callback to remove query.
Definition: DtDynamicTerrainWorld.h:193
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:42
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:242
std::weak_ptr< QueryInfo > myQuery
Definition: DtDynamicTerrainWorld.h:189
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 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)