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-2010 VT MAK
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 printDataToStream(std::ostream &str) const;
71 
74  virtual void setLat( DtFloat64 lat );
75  virtual DtFloat64 lat() const;
76 
79  virtual void setLon( DtFloat64 lon );
80  virtual DtFloat64 lon() const;
81 
84  virtual void setAlt( DtFloat64 alt);
85  virtual DtFloat64 alt() const;
86 
87  virtual const DtMapDatum& mapDatum() const;
88 
90  virtual void setGeoidDatumType( DtGeoidType geoid );
91 
92 protected:
95 };
96 
98 {
99  return (*this)[0];
100 }
101 
103 {
104  return (*this)[1];
105 }
106 
108 {
109  if ( !myGeoidDatum )
110  {
111  return (*this)[2];
112  }
113  else
114  {
115  //convert long and lat to degrees
116  double latDegrees = DtRad2Deg((*this)[0]);
117  double lonDegrees = DtRad2Deg((*this)[1]);
118  //Find undulation and subtract it from the altitude.
119  double und = myGeoidDatum->undulation(latDegrees, lonDegrees);
120  return (*this)[2] - und;
121  }
122 }
123 
125 {
126  (*this)[0] = lat;
127 }
128 
130 {
131  (*this)[1] = lon;
132 }
133 
135 {
136  if ( !myGeoidDatum )
137  {
138  (*this)[2] = alt;
139  }
140  else
141  {
142  //convert long and lat to degrees
143  double latDegrees = DtRad2Deg((*this)[0]);
144  double lonDegrees = DtRad2Deg((*this)[1]);
145  //Find undulation and add it to the altitude value.
146  double und = myGeoidDatum->undulation(latDegrees, lonDegrees);
147  (*this)[2] = alt + und;
148  }
149 }
150 
151 DT_DLL_MATRIX std::ostream & operator << (std::ostream &str, const DtGeodeticCoord &sr);
152 
154 DT_DLL_MATRIX void DtGeocToGeod( const DtVector& in, DtGeodeticCoord& out );
155 
157 DT_DLL_MATRIX void DtGeodToGeoc( const DtGeodeticCoord& in, DtVector& out );
158 
159 #ifdef DtUSE_UTILITIES_NAMESPACE
160 }
161 #endif
162 
163 #endif
164 
This file contains the declaration of the DtGeoidDatum class as well as commonly used geoids...
virtual DtFloat64 alt() const
Definition: geodeticCoord.h:107
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:129
const DtReferenceEllipsoid * myEllipsoid
Definition: geodeticCoord.h:93
#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:124
virtual void setAlt(DtFloat64 alt)
Set/Get the altitude.
Definition: geodeticCoord.h:134
virtual DtFloat64 lat() const
Definition: geodeticCoord.h:97
void DtGeodToGeoc(const DtGeodeticCoord &in, DtVector &out)
This function is deprecated, and provided for backwards compatibility only!
virtual DtFloat64 lon() const
Definition: geodeticCoord.h:102
DtGeoidDatum * myGeoidDatum
Definition: geodeticCoord.h:94
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 Mon Apr 25 03:39:01 EDT 2022 from SVN revision 242502
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)