VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
terrainImplementation.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
17 #include <geometry/chord.h>
24 #include "features/feature.h"
25 #include "features/featureSet.h"
28 #include <vlpi/appearance.h>
29 
30 #include <string>
31 #include <boost/noncopyable.hpp>
32 
35 class DtScenarioExplorer;
36 class DtString;
37 class Coordinate_System;
40 class DtTaitBryan;
43 class DtEntityType;
44 
46 typedef void (*DtCacheProgressCallbackFunction)(int requestId, int current, bool completed, double elapsedTime, void* usr);
47 
48 namespace makArchives
49 {
50  class DtGenericTerrainRecord;
51 }
52 
53 namespace MAKVRinTerra
54 {
55  class DtProj;
56 }
57 
58 namespace makVrv
59 {
60  class DtDynamicTerrainGeometry;
61  class DtDynamicTerrainChange;
62  class DtDynamicTerrainFeature;
63  class DtDynamicTerrainChanges;
64 }
65 
70 {
71 public:
72 
74  {
75  public:
77  virtual void removeTerrainChange() = 0;
78  virtual void releaseOwnership() = 0;
79  };
80 
83 
85  DtDynamicTerrainRequestHandle(const boost::shared_ptr<RequestHandleImpl>&);
86 
90  void removeTerrainChange();
91 
94  void releaseOwnership();
95 
96 private:
97 
98  boost::shared_ptr<RequestHandleImpl> myImpl;
99 };
100 
105 {
106 public:
107 
109  {
110  public:
112  virtual void removeQuery() = 0;
113  virtual void releaseOwnership() = 0;
114  };
115 
118 
120  DtDynamicTerrainQueryHandle(const boost::shared_ptr<QueryHandleImpl>&);
121 
123  void removeQuery();
124 
127  void releaseOwnership();
128 
129 private:
130 
131  boost::shared_ptr<QueryHandleImpl> myImpl;
132 };
133 
134 typedef boost::function<void (const makVrv::DtDynamicTerrainFeature&)>
136 
140 {
141 public:
143  virtual ~DtTerrainGeometryHandle();
144 
146  virtual bool isDisabled() const = 0;
147 
150  virtual void disable() = 0;
151 
153  virtual void setAppearance(DtAppearance app) = 0;
154 
156  virtual void setPosition(const DtPoint& location, const DtDcm& orientation) = 0;
157 };
158 
163  : boost::noncopyable
164 {
165 public:
167  virtual ~DtTerrainImplementation();
168 
170  virtual MAKVRinTerra::DtFeatureDatabase& featureDatabase();
171  virtual const MAKVRinTerra::DtFeatureDatabase& featureDatabase() const;
172 
174  virtual MAKVRinTerra::DtFeatureContext& featureContext();
175  virtual const MAKVRinTerra::DtFeatureContext& featureContext() const;
176 
178  virtual void init();
179 
182  virtual void finishedLoading(const MAKVRinTerra::DtProj& proj);
183 
185  virtual bool loadTerrain(const makArchives::DtGenericTerrainRecord& rec) = 0;
186 
188  virtual void shutdown(bool block=true);
189 
190  virtual const Coordinate_System* coordinateSystem() const = 0;
191 
194  virtual double modelHeightDifferencesFromAppearances(int oldApp, int newApp) const;
195 
197  virtual bool createFromExtent(const Dt3dBoundingVolume&);
198 
201  virtual bool loadModel(const DtFilename&, const DtEntityType& t = DtEntityType());
202 
203  virtual DtTerrainInterfaceConfig& configurationOptions();
204  virtual const DtTerrainInterfaceConfig& configurationOptions() const;
205 
213  virtual bool chordIntersect(
214  DtTerrainIntersectStatus& status,
215  const DtChord& chord,
217  const DtTerrainIntersectOptions& options) const = 0;
218 
226  virtual bool allIntersectsAlongChord(DtTerrainIntersectStatus& status,
227  const DtChord& chord,
229  const DtTerrainIntersectOptions& options) const = 0;
230 
245  virtual void preloadTerrainAreas(
246  const DtTerrainPagingGeometryList& preloadGeometry) {};
247 
249  virtual bool dataAvailable(
250  const DtTerrainPagingGeometryList& geometry,
252 
255  virtual const DtTerrainCapabilities* terrainCapabilities() const = 0;
256 
267  virtual void setAssertOnBlockingTerrainCalls(bool assertBlock);
268  virtual bool assertOnBlockingTerrainCalls() const;
270 
273  virtual void setWarnOnBlockingTerrainCalls(bool warnBlock);
274  virtual bool warnOnBlockingTerrainCalls() const;
276 
282  virtual void setIntersectDataLoadExpireTime(const double& expireTime) {};
283 
288  virtual void expireDataLoadRequestsBeforeTime(const double& currentTime) {};
289 
290  virtual void processTrianglesInArea(DtTriangleOutputInterface&, const DtTerrainProcessPolygonsBox&) const = 0;
291 
294  virtual DtTerrainInformation* terrainInformation() { return NULL; };
295 
296  virtual void breakUpChords(const MAKVRinTerra::DtProj&, const DtChord& chord,
297  std::vector<DtChord>& chords);
298 
300  virtual bool hasFeatureContext() const;
301 
303  virtual DtTerrainGeometryHandle* createEntityGeometry(const DtFilename& file) { return 0; }
304 
306  virtual DtTerrainGeometryHandle* createEntityGeometry(const DtEntityType& file) { return 0; }
307 
309  virtual void loadVisuals(const DtScenarioExplorer&) {};
310 
317  double time,
319 
320  typedef boost::function<void (const makVrv::DtDynamicTerrainFeature&)>
322 
323  /*
324  virtual DtDynamicTerrainRequestHandle addDynamicTerrainCraterRequest(
325  double time,
326  makVrv::DtDynamicTerrainChange* command,
327  const std::map<DtString, DtString>& keyValueChanges,
328  const DtVector& centerLocation,
329  double radius) {
330  return DtDynamicTerrainRequestHandle(); }
331  */
332 
337  const DtDynamicTerrainQueryCallback& callback,
338  makVrv::DtDynamicTerrainGeometry* geometry = 0,
339  bool useOriginalGeometry = false) {
341  };
342 
344  const DtDynamicTerrainQueryCallback& callback,
345  makVrv::DtDynamicTerrainGeometry* geometry = 0,
346  bool useOriginalGeometry = false) { };
347 
350  virtual void cacheTerrainArea(int requestId,
351  unsigned minLOD, unsigned maxLOD, const DtExtent& cacheArea,
352  DtCacheProgressCallbackFunction fcn = 0, void* usr = 0);
353 
355  virtual void cancelCacheTerrainArea(int requestId);
356 
358  virtual void writeTerrainIndex(const DtString& name);
359 
360 protected:
362 
368 
369  boost::scoped_ptr<MAKVRinTerra::DtFeatureDatabase> myFeatureDatabase;
370  boost::scoped_ptr<MAKVRinTerra::DtFeatureContext> myFeatureContext;
371 };
372 
boost::scoped_ptr< MAKVRinTerra::DtFeatureDatabase > myFeatureDatabase
Definition: terrainImplementation.h:369
boost::function< void(const makVrv::DtDynamicTerrainFeature &)> DtDynamicTerrainQueryCallback
Definition: terrainImplementation.h:135
NOTE: This entire class is deprecated, in favor of Dt3dChord.
Definition: chord.h:40
Definition: stringKeyFactory.h:80
Class DtTerrainInterfaceConfig is a readable-writable class holding terrain interface configuration o...
Definition: terrainInterfaceConfig.h:32
This is the abstract base class for all terrain implementations.
Definition: terrainImplementation.h:162
boost::function< void(const makVrv::DtDynamicTerrainFeature &)> DtDynamicTerrainQueryCallback
Definition: terrainImplementation.h:321
Definition: terrainIntersectOptions.h:78
DtVrfChordIntersectionRecord represents a list of DtChordIntersectRecords.
Definition: vrfChordIntersectRecordList.h:31
virtual DtTerrainGeometryHandle * createEntityGeometry(const DtFilename &file)
Create geometry in the terrain which represents the entity.
Definition: terrainImplementation.h:303
virtual void queryCurrentDynamicTerrainFeatures(const DtDynamicTerrainQueryCallback &callback, makVrv::DtDynamicTerrainGeometry *geometry=0, bool useOriginalGeometry=false)
Definition: terrainImplementation.h:343
DtGenericTerrainRecords allow the VR-Forces terrainInterface library to instantiate and configure the...
Definition: DtGenericTerrainRecord.h:34
DtTerrainImplementation *(* DtCreatorFcn)(DtConsoleCommandManager *)
Definition: stringKeyFactory.h:84
std::list< std::pair< DtPagingMetaDataPtr, DtTerrainPagingGeometryPtr > > DtTerrainPagingGeometryList
Definition: terrainPagingGeometry.h:92
Represents (possibly infinite) area of space.
Definition: DtDynamicTerrainGeometry.h:19
class DtScenarioExplorer:
Definition: scenarioExplorer.h:26
Allows manipulating a terrain object.
Definition: terrainImplementation.h:139
bool myAssertOnBlockingTerrainCalls
Determines if an exception should be thrown if a blocking terrain call is made.
Definition: terrainImplementation.h:366
DtTerrainInterfaceConfig myConfig
Definition: terrainImplementation.h:361
Definition: terrainImplementation.h:73
This is a class which maintains a list of string command names and the callback functions that are to...
Definition: consoleCommandManager.h:48
The DtExtent represents an axis-aligned 3d bounding box.
Definition: extent.h:43
boost::shared_ptr< RequestHandleImpl > myImpl
Definition: terrainImplementation.h:98
bool myWarnOnBlockingTerrainCalls
Definition: terrainImplementation.h:367
DtTerrainIntersectOptions Passed to terrain intersect functions to modify how intersect acts...
Definition: terrainIntersectOptions.h:15
virtual bool dataAvailable(const DtTerrainPagingGeometryList &geometry, DtTerrainIntersectOptions::Fidelity=DtTerrainIntersectOptions::MAX_FIDELITY)
Returns true if all of the terrain which intersects the geometry list is paged in.
Definition: terrainImplementation.h:249
Definition: coordSystem.h:54
Represents some coordinate system.
Definition: proj.h:44
#define DT_DLL_terrainInterface
This file is used to determine how to build.
Definition: terrainInterfaceDefines.h:25
Factory templates DtStringKeyFactory and DtStringKeyFactoryWithParam.
virtual DtTerrainGeometryHandle * createEntityGeometry(const DtEntityType &file)
Create geometry in the terrain which represents the entity by the given type, looking up visuals...
Definition: terrainImplementation.h:306
This class holds parameters which define the capabilities of the current terrain. ...
Definition: terrainCapabilities.h:25
virtual void preloadTerrainAreas(const DtTerrainPagingGeometryList &preloadGeometry)
Specifies a list of terrain areas that should be preloaded by the terrain implementation, in the case of a paging or streaming terrain source.
Definition: terrainImplementation.h:245
RequestHandleImpl()
Definition: terrainImplementation.h:76
Definition: featureContext.h:51
DtTerrainImplementationFactory::DtCreatorFcn DtTerrainImplementationCreatorFcn
Definition: terrainImplementation.h:376
virtual DtTerrainInformation * terrainInformation()
Return the terrain information pointer of the terrain implementation (null if none exist) this is a d...
Definition: terrainImplementation.h:294
virtual DtDynamicTerrainRequestHandle addDynamicTerrainChangeRequest(double time, makVrv::DtDynamicTerrainChange *command)
Add a dynamic terrain change request to the system.
Definition: terrainImplementation.h:316
Definition: terrainImplementation.h:108
boost::shared_ptr< QueryHandleImpl > myImpl
Definition: terrainImplementation.h:131
Definition: vrfChordIntersectionRecord.h:19
virtual void loadVisuals(const DtScenarioExplorer &)
Tells the terrain implementation (if it cares) to load visuals to support terrain/model usage...
Definition: terrainImplementation.h:309
A DtChord is a finite line segment in 3-space, represented by two points.
Fidelity
Allows the system to use differently fidelity data for intersecting against.
Definition: terrainIntersectOptions.h:76
virtual void setIntersectDataLoadExpireTime(const double &expireTime)
No-op.
Definition: terrainImplementation.h:282
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
DtStringKeyFactoryWithParam< DtTerrainImplementation, DtConsoleCommandManager * > DtTerrainImplementationFactory
Definition: terrainImplementation.h:374
Command which can be given to the dynamic terrain system to perform some change.
Definition: DtDynamicTerrainChange.h:42
void(* DtCacheProgressCallbackFunction)(int requestId, int current, bool completed, double elapsedTime, void *usr)
Callback for terrain caching.
Definition: terrainImplementation.h:46
Resource handle for a query which has been added to the system.
Definition: terrainImplementation.h:104
Interface for getting terrain triangle data out of DtTerrainInterface::trianglesInArea.
Definition: terrainProcessPolygonsBox.h:113
Definition: featureContext.h:223
Resource handle for a dynamic terrain change request which has been added to the system.
Definition: terrainImplementation.h:69
boost::scoped_ptr< MAKVRinTerra::DtFeatureContext > myFeatureContext
Definition: terrainImplementation.h:370
virtual DtDynamicTerrainQueryHandle queryDynamicTerrainFeatures(const DtDynamicTerrainQueryCallback &callback, makVrv::DtDynamicTerrainGeometry *geometry=0, bool useOriginalGeometry=false)
Install a query which will call the supplied callback on matching dynamic terrain features as they ar...
Definition: terrainImplementation.h:336
virtual void expireDataLoadRequestsBeforeTime(const double &currentTime)
No-op.
Definition: terrainImplementation.h:288
TODO Put this in the makTerrainLib.
Definition: terrainInformation.h:17
Definition: point.h:34
DtTerrainIntersectStatus Contains information about result of terrain intersection.
Definition: terrainIntersectStatus.h:16
QueryHandleImpl()
Definition: terrainImplementation.h:111
Represents an area query which can be used to extract triangles from DtTerrainInterface.
Definition: terrainProcessPolygonsBox.h:39

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)