VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
attachedTerrain.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
15 
18 #include "vrfutil/rwInt.h"
19 #include "vrfutil/rwString.h"
20 #include "vrfutil/rwBoolean.h"
21 #include "vrfutil/readerWriter.h"
22 #include <matrix/vlDcm.h>
24 #include <geometry/point.h>
25 #include <geometry/chord.h>
26 #include <matrix/topoCoord.h>
27 #include <matrix/geodeticCoord.h>
28 #include <matrix/coordTransform.h>
29 #include <matrix/3dBoundingVolume.h>
30 
31 #include <boost/shared_ptr.hpp>
32 #include <boost/optional.hpp>
33 
34 class DtTerrainInterface;
35 class DtPhysicalWorld;
36 class DtVrfObject;
39 class DtSurface;
40 class Coordinate_System;
41 
43 {
44 public:
45 
48 
50  DtAttachedTerrain(const DtString& name,
51  DtReaderWriterRegistry* const parentRegistry = 0, DtVrfObject* owner = 0);
52 
53  DtAttachedTerrain(const DtSymbolString& name,
54  DtReaderWriterRegistry* const parentRegistry = 0, DtVrfObject* owner = 0);
55 
57  DtAttachedTerrain(const DtString& name, const DtAttachedTerrain& orig,
58  DtReaderWriterRegistry* const parentRegistry = 0);
59 
61  from, DtReaderWriterRegistry* const parentRegistry = 0);
62 
64  virtual ~DtAttachedTerrain();
65 
67  virtual DtVrfObject* vrfObject() const;
68 
71 
75  virtual const char* readerWriterType() const;
76 
77  static void objectAboutToBeRemovedCallback(DtVrfObject * vrfObject, void * usr);
78  virtual void processObjectAboutToBeRemovedCallback(DtVrfObject * vrfObject);
79 
80 public:
81  virtual const Coordinate_System* coordinateSystem() const;
82  virtual Coordinate_System* coordinateSystem();
83 
86  virtual void tick();
87 
89  virtual bool isHighFidelityTerrain() const;
90 
91  virtual bool skipThisObject() const;
92 
94  virtual void setStayAttachedEvenIfOff(bool);
95  virtual bool stayAttachedEvenIfOff() const;
96 
97  void setFallThroughToPhysicalWorld(bool val);
98  bool fallThroughToPhysicalWorld() const;
99 
100  virtual double terrainHeight(const DtVector& localLocation,
101  bool* dataAvailable = 0, bool overrideBlockingAssert = false) const;
102  virtual bool terrainHeight(const DtVector& localLocation,
103  double& terrainHeight, bool* dataAvailable = 0,
104  bool overrideBlockingAssert = false) const;
105 
106  virtual bool terrainHeightAndSurface(double lat, double lon,
107  double& terrainHeight, DtSurface& surface, bool* dataAvailable = 0,
108  bool overrideBlockingAssert = false) const;
109 
110  virtual bool terrainHeightAndSurface(const DtVector& localLocation,
111  double& terrainHeight, DtSurface& surface, bool* dataAvailable = 0,
112  bool overrideBlockingAssert = false) const;
113 
114 
115  virtual bool closestIntersection(const DtVector& localLocation,
116  DtPoint& intersectionPoint,
117  bool* dataAvailable = 0, bool overrideBlockingAssert = false) const;
118 
119  virtual bool closestIntersection(const DtVector& localLocation,
120  DtVector& intersectionPoint,
121  bool* dataAvailable = 0, bool overrideBlockingAssert = false) const;
122 
123  virtual bool closestIntersection(const DtVector& localLocation,
127  bool* dataAvailable = 0, bool overrideBlockingAssert = false) const;
128 
129  virtual bool intersect(const DtChord& chord, DtPoint& intersectionPoint,
130  double& intersectionTime,
131  bool* dataAvailable = 0, bool overrideBlockingAssert = false) const;
132 
133  virtual bool intersect(const DtChord& chord,
137  bool* dataAvailable = 0, bool overrideBlockingAssert = false) const;
138 
145  virtual bool closestIntersection(const DtVector& curPosition,
146  DtVector& intersection, bool ignoreWater, bool* dataAvailable = 0,
147  bool overrideBlockingAssert = false) const;
148 
174  virtual bool allIntersectsAlongChord(const DtChord& chord,
177  DtIntersectionRecord::INT_ALL_DATA, bool* dataAvailable = 0,
178  bool overrideBlockingAssert = false) const;
179 
180 protected:
181  bool testInvariant() const;
182 
184  virtual void updateCoordTransforms();
185 
187  virtual void updateBoundingVolume();
188 
190  virtual DtVector convertLocalPointToModelPoint(const DtVector& source) const;
191 
194  virtual DtChord convertLocalChordToModelChord(const DtChord& source) const;
195 
197  virtual DtVector convertModelPointToDatabasePoint(const DtPoint&) const;
198 
201  virtual void convertModelPointToDatabasePoint(DtVrfChordIntersectionRecord&) const;
202 
203  virtual unsigned intersectChordWithBoundingVolume(const DtChord& chord,
204  DtVrfChordIntersectionRecord* isect1 = 0,
205  DtVrfChordIntersectionRecord* isect2 = 0) const;
206 
207  virtual unsigned intersectChordWithBoundingVolume(const DtChord& chord, bool calculateNormal,
208  DtVrfChordIntersectionRecord* isect1 = 0,
209  DtVrfChordIntersectionRecord* isect2 = 0) const;
210 
211  virtual bool boundingVolumeAltitude(const DtVector& p, double& alt) const;
212 
213  virtual void closestPointToBoundingVolume(const DtPoint& p, DtVrfChordIntersectionRecord& out) const;
214 
215 public:
216  virtual bool entityIsValidAndAttached() const;
217 
218  virtual int appearanceFlags() const;
219 
220  void setObjectGeometricModel(boost::shared_ptr<DtTerrainInterface> newObjGeomModel);
221  boost::shared_ptr<DtTerrainInterface> objectGeometricModel() const;
222 
223  void setEntity(const DtSharedVrfObjectReference);
225 
226  void setPhysicalWorld(DtPhysicalWorld* newPhysicalWorld);
227  DtPhysicalWorld* physicalWorld();
228  const DtPhysicalWorld* physicalWorld() const;
229 
230  void clear();
231 
232  virtual DtAttachedTerrain* clone(const DtString& name, DtReaderWriterRegistry* const parentRegistry = 0) const;
233 
234 protected:
236 
238  boost::shared_ptr<DtTerrainInterface> myObjectGeometricModel;
239 
243 
246  DtCoordTransform myGeocentricToTopographic;
247  DtCoordTransform myTopographicToGeocentric;
248  DtCoordTransform myModelNormalToLocalNormal;
253  boost::optional<Dt3dBoundingVolume> myLastLocalBoundingVolume;
254 
257 
265 };
266 

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)