VR-Forces 4.0.4 Class Documentation
include/vrvUtil/DtCoordinateConverter.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 1999 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 *********************************************************************/
00005 /*********************************************************************
00006 ** $RCSfile: DtCoordinateConverter.h,v $ $Revision: 1.16 $ $State: Exp $
00007 *********************************************************************/
00008 
00011 
00012 #ifndef DtCoordinateConverter_H_
00013 #define DtCoordinateConverter_H_
00014 
00015 #include <vrvUtil/vrvUtil.h>
00016 
00017 #include <matrix/geodCoord.h>
00018 #include <matrix/utmRefPt.h>
00019 #include <matrix/vlDcm.h>
00020 #include <matrix/vlVector.h>
00021 #include <string>
00022 
00023 namespace makVrv
00024 {
00025 
00029 class DT_DLL_VRVUTIL DtCoordinateConverter
00030 {
00031 public:
00032 
00033    static const char* NoOp;       
00034    static const char* Geocentric; 
00035 
00036    static const char* UTM;        
00037    static const char* Lambert;    
00038    static const char* FlatEarth;  
00039    static const char* Cartesian;  
00040 
00041 public:
00042 
00043    typedef DtCoordinateConverter* (*CreatorFn)();
00044 
00045 public:
00046 
00048    virtual ~DtCoordinateConverter();
00049 
00051    virtual const std::string& type() const;
00052 
00054    virtual DtCoordinateConverter* clone() const = 0;
00055 
00057    virtual bool init(const std::string& originstring) = 0;
00058 
00060    virtual std::string stringRep() = 0;
00061 
00063    virtual bool zIsAlt() const;
00064 
00066    virtual bool usesOffsetFile() const;
00067 
00070    virtual DtGeodeticCoord databaseOrigin() const;
00071 
00073    virtual void setGeocOriginOffset(const DtVector& offset){};
00074 
00077    virtual void reset();
00078 
00079    /* inspectors/mutators for DCM's */
00081    virtual const DtDcm& nedToCigDcm() const;
00082 
00084    virtual const DtDcm& cigToNedDcm() const;
00085 
00087    virtual const DtDcm& geocToCigDcm() const;
00088 
00091    virtual const DtDcm& cigToGeocDcm() const;
00092 
00094    virtual const DtDcm& geocToNedDcm() const;
00095 
00098    
00100    virtual const DtDcm& cigToEnuDcm() const;
00101 
00103    virtual const DtDcm& nedToGeocDcm() const;
00104 
00105    /*************************** conversions **********************************/
00107    virtual void geocToCig(const DtVector& geoc, DtVector& out) const = 0;
00109    virtual void cigToGeoc(const DtVector& in, DtVector& geoc) const = 0;
00110    
00113    virtual void setupTopoFrame(const DtVector& truth);
00114 
00116    virtual void cigToEnu_coordTrans(const DtVector& cigPos,
00117       DtVector& enuPos) const;
00118 
00120    virtual void cigToEnu_vecTrans(const DtVector& cigVec,
00121       DtVector& enuVec) const;
00122 
00124    virtual void enuToCig_coordTrans(const DtVector& enuPos,
00125       DtVector& cigPos) const;
00126 
00129    virtual void enuToCig_vecTrans(const DtVector& enuVec,
00130       DtVector& cigVec) const;
00131 
00133    virtual DtVector& enuToCig_vecTrans(const DtVector& origin,
00134       const DtVector& offset) const;
00135 
00138    virtual const DtTaitBryan& nedToCig_EulerTrans(
00139       const DtTaitBryan& topo) const;
00140   
00141    /* ---------------------- Utilities ---------------------------- */
00143    virtual DtVector up(const DtVector& orig) const;
00144 
00146    virtual void topoSurface(const DtVector& o, DtVector& surface) const;
00147 
00148 public:
00149 
00150    static double convertToDouble(const std::string& str);
00151    static double convertToDouble(const DtDegMinSec& dms);
00152    static DtDegMinSec convertToDmsLat(double deg);
00153    static DtDegMinSec convertToDmsLon(double deg);
00154 
00156    static bool isCoordinateSystemProjected( const std::string& csType );
00157 
00158 protected:
00159 
00161    DtCoordinateConverter(const std::string& t);
00162 
00164    std::string polarDirectionToStr(int dir);
00165 
00167    std::string parseLatLng( DtDegMinSec lat, DtDegMinSec lng);
00168 
00169 private:
00170 
00172    DtCoordinateConverter(const DtCoordinateConverter& orig);
00173 
00175    DtCoordinateConverter& operator=(const DtCoordinateConverter& orig);
00176    
00177 protected:
00178 
00180    std::string myType;
00181    bool myUsesWarbreaker;
00182    bool myZAlt;
00183 
00185    DtGeodeticCoord myGeodOrigin;
00186 
00188    DtDcm myNedToGeocDcm;
00189    DtDcm myGeocToNedDcm;
00190 
00191    DtDcm myNedToCigDcm;
00192    DtDcm myCigToNedDcm;
00193 
00194    DtDcm myGeocToCigDcm;
00195    DtDcm myCigToGeocDcm;
00196 
00197    DtDcm myCigToEnuDcm;
00198    const DtDcm myNedToEnuDcm;
00199 
00201    DtDcm myNed2CigEulerDcm;
00202 
00204    DtVector myLastLocation;
00205 };
00206 
00208 void DT_DLL_VRVUTIL DtQuaternionToEulerDeg(const double x, const double y, const double z, 
00209    const double w, double& yawOut, double& pitchOut, double& rollOut);
00210 
00212 void DT_DLL_VRVUTIL DtQuaternionToEulerRad(const double x, const double y, const double z, 
00213    const double w, double& yawOut, double& pitchOut, double& rollOut);
00214 
00216 void DT_DLL_VRVUTIL DtEulerToQuaternionDeg(const double yaw, const double pitch , const double roll, 
00217    double& xOut, double& yOut, double& zOut, double& wOut);
00218 
00220 void DT_DLL_VRVUTIL DtEulerToQuaternionRad(const double yaw, const double pitch , const double roll, 
00221    double& xOut, double& yOut, double& zOut, double& wOut);
00222 
00223 }
00224 
00225 #endif

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)