VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 
211  virtual QueryHandle queryFeatures(
212  const boost::function<void (const DtDynamicTerrainFeature&)>& callback,
213  DtDynamicTerrainGeometry* geometry);
214 
215  virtual void queryCurrentFeatures(
216  const boost::function<void (const DtDynamicTerrainFeature&)>&,
217  DtDynamicTerrainChange* command = 0);
218 
219  virtual void queryCurrentFeatures(
220  const boost::function<void (const DtDynamicTerrainFeature&)>&,
221  DtDynamicTerrainGeometry* geometry);
223 
230  void setDisabled();
231 
232  bool isDisabled() const;
233 
234  class Impl;
235  class Cell;
236 
237  protected:
238  virtual QueryHandle queryFeatures(QueryInfo* query);
239 
240  Impl* myImpl;
241 
242  private:
244 
246  DtDynamicTerrainWorld& operator=(const DtDynamicTerrainWorld&);
248  };
249 
251  {
252  public:
253  virtual ~Config();
254 
255  virtual double minTileArea() const = 0;
256  virtual double maxTileArea() const = 0;
257  };
258 }

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)