VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCoordinateConverter.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2014 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 
8 
9 #pragma once
10 
11 #include <vrvUtil/vrvUtil.h>
12 
13 #include <matrix/geodeticCoord.h>
14 #include <matrix/utmReferencePoint.h>
15 #include <matrix/vlDcm.h>
16 #include <matrix/vlVector.h>
17 #include <string>
18 
19 namespace makVrv
20 {
21 
26 {
27 public:
28 
29  static const char* NoOp;
30  static const char* Geocentric;
31 
32  static const char* UTM;
33  static const char* Lambert;
34  static const char* FlatEarth;
35  static const char* Cartesian;
36 
37 public:
38 
39  typedef DtCoordinateConverter* (*CreatorFn)();
40 
41 public:
42 
44  virtual ~DtCoordinateConverter();
45 
47  virtual const std::string& type() const;
48 
50  virtual DtCoordinateConverter* clone() const = 0;
51 
53  virtual bool init(const std::string& originstring) = 0;
54 
56  virtual std::string stringRep() = 0;
57 
59  virtual bool zIsAlt() const;
60 
62  virtual bool usesOffsetFile() const;
63 
66  virtual DtGeodeticCoord databaseOrigin() const;
67 
69  virtual void setGeocOriginOffset(const DtVector& offset){};
70 
73  virtual void reset();
74 
75  /* inspectors/mutators for DCM's */
77  virtual const DtDcm& nedToCigDcm() const;
78 
80  virtual const DtDcm& cigToNedDcm() const;
81 
83  virtual const DtDcm& geocToCigDcm() const;
84 
87  virtual const DtDcm& cigToGeocDcm() const;
88 
90  virtual const DtDcm& geocToNedDcm() const;
91 
94 
96  virtual const DtDcm& cigToEnuDcm() const;
97 
99  virtual const DtDcm& nedToGeocDcm() const;
100 
101  /*************************** conversions **********************************/
103  virtual void geocToCig(const DtVector& geoc, DtVector& out) const = 0;
105  virtual void cigToGeoc(const DtVector& in, DtVector& geoc) const = 0;
106 
109  virtual void setupTopoFrame(const DtVector& truth);
110 
112  virtual void cigToEnu_coordTrans(const DtVector& cigPos,
113  DtVector& enuPos) const;
114 
116  virtual void cigToEnu_vecTrans(const DtVector& cigVec,
117  DtVector& enuVec) const;
118 
120  virtual void enuToCig_coordTrans(const DtVector& enuPos,
121  DtVector& cigPos) const;
122 
125  virtual void enuToCig_vecTrans(const DtVector& enuVec,
126  DtVector& cigVec) const;
127 
129  virtual DtVector& enuToCig_vecTrans(const DtVector& origin,
130  const DtVector& offset) const;
131 
134  virtual const DtTaitBryan& nedToCig_EulerTrans(
135  const DtTaitBryan& topo) const;
136 
137  /* ---------------------- Utilities ---------------------------- */
139  virtual DtVector up(const DtVector& orig) const;
140 
142  virtual void topoSurface(const DtVector& o, DtVector& surface) const;
143 
144  const DtDcm nedToEnuDcm() const
145  {
146  return myNedToEnuDcm;
147  }
148 
149 public:
150 
151  static double convertToDouble(const std::string& str);
152  static double convertToDouble(const DtDegMinSec& dms);
153  static DtDegMinSec convertToDmsLat(double deg);
154  static DtDegMinSec convertToDmsLon(double deg);
155 
157  static bool isCoordinateSystemProjected( const std::string& csType );
158 
159 protected:
160 
162  DtCoordinateConverter(const std::string& t);
163 
165  std::string polarDirectionToStr(int dir);
166 
168  std::string parseLatLng( const DtDegMinSec& lat, const DtDegMinSec& lng);
169 
170 private:
171 
174 
176  DtCoordinateConverter& operator=(const DtCoordinateConverter& orig);
177 
178 protected:
179 
181  std::string myType;
183  bool myZAlt;
184 
186  DtGeodeticCoord myGeodOrigin;
187 
191 
194 
197 
199  const DtDcm myNedToEnuDcm;
200 
203 
206 };
207 
209 void DT_DLL_VRVUTIL DtQuaternionToEulerDeg(const double x, const double y, const double z,
210  const double w, double& yawOut, double& pitchOut, double& rollOut);
211 
213 void DT_DLL_VRVUTIL DtQuaternionToEulerRad(const double x, const double y, const double z,
214  const double w, double& yawOut, double& pitchOut, double& rollOut);
215 
217 void DT_DLL_VRVUTIL DtEulerToQuaternionDeg(const double yaw, const double pitch , const double roll,
218  double& xOut, double& yOut, double& zOut, double& wOut);
219 
221 void DT_DLL_VRVUTIL DtEulerToQuaternionRad(const double yaw, const double pitch , const double roll,
222  double& xOut, double& yOut, double& zOut, double& wOut);
223 
224 }

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)