![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2007 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: DtUtmCoordinateConverter.h,v $ $Revision: 1.13 $ $State: Exp $ 00007 *********************************************************************/ 00008 00011 00012 #ifndef DtUtmCoordinateConverter_H_ 00013 #define DtUtmCoordinateConverter_H_ 00014 00015 #include <vrvUtil/DtCoordinateConverter.h> 00016 00017 namespace makVrv 00018 { 00019 00023 class DT_DLL_VRVUTIL DtUtmCoordinateConverter : public DtCoordinateConverter 00024 { 00025 public: 00026 00028 DtUtmCoordinateConverter(); 00029 00031 virtual ~DtUtmCoordinateConverter(); 00032 00034 virtual DtCoordinateConverter* clone() const; 00035 00040 virtual void init(double lat, double lon, long zone = 0, int useStandardOffsets = 0); 00041 00046 virtual void init(double lat, double lon, double z, long zone = 0, int useStandardOffsets = 0); 00047 00051 virtual void init(const DtGeodeticCoord& origin, long zone = 0, int useStandardOffsets = 0); 00052 00056 virtual void init(DtDegMinSec lat, DtDegMinSec lon, long zone = 0, int useStandardOffsets = 0); 00057 00061 virtual void init(DtDegMinSec lat, DtDegMinSec lon, double z, long zone = 0, int useStandardOffsets = 0); 00062 00066 virtual void init(long zone, char hemisphere = 'N', bool useMpiDefaultOrigin = true); 00067 00071 virtual void init(double falseOriginX, double falseOriginY, double falseOriginZ, 00072 long zone, char hemisphere = 'N', bool useMpiDefaultOrigin = true); 00073 00079 virtual bool init(const std::string& originstring); 00080 00082 virtual std::string stringRep(); 00083 00086 virtual const DtGeodeticCoord& origin() const; 00087 00089 virtual bool useStandardOffsets() const; 00090 00092 virtual long zone() const; 00093 virtual void setZone(long zone); 00094 00096 virtual DtDegMinSec latRef() const; 00097 virtual DtDegMinSec longRef() const; 00098 00099 /********************* Conversions *****************************/ 00101 virtual void geocToCig(const DtVector& geoc, DtVector& out) const; 00102 00103 virtual const DtUtmReferencePoint* referencePoint() const; 00104 00106 virtual void cigToGeoc(const DtVector& in, DtVector& geoc) const; 00107 00108 virtual void setupTopoFrame(const DtVector& truth); 00109 00110 protected: 00111 00114 std::string parseUtm( DtDegMinSec lat, DtDegMinSec lng, bool bUseStandardOffsets, long zone ); 00115 00116 public: 00117 00118 static DtCoordinateConverter* create(); 00119 static double calculateUtmLongitudeOrigin(double zone, bool useMpiDefaultOrigin = true); 00120 00121 static void calculateUtmLatLonOrigin(double zone, double falseOriginX, double falseOriginY, 00122 double& latitude, double& longitude, bool useMpiDefaultOrigin = true); 00123 00124 static int utmGridZoneFromLatLon( double latitudeInDegrees, double longitudeInDegrees ); 00125 00126 // Useful functions for dealing with vrlink Utm Ref Point routines that use DtDegMinSec 00127 static void setLatDtDegMinSecFromDegrees(DtDegMinSec& dmslat, double deg); 00128 static void setLonDtDegMinSecFromDegrees(DtDegMinSec& dmslon, double deg); 00129 00130 // Get a utm reference point initialized to the zone center and equator for specified 00131 // geodetic coordinates. 00132 static void initUtmReferencePointForZone( double longitude, bool standardOffsets, 00133 const DtMapDatum& datum, DtUtmReferencePoint& refToInitialized ); 00134 00135 // returns the zone's central meridian, in degrees 00136 static double utmZoneToCentralMeridian( int zone ); 00137 00138 protected: 00139 00140 // Used by setLatDtDegMinSecFromDegrees and setLonDtDegMinSecFromDegrees 00141 static void setDtDegMinSecFromDegrees(DtDegMinSec& dms, double deg); 00142 00143 00144 private: 00145 00147 DtUtmCoordinateConverter(const DtUtmCoordinateConverter& orig); 00148 00150 DtUtmCoordinateConverter& operator=(const DtUtmCoordinateConverter& orig); 00151 00152 protected: 00153 00154 mutable DtUtmReferencePoint myReferencePoint; 00155 00156 bool myUseStandardOffsets; 00157 }; 00158 00159 } 00160 00161 #endif