VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
geodeticCoord.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 1992-2025 MAK Technologies, Inc
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 
7 #ifndef DtGeodeticCoord_H_
8 #define DtGeodeticCoord_H_
9 
10 #include "vlVector.h"
11 #include "vlMath.h"
12 #include "referenceEllipsoid.h"
13 #include "geoidDatum.h"
14 #include <iosfwd>
15 
20 
21 
22 #ifdef DtUSE_UTILITIES_NAMESPACE
23 namespace DtUSE_UTILITIES_NAMESPACE
24 {
25 #endif
26 
31 {
32 public:
33 
39 
44  DtGeodeticCoord( double lat, double lon, double alt,
45  const DtReferenceEllipsoid* ellipse = DtGlobalEllipsoid() );
46 
48  virtual ~DtGeodeticCoord();
49 
51  DtGeodeticCoord( const DtGeodeticCoord& src );
52 
54  DtGeodeticCoord& operator=( const DtGeodeticCoord& src );
55 
59  virtual DtGeodeticCoord& setGeocentric( const DtVector& geocentric );
60 
63  virtual void getGeocentric( DtVector& geocentric ) const;
64 
68  virtual DtVector geocentric() const;
69 
70  virtual void printData() const;
71  virtual void printDataToStream(std::ostream &str) const;
72 
75  virtual void setLat( DtFloat64 lat );
76  virtual DtFloat64 lat() const;
77 
80  virtual void setLon( DtFloat64 lon );
81  virtual DtFloat64 lon() const;
82 
85  virtual void setAlt( DtFloat64 alt);
86  virtual DtFloat64 alt() const;
87 
88  virtual const DtMapDatum& mapDatum() const;
89 
91  virtual void setGeoidDatumType( DtGeoidType geoid );
92 
93 protected:
96 };
97 
99 {
100  return (*this)[0];
101 }
102 
104 {
105  return (*this)[1];
106 }
107 
109 {
110  if ( !myGeoidDatum )
111  {
112  return (*this)[2];
113  }
114  else
115  {
116  //convert long and lat to degrees
117  double latDegrees = DtRad2Deg((*this)[0]);
118  double lonDegrees = DtRad2Deg((*this)[1]);
119  //Find undulation and subtract it from the altitude.
120  double und = myGeoidDatum->undulation(latDegrees, lonDegrees);
121  return (*this)[2] - und;
122  }
123 }
124 
126 {
127  (*this)[0] = lat;
128 }
129 
131 {
132  (*this)[1] = lon;
133 }
134 
136 {
137  if ( !myGeoidDatum )
138  {
139  (*this)[2] = alt;
140  }
141  else
142  {
143  //convert long and lat to degrees
144  double latDegrees = DtRad2Deg((*this)[0]);
145  double lonDegrees = DtRad2Deg((*this)[1]);
146  //Find undulation and add it to the altitude value.
147  double und = myGeoidDatum->undulation(latDegrees, lonDegrees);
148  (*this)[2] = alt + und;
149  }
150 }
151 
152 DT_DLL_MATRIX std::ostream & operator << (std::ostream &str, const DtGeodeticCoord &sr);
153 
155 DT_DLL_MATRIX void DtGeocToGeod( const DtVector& in, DtGeodeticCoord& out );
156 
158 DT_DLL_MATRIX void DtGeodToGeoc( const DtGeodeticCoord& in, DtVector& out );
159 
160 #ifdef DtUSE_UTILITIES_NAMESPACE
161 }
162 #endif
163 
164 #endif
165 
This file contains the declaration of the DtGeoidDatum class as well as commonly used geoids...
virtual DtFloat64 alt() const
Definition: geodeticCoord.h:108
double DtRad2Deg(double rad)
Converts Radians to Degrees.
Definition: vlMath.h:81
void DtGeocToGeod(const DtVector &in, DtGeodeticCoord &out)
This function is deprecated, and provided for backwards compatibility only!
std::ostream & operator<<(std::ostream &os, const Dt3dChord &chord)
Definition: geoidDatum.h:59
Instances of DtGeodeticCoord are used to explicitly represent Geodetic coordinates.
Definition: geodeticCoord.h:30
DtMapDatums represent a spheroid model of the earth, with a data shift to facilitate easy conversion ...
Definition: mapDatum.h:50
Instances of this class are used to store a particular mapDatum and perform useful calculations based...
Definition: referenceEllipsoid.h:41
This file declares DtVector and DtVector32.
This file defines math constants and methods which may be useful in simulations.
Definition: vlVector.h:224
virtual void setLon(DtFloat64 lon)
Set/Get the longitude.
Definition: geodeticCoord.h:130
const DtReferenceEllipsoid * myEllipsoid
Definition: geodeticCoord.h:94
#define DT_DLL_MATRIX
Definition: vlMachineTypes.h:107
DtReferenceEllipsoid * DtGlobalEllipsoid()
Call this function to obtain a ptr to the global ellipsoid which is used for geodetic coord conversio...
virtual void setLat(DtFloat64 lat)
Set/Get the latitude.
Definition: geodeticCoord.h:125
virtual void setAlt(DtFloat64 alt)
Set/Get the altitude.
Definition: geodeticCoord.h:135
virtual DtFloat64 lat() const
Definition: geodeticCoord.h:98
void DtGeodToGeoc(const DtGeodeticCoord &in, DtVector &out)
This function is deprecated, and provided for backwards compatibility only!
virtual DtFloat64 lon() const
Definition: geodeticCoord.h:103
DtGeoidDatum * myGeoidDatum
Definition: geodeticCoord.h:95
This file contains the declaration of DtReferenceEllipsoid and several helper functions.
DtGeoidType
Geoid Type enumerations. Default is DtNoGeoid. There are 3 supported EGM models, EGM84, EGM96, EGM2008 in different resolutions.
Definition: geoidDatum.h:40

Document ID: Generated on Thu Oct 16 00:12:25 EDT 2025 from SVN revision 280738
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)