VR-Forces 4.1 Class Documentation
DtCoordinateConverter.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1999 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: DtCoordinateConverter.h,v $ $Revision: 1.16 $ $State: Exp $
7 *********************************************************************/
8 
11 
12 #ifndef DtCoordinateConverter_H_
13 #define DtCoordinateConverter_H_
14 
15 #include <vrvUtil/vrvUtil.h>
16 
17 #include <matrix/geodCoord.h>
18 #include <matrix/utmRefPt.h>
19 #include <matrix/vlDcm.h>
20 #include <matrix/vlVector.h>
21 #include <string>
22 
23 namespace makVrv
24 {
25 
30 {
31 public:
32 
33  static const char* NoOp;
34  static const char* Geocentric;
35 
36  static const char* UTM;
37  static const char* Lambert;
38  static const char* FlatEarth;
39  static const char* Cartesian;
40 
41 public:
42 
43  typedef DtCoordinateConverter* (*CreatorFn)();
44 
45 public:
46 
48  virtual ~DtCoordinateConverter();
49 
51  virtual const std::string& type() const;
52 
54  virtual DtCoordinateConverter* clone() const = 0;
55 
57  virtual bool init(const std::string& originstring) = 0;
58 
60  virtual std::string stringRep() = 0;
61 
63  virtual bool zIsAlt() const;
64 
66  virtual bool usesOffsetFile() const;
67 
70  virtual DtGeodeticCoord databaseOrigin() const;
71 
73  virtual void setGeocOriginOffset(const DtVector& offset){};
74 
77  virtual void reset();
78 
79  /* inspectors/mutators for DCM's */
81  virtual const DtDcm& nedToCigDcm() const;
82 
84  virtual const DtDcm& cigToNedDcm() const;
85 
87  virtual const DtDcm& geocToCigDcm() const;
88 
91  virtual const DtDcm& cigToGeocDcm() const;
92 
94  virtual const DtDcm& geocToNedDcm() const;
95 
98 
100  virtual const DtDcm& cigToEnuDcm() const;
101 
103  virtual const DtDcm& nedToGeocDcm() const;
104 
105  /*************************** conversions **********************************/
107  virtual void geocToCig(const DtVector& geoc, DtVector& out) const = 0;
109  virtual void cigToGeoc(const DtVector& in, DtVector& geoc) const = 0;
110 
113  virtual void setupTopoFrame(const DtVector& truth);
114 
116  virtual void cigToEnu_coordTrans(const DtVector& cigPos,
117  DtVector& enuPos) const;
118 
120  virtual void cigToEnu_vecTrans(const DtVector& cigVec,
121  DtVector& enuVec) const;
122 
124  virtual void enuToCig_coordTrans(const DtVector& enuPos,
125  DtVector& cigPos) const;
126 
129  virtual void enuToCig_vecTrans(const DtVector& enuVec,
130  DtVector& cigVec) const;
131 
133  virtual DtVector& enuToCig_vecTrans(const DtVector& origin,
134  const DtVector& offset) const;
135 
138  virtual const DtTaitBryan& nedToCig_EulerTrans(
139  const DtTaitBryan& topo) const;
140 
141  /* ---------------------- Utilities ---------------------------- */
143  virtual DtVector up(const DtVector& orig) const;
144 
146  virtual void topoSurface(const DtVector& o, DtVector& surface) const;
147 
148 public:
149 
150  static double convertToDouble(const std::string& str);
151  static double convertToDouble(const DtDegMinSec& dms);
152  static DtDegMinSec convertToDmsLat(double deg);
153  static DtDegMinSec convertToDmsLon(double deg);
154 
156  static bool isCoordinateSystemProjected( const std::string& csType );
157 
158 protected:
159 
161  DtCoordinateConverter(const std::string& t);
162 
164  std::string polarDirectionToStr(int dir);
165 
167  std::string parseLatLng( DtDegMinSec lat, DtDegMinSec lng);
168 
169 private:
170 
173 
175  DtCoordinateConverter& operator=(const DtCoordinateConverter& orig);
176 
177 protected:
178 
180  std::string myType;
182  bool myZAlt;
183 
185  DtGeodeticCoord myGeodOrigin;
186 
190 
193 
196 
198  const DtDcm myNedToEnuDcm;
199 
202 
205 };
206 
208 void DT_DLL_VRVUTIL DtQuaternionToEulerDeg(const double x, const double y, const double z,
209  const double w, double& yawOut, double& pitchOut, double& rollOut);
210 
212 void DT_DLL_VRVUTIL DtQuaternionToEulerRad(const double x, const double y, const double z,
213  const double w, double& yawOut, double& pitchOut, double& rollOut);
214 
216 void DT_DLL_VRVUTIL DtEulerToQuaternionDeg(const double yaw, const double pitch , const double roll,
217  double& xOut, double& yOut, double& zOut, double& wOut);
218 
220 void DT_DLL_VRVUTIL DtEulerToQuaternionRad(const double yaw, const double pitch , const double roll,
221  double& xOut, double& yOut, double& zOut, double& wOut);
222 
223 }
224 
225 #endif

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)