![]() |
VR-Link API Documentation for HLA 1.3
|
00001 /******************************************************************************* 00002 ** Copyright (c) 1992-2010 VT MAK 00003 ** All rights reserved. 00004 *******************************************************************************/ 00008 #pragma once 00009 #include "geodCoord.h" 00010 00011 #ifdef DtUSE_UTILITIES_NAMESPACE 00012 namespace DtUSE_UTILITIES_NAMESPACE 00013 { 00014 #endif 00015 00016 enum DtPolarDirection { DtEast, DtWest, DtNorth, DtSouth }; 00017 00018 00024 class DtDegMinSec 00025 { 00026 public: 00027 double deg, min, sec; 00028 DtPolarDirection direction; 00029 }; 00030 00041 class DT_DLL_MATRIX DtUtmReferencePoint 00042 { 00043 public: 00044 00046 DtUtmReferencePoint(); 00047 00051 DtUtmReferencePoint( const DtDegMinSec& latRef, 00052 const DtDegMinSec& lonRef, 00053 int standardOffsets=1, 00054 long zone = 0, 00055 const DtMapDatum& mapDatum = DtCurrentMapDatum(), 00056 double scaleFactor = 0.9996); 00057 00059 virtual ~DtUtmReferencePoint(); 00060 00063 virtual void geod2utm( double alat, double alon, double* x, double* y ); 00064 00067 virtual void utm2geod( double x, double y, double* lat, double* lon ); 00068 00070 virtual const DtMapDatum& mapDatum() const; 00071 00073 virtual void useMapDatum( const DtMapDatum& mapDatum ); 00074 00076 virtual const DtReferenceEllipsoid* ellipsoid() const; 00077 00079 void init(const DtDegMinSec& latRef, 00080 const DtDegMinSec& lonRef, 00081 int standardOffsets=1, 00082 long zone = 0, 00083 const DtMapDatum& mapDatum = DtCurrentMapDatum() ); 00084 00089 virtual void uninitialize(); 00090 00092 virtual bool isInitialized() const; 00093 00095 virtual double scale() const; 00097 virtual void setScale(double scale); 00098 00099 virtual double xOrigin() const; 00100 virtual void setXOrgin(double x_origin); 00101 00102 virtual double yOrigin() const; 00103 virtual void setYOrgin(double y_origin); 00104 00105 virtual int standardOffsets() const; 00106 virtual void setStandardOffsets(int so); 00107 00108 virtual DtDegMinSec latRef() const; 00109 virtual void setLatRef(const DtDegMinSec &lat_ref); 00110 00111 virtual DtDegMinSec longRef() const; 00112 virtual void setLongRef(const DtDegMinSec &lat_ref); 00113 00114 virtual long zoneOrigin() const; 00115 virtual void setZoneOrigin(long zo); 00116 00117 virtual double standardFalseEasting() const; 00118 virtual void setStandardFalseEasting(double sfe); 00119 00120 virtual double standardFalseNorthing() const; 00121 virtual void setStandardFalseNorthing(double sfn); 00122 00123 virtual double standardFalseNorthingCrossover() const; 00124 virtual void setStandardFalseNorthingCrossover(double sfnc); 00125 00126 protected: 00127 00128 void initDatumConstants(); 00129 void initUtm( const double lat[4], const double lon[4], long zone = 0 ); 00130 void degree( const double a[3], double* b ) const ; 00131 00133 00134 00135 00136 00137 virtual void geod2utm( double lat, double lon, 00138 long* zone, double* northing, double* easting ); 00139 virtual void utm2geod( double northing, double easting, 00140 long zone, double* lat, double* lon ); 00142 00143 protected: 00144 00145 int myInited; 00146 int myStandardOffsets; 00147 double myXOrigin; 00148 double myYOrigin; 00149 00150 long myZoneOrigin; 00151 DtDegMinSec myLatRef; 00152 DtDegMinSec myLonRef; 00153 00155 DtReferenceEllipsoid myEllipsoid; 00156 00158 DtFloat64 mySemiMajor; 00159 DtFloat64 mySemiMinor; 00160 DtFloat64 myE_sq; 00161 DtFloat64 myEp_sq; 00162 DtFloat64 myEf; 00163 00164 DtFloat64 myScale; 00166 double myStandardFalseEasting; 00167 double myStandardFalseNorthing; 00168 double myStandardFalseNorthingCrossover; 00169 00170 protected: 00171 00172 00176 static void setLongitudeFudgeFactor(double val); 00177 00178 static double theLongitudeFudgeFactor; 00179 }; 00180 00181 DT_DLL_MATRIX DtUtmReferencePoint* DtGlobalUtmReferencePoint(); 00182 00186 int DtUtmGridZoneFromLatLon(double latitude, double longitude); 00187 00188 #ifdef DtUSE_UTILITIES_NAMESPACE 00189 } 00190 #endif 00191 00192 00193