VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
scriptGeometry.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 #pragma once
6 
8 #include <matrix/vlVector.h>
10 #include <matrix/geodeticCoord.h>
11 
16 
17 class DtVectorGeoc3D;
18 class DtVector3D;
19 class DtVectorOffset3D;
20 
23  : public DtAsciiSerializable
24 #ifdef DtObjectDebugger_Enable
25  , public DtObjectDebugger<DtLocation3D>
26 #endif
27 {
28 public:
31 
34  DtLocation3D(const DtVector &vect);
35  DtLocation3D(const DtGeodeticCoord &geodCoord);
36  DtLocation3D(const DtLocation3D& orig);
37  DtLocation3D();
38  ~DtLocation3D();
39  DtLocation3D& operator=(const DtLocation3D& orig);
40 
42  DtLocation3D(const double latitude, const double longitude,
43  const double altitudeMSL);
44 
48  DtLocation3D makeCopy() const;
49 
50  //-------------------------------------------
53 
55  DtString objectType() const;
56 
59 
62  bool deserialize(const DtString& data);
63 
65  static DtAsciiSerializable* creator();
67  //--------------------------------------------
68 
73  DtVector getGeocentric() const;
74  DtGeodeticCoord geodLocation() const;
75 
81  void setGeodeticFromVector(const DtVector& geodeticData);
82  DtVector getGeodeticVector(void) const;
83 
87  double getLat() const;
88  void setLat(const double lat);
89  double getLon() const;
90  void setLon(const double lon);
91  double getAlt() const;
92  void setAlt(const double alt);
94 
96  double distanceToLocation3D(const DtLocation3D &location) const;
97 
98  bool isNearLocation3D(const DtLocation3D &loc, const double error) const;
99 
103  bool isInsidePolygon(const std::vector<DtLocation3D> polyPoints)const;
104 
108  bool isLeftOfLine(const DtLocation3D &loc1, const DtLocation3D & loc2) const;
109 
113 
118  DtVector3D vectorToLoc3D(const DtLocation3D &location) const;
119 
121  DtVectorGeoc3D vectorGeocToLoc3D(const DtLocation3D &location) const;
122 
124  DtLocation3D addVector3D(const DtVector3D &vec) const;
125 
128  DtLocation3D addVectorGeoc3D(const DtVectorGeoc3D &vec) const;
129 
131  void setGeocentric(double x, double y, double z);
132 
134  void getGeocentricCoords(double& x, double& y, double& z) const;
135 
136  bool operator==(const DtLocation3D&) const;
137  bool operator!=(const DtLocation3D& orig) const
138  {
139  return !(*this == orig);
140  }
141 protected:
145  DtGeodeticCoord myGeodLocation;
146 };
147 
149 
150 DT_DLL_vrfutil std::ostream& operator<<(std::ostream& stream, const DtLocation3D& loc);
151 
158  : public DtAsciiSerializable
159 #ifdef DtObjectDebugger_Enable
160  , public DtObjectDebugger<DtVector3D>
161 #endif
162 {
163 public:
166 
168  DtVector3D();
169  DtVector3D(const DtVector &vect);
170  DtVector3D(const DtVector3D &vect);
171  ~DtVector3D();
172  DtVector3D& operator=(const DtVector3D& orig);
173  DtVector nedVector() const;
174 
176  DtVector3D(const double north, const double east, const double down);
177 
181  void setFromGeocentricVector(const DtVector &geocVec, DtLocation3D& origin);
182 
186  DtVector3D makeCopy() const;
187 
188  //-------------------------------------------
191 
193  DtString objectType() const;
194 
197 
200  bool deserialize(const DtString& data);
201 
203  static DtAsciiSerializable* creator();
205  //--------------------------------------------
206 
208  void setNorthEastDown(const double north, const double east,
209  const double down);
213  void setBearingInclRange(const double bearing, const double inclination,
214  const double range);
215 
220  double getBearing(void) const;
222  double getInclination(void)const;
224  double getRange(void)const;
226 
227  double getNorth(void)const;
229  double getEast(void) const;
231  double getDown(void) const;
234 
237  DtVector3D getScaled(const double scale) const;
238  DtVector3D getNegated(void) const;
239  DtVector3D getUnit(void) const;
240 
242  DtVector3D addVector3D(const DtVector3D &vec) const;
243 
245  DtVector3D crossVector3D(const DtVector3D &vec) const;
246 
248  double dotVector3D(const DtVector3D &vec) const;
249 
253  DtVector3D addOffset(const DtVectorOffset3D & offset) const;
254 
258  double headingDiff(const DtVector3D &vec) const;
259 
262  DtVectorGeoc3D makeVectorGeoc3DAtLoc(const DtLocation3D &loc) const;
263 
264  bool operator==(const DtVector3D&) const;
265  bool operator!=(const DtVector3D& orig) const
266  {
267  return !(*this == orig);
268  }
269 
270 protected:
273 };
274 
276 
277 DT_DLL_vrfutil std::ostream& operator<<(std::ostream& stream, const DtVector3D& vec);
278 
286  : public DtVector3D
287 #ifdef DtObjectDebugger_Enable
288  , public DtObjectDebugger<DtVector2D>
289 #endif
290 {
291 public:
294 
298  DtVector2D();
299  DtVector2D(const DtVector &vect);
300  DtVector2D(const DtVector3D &vect);
301  ~DtVector2D();
302  DtVector2D& operator=(const DtVector3D& orig);
303 
305  DtVector2D(const double north, const double east);
306 
308  DtString objectType() const;
309 
311  static DtAsciiSerializable* creator();
312 
313  void setNorth(const double north);
314  void setEast(const double east);
315 
317  DtVector2D addVector2D(const DtVector3D& vec);
318 
320  double crossVector2D(const DtVector3D &vec);
321 
323  double dotVector2D(const DtVector3D &vec);
324 
326  DtVector2D addOffset2D(const DtVectorOffset3D &vec);
327 
328  bool operator==(const DtVector2D&) const;
329  bool operator!=(const DtVector2D& orig) const
330  {
331  return !(*this == orig);
332  }
333 };
334 
336 
337 DT_DLL_vrfutil std::ostream& operator<<(std::ostream& stream, const DtVector2D& vec);
338 
339 
344  : public DtAsciiSerializable
345 #ifdef DtObjectDebugger_Enable
346  , public DtObjectDebugger<DtVectorGeoc3D>
347 #endif
348 {
349 public:
350  DtVectorGeoc3D(const DtVector &vect);
351  DtVectorGeoc3D(const DtVectorGeoc3D& orig);
352  ~DtVectorGeoc3D();
353  DtVectorGeoc3D& operator=(const DtVectorGeoc3D& orig);
354 
355  DtVector geocVector() const;
356 
357  //-------------------------------------------
360 
362  DtString objectType() const;
363 
366 
369  bool deserialize(const DtString& data);
370 
372  static DtAsciiSerializable* creator();
374  //--------------------------------------------
375 
379  DtVectorGeoc3D makeCopy() const;
380 
383  DtVector3D makeVector3DAtLoc(const DtLocation3D loc) const;
384 
387  DtVectorGeoc3D getScaled(const double scale) const;
388  DtVectorGeoc3D getNegated(void) const;
389  DtVectorGeoc3D getUnit(void) const;
391 
393  DtVectorGeoc3D crossVectorGeoc3D(const DtVectorGeoc3D &vec) const;
394 
396  double dotVectorGeoc3D(const DtVectorGeoc3D &vec) const;
397 
398 
400  double getLength() const;
401 
402  bool operator==(const DtVectorGeoc3D&) const;
403  bool operator!=(const DtVectorGeoc3D& orig) const
404  {
405  return !(*this == orig);
406  }
407 
408 protected:
410 };
411 
413 
414 DT_DLL_vrfutil std::ostream& operator<<(std::ostream& stream, const DtVectorGeoc3D& vec);
415 
423 
425  : public DtAsciiSerializable
426 #ifdef DtObjectDebugger_Enable
427  , public DtObjectDebugger<DtVectorOffset3D>
428 #endif
429 {
430 public:
432 
435  DtVectorOffset3D(const DtVector &vect);
436  DtVectorOffset3D(const DtVectorOffset3D &orig);
437  ~DtVectorOffset3D();
438  DtVectorOffset3D& operator=(const DtVectorOffset3D& orig);
439 
441  DtVectorOffset3D(double right, double forward, double up);
442 
445  void setFromBodyVector(const DtVector &vect);
446 
450  DtVectorOffset3D makeCopy() const;
451 
452  //-------------------------------------------
455 
457  DtString objectType() const;
458 
461 
464  bool deserialize(const DtString& data);
465 
467  static DtAsciiSerializable* creator();
469  //--------------------------------------------
470 
473  double getRight(void) const;
474  void setRight(const double right);
475  double getForward(void) const;
476  void setForward(const double forward);
477  double getUp(void) const;
478  void setUp(const double up);
480 
483  DtVectorOffset3D getScaled(const double scale) const;
484  DtVectorOffset3D getNegated(void) const;
485  DtVectorOffset3D getUnit(void) const;
487 
489  DtVectorOffset3D addOffset(const DtVectorOffset3D offset) const;
490 
492  DtVectorOffset3D crossVectorOffset3D(const DtVectorOffset3D &vec) const;
493 
495  double dotVectorOffset3D(const DtVectorOffset3D &vec) const;
496 
500  DtVector3D makeVectorRefToDirection(const DtVector3D dirVect) const;
501 
502  DtVector vector() const;
503 
504  bool operator==(const DtVectorOffset3D&) const;
505  bool operator!=(const DtVectorOffset3D& orig) const
506  {
507  return !(*this == orig);
508  }
509 protected:
512 };
513 
515 
517 DT_DLL_vrfutil std::ostream& operator<<(std::ostream& stream, const DtVectorOffset3D& vec);
518 
static DtAsciiSerializable * creator()
Returns a new object of this type with default values.
voidpf uLong int origin
Definition: ioapi.h:42
Definition: asciiSerializable.h:34
virtual bool deserialize(const DtString &)=0
This function should take the string that was serialized via serialize() and fill this object with th...
DT_DLL_terrainCS bool operator==(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
#define DT_DEFINE_OBJECT_DEBUGGER_NAME(type)
Definition: objectCounter.h:265
Default on in debug, off in release.
Definition: objectCounter.h:31
DtVector myVector
Stores components right, forward, and up.
Definition: scriptGeometry.h:511
DT_DLL_features std::ostream & operator<<(std::ostream &, const DtFeatureTransform &)
std::ostream output.
virtual DtString serialize()=0
The following characters are reserved and cannot be used in serialization: &#39;|&#39;, &#39;:&#39;.
DtVector myGeocVector
Definition: scriptGeometry.h:409
bool operator!=(const DtVector3D &orig) const
Components are north-east-down.
Definition: scriptGeometry.h:265
VectorOffset3D is a direction vector that is relative to some direction specified by a Vector3D...
Definition: scriptGeometry.h:424
DtString objectType() const
Inherited from DtAsciiSerializable.
DtVector myNEDVector
Components are north-east-down.
Definition: scriptGeometry.h:272
bool operator!=(const DtVectorOffset3D &orig) const
Definition: scriptGeometry.h:505
DtVector3D & operator=(const DtVector3D &orig)
bool operator!=(const DtVectorGeoc3D &orig) const
Definition: scriptGeometry.h:403
Definition: asyncJobServer.h:39
DtVector2D is a vector in earth-relative coordinates, e.g. east-north. Its direction in space depends...
Definition: scriptGeometry.h:285
virtual DtString objectType() const =0
Should return the string name of this object. The object name should not be part of the serialization...
DtVector3D is a vector in earth-relative coordinates, e.g. east-north or heading-range. Its direction in space depends on where on the earth it is attached (like topocentric coordinates).
Definition: scriptGeometry.h:157
voidpf stream
Definition: ioapi.h:39
VectorGeoc3D is a direction in 3-space, i.e. a vector in geocentric coordinates.
Definition: scriptGeometry.h:343
bool operator!=(const DtVector2D &orig) const
Definition: scriptGeometry.h:329
DtGeodeticCoord myGeodLocation
The private data. Kept in geodetic (lat, lon, alt) (units radians, radians, meters) assuming that mor...
Definition: scriptGeometry.h:145
bool operator!=(const DtLocation3D &orig) const
Definition: scriptGeometry.h:137
#define DT_DLL_vrfutil
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfutilDefines.h:34
voidpf uLong offset
Definition: ioapi.h:42
A location3D is a point in space, i.e. a geocentric coordinate.
Definition: scriptGeometry.h:22

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)