![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2005 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: lamConfCrdSys.h,v $ $Revision: 1.15 $ $State: Exp $ 00007 *********************************************************************/ 00008 #ifndef lamConfCrdSys_H_ 00009 #define lamConfCrdSys_H_ 00010 00011 // 00012 // \file lamConfCrdSys.h 00013 // \brief Contains the lambert conformal coordinate system class declaration. 00014 // 00015 #include "terrainCS/terrainCSDefines.h" 00016 #include "terrainCS/utmCoordSys.h" 00017 00018 // Derived class for converting between DIS (geocentric) and 00019 // coordinates in a Lambert Conformal projection. 00020 // 00021 // Before instantiating this class, you must call DtUseMapDatum 00022 // to specify which shape for the earth you want to use. 00023 // 00024 // \note This class does not support dynamic scene origin 00025 class DT_DLL_terrainCS DtLambertConformalCS : public DtUtmCS 00026 { 00027 public: 00028 00029 // The values passed to the constructor (all in radians) are: 00030 // lambda0 - longitude east of Greenwich of the central meridian of the map 00031 // phi0 - middle latitude 00032 // phi1, phi2 - standard parallels of latitude 00033 DtLambertConformalCS(double passedLambda0, double passedPhi0, 00034 double passedPhi1, double passedPhi2); 00035 00036 // Need this for FILE* based constructor in derived class. 00037 DtLambertConformalCS(); 00038 00039 DtLambertConformalCS(const DtLambertConformalCS& orig); 00040 00041 // Destructor 00042 virtual ~DtLambertConformalCS(); 00043 00044 // Assignment operator 00045 DtLambertConformalCS& operator=( 00046 const DtLambertConformalCS& orig); 00047 00048 // Clone operator 00049 virtual Coordinate_System* clone() const; 00050 00051 // Coordinates in the local (i.e., projected) coordinate system only 00052 // consist of X and Y, but we use a three element vector to store them so a 00053 // programmer can use the Z value for height above terrain. 00054 virtual void dis2local(const DtVector& in, DtVector& out) const; 00055 virtual void local2dis(const DtVector& in, DtVector& out) const; 00056 00057 // Returns name of coordinate system 00058 virtual DtString coordinateSystemName() const; 00059 00060 double getPhi1() const; 00061 double getPhi2() const; 00062 00063 virtual bool isSameCS(const Coordinate_System* CSystem) const; 00064 00065 // Override as UTM grid declination calculations should not be used for this 00066 virtual DtDcm topoToUtmMatrix(const DtVector& geocLoc) const; 00067 virtual DtDcm utmToTopoMatrix(const DtVector& geocLoc) const; 00068 00069 protected: 00070 // The projection requires: 00071 00072 // Semi-major axis of the ellipsoid of reference 00073 double a; 00074 00075 // Semi-minor axis of the ellipsoid of reference 00076 double b; 00077 00078 // Eccentricity of the ellipsoid (1 - b^2/a^2)^ (1/2) 00079 double e; 00080 00081 // Middle latitude 00082 double phi0; 00083 00084 // Standard parallels of latitude 00085 double phi1; 00086 double phi2; 00087 00088 // Longitude east of Greenwich of the central meridian of the map 00089 double lambda0; 00090 00091 // Intermediate parameters that don't rely on phi and lambda 00092 double n; 00093 double F; 00094 double p0; 00095 00096 // The forward and inverse coordinate transformations share several 00097 // intermediate variables which are further based on lower level 00098 // parameters. The low level and intermediate variables are not based on 00099 // the lat/lon being transformed. They only rely on the reference 00100 // ellipsoid, central meridian, middle and standard parallels. Since they 00101 // are not dependent on the lat/long being translated, they need only be 00102 // computed once. Based on Map Projections: A Working Manual by Snyder, the 00103 // parameters can be divided thusly: low level parameters are m1, m2, t0, 00104 // t1 and t2. They are only used to compute the intermediate 00105 // parameters. intermediate parameters are n, F and p0 are the same for both 00106 // forward and inverse computations t and p are different for forward and 00107 // inverse computations. To prevent the repetition of code, a function is 00108 // provided to compute intermediate parameters. 00109 00110 void computeIntermediateParameters(double* n,double* F,double* p0); 00111 }; 00112 00113 inline double DtLambertConformalCS::getPhi1() const 00114 { 00115 return phi1; 00116 } 00117 00118 inline double DtLambertConformalCS::getPhi2() const 00119 { 00120 return phi2; 00121 } 00122 00123 #endif