VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
utmCS.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1996 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: utmCoordSys.h,v $ $Revision: 1.35 $ $State: Exp $
7 *********************************************************************/
8 #ifndef utmCS_H_
9 #define utmCS_H_
10 
11 //
12 // \file utmCoordSys.h Contains the declaration of the UTM coordinate system class.
13 //
15 #include "terrainCS/coordSystem.h"
16 #include <matrix/utmCoord.h>
17 #include <vl/utmView.h>
18 #include <matrix/utmReferencePoint.h>
19 
20 // DtUtmCS is the base class for converting between DIS
21 // (geocentric) and local (DB) coordinates. Coordinates are WGS84
22 // geocentric Cartesian coordinate (GCC) systems. Rotations are
23 // defined as right-handed rotations about Z, then Y, then X and DIS
24 // body coordinates ate defined as Y front, X right, Z down.
25 // Rotations transform between DIS body and DIS world.
26 //
27 // All derived classes convert between their own system and the DIS
28 // system
30 {
31 public:
32 
33  DtUtmCS(const DtDegMinSec &refLatitude,
34  const DtDegMinSec &refLongitude,
35  int standardOffsets,
36  long zone = 0,
37  bool setUseDynamicSceneOrigin = false,
38  double dynamicSceneOriginDeadband = 0.0,
39  double scaleFactor = 0.9996);
40 
41  DtUtmCS(double refLatitude, // in Radians
42  double refLongitude, // in Radians
43  int standardOffsets,
44  long zone = 0,
45  bool setUseDynamicSceneOrigin = false,
46  double dynamicSceneOriginDeadband = 0.0,
47  double scaleFactor = 0.9996);
48 
49  //
50  // \note These parameters are available from ModSAF CTDBs.
51  DtUtmCS(int zone,
52  double northing,
53  double easting,
54  double scaleFactor = 0.9996);
55 
56  DtUtmCS(const DtUtmCS& orig);
57 
58  // Destructor
59  virtual ~DtUtmCS();
60 
61  // Assignment operator
62  DtUtmCS& operator=(const DtUtmCS& orig);
63 
64  // Clone operator
65  virtual Coordinate_System* clone() const;
66 
67 
68  virtual void dis2local(const DtVector& in, DtVector& out) const;
69 
70  virtual void dis2local(const DtDcm& in, DtDcm& out) const;
71 
72  virtual void dis2local(const DtVector& vIn, const DtDcm& dIn,
73  DtVector& vOut, DtDcm& dOut) const;
74 
75  virtual void disBody2localBody(const DtVector& in, DtVector& out) const;
76 
77  virtual void disBody2localBody(const DtDcm& in, DtDcm& out) const;
78 
79  virtual void local2dis(const DtVector& in, DtVector& out) const;
80 
81  virtual void local2dis(const DtDcm& in, DtDcm& out) const;
82 
83  virtual void local2dis(const DtVector& vIn, const DtDcm& dIn,
84  DtVector& vOut, DtDcm& dOut) const;
85 
86  virtual void localBody2disBody(const DtVector& in, DtVector& out) const;
87 
88  virtual void localBody2disBody(const DtDcm& in, DtDcm& out) const;
89 
90  // \return The geodetic coordinate for a given local position.
91  virtual void localToGeodetic(const DtVector& localPosition,
92  DtGeodeticCoord& geodeticPosition) const;
93 
94  // \return The local coordinate for a given geodetic position.
95  virtual void geodeticToLocal(const DtGeodeticCoord& geodeticPosition,
96  DtVector& localPosition) const;
97 
98  // \return A coordinate transformation object for going between
99  // topo and local coordinates, at a given location. It is up to the
100  // caller to ensure that topoToLocal and localToTopo are valid pointers.
101  virtual void topoToLocal(const DtVector& localPosition,
102  DtDcm& topoToLocal) const;
103  virtual void localToTopo(const DtVector& localPosition,
104  DtDcm& localToTopo) const;
105 
106  // \return Unit vector pointing down (along the direction of gravity)
107  // at the specified location.
108  virtual DtVector down(const DtVector& location) const;
109 
110  // Reset the origin of the scene
111  virtual void updateDynamicSceneOrigin(const DtVector& newOrigin);
112 
113  // Given a latitude & longitude, returns the UTM zone number in which
114  // that coordinates resides. With the exception of a couple anomalies,
115  // the world is broken up into 6 degree wide slices.
116  static DtU16 latlonToUtmZone(double lat_deg, double lon_deg);
117 
118  // \return The UTM zone of utmReferencePoint
119  virtual long zone() const;
120 
121  // \return Zone of myZone member.
122  long userSetZone() const;
123  void setUserSetZone(long);
124 
125  // Reinitializes coordinate system from newly specified zone
126  virtual void initFromZone(long zone);
127 
128  // Call this to reset the lat/lon and zone from new values. Will only
129  // set the coordinate system. Will not reset the coordinates of the
130  // database
131  virtual void initFromLatLonZone(double radLat, double radLon, int zone = 0, double scaleFactor = 0.9996);
132 
133  int zoneOrigin() const;
134 
135  // Returns name of coordinate system
136  virtual DtString coordinateSystemName() const;
137 
138  double projectionScale() const;
139  virtual void setOrigin(const DtGeodeticCoord& c);
140 
141  virtual bool isSameCS(const Coordinate_System* CSystem) const;
142 
143  // Returns transform matricies that use grid declination to be able to translate
144  // between coordiate systems
145  virtual DtDcm geocToUtmMatrix(const DtVector& geocLoc) const;
146  virtual DtDcm utmToGeocMatrix(const DtVector& geocLoc) const;
147  virtual DtDcm utmToTopoMatrix(const DtVector& geocLoc) const;
148  virtual DtDcm topoToUtmMatrix(const DtVector& geocLoc) const;
149 
150  virtual void setStandardFalseEasting(double);
151  virtual void setStandardFalseNorthing(double);
152 
153  virtual double standardFalseEasting() const;
154  virtual double standardFalseNorthing() const;
155 
156  const DtUtmReferencePoint* utmReferencePoint() const;
157 
158 private:
159  // This class only partially overrides these functions, so hide them explicitly.
164 
165 public:
166  static double UTM_Projection_Scale;
167 
168 protected:
169 
170  // Used by derived classes
171  DtUtmCS();
172 
173  void initRefLatLon(const DtDegMinSec &refLatitude, const DtDegMinSec &refLongitude,
174  int standardOffsets, long zone = 0, bool setUseDynamicSceneOrigin = false,
175  double dynamicSceneOriginDeadband = 0.0, double scaleFactor = 0.9996);
176 
179 
180  // These are saved so that we can serialize and un-serialize the CS.
181  DtDegMinSec myRefLatitude;
182  DtDegMinSec myRefLongitude;
183  long myZone;
188  DtUtmReferencePoint myUtmReferencePoint;
189 };
190 
191 inline const DtUtmReferencePoint* DtUtmCS::utmReferencePoint() const
192 {
193  return &myUtmReferencePoint;
194 }
195 
196 inline int DtUtmCS::zoneOrigin() const
197 {
198  return myUtmReferencePoint.zoneOrigin();
199 }
200 
201 inline double DtUtmCS::projectionScale() const
202 {
203  return myScaleFactor;
204 }
205 
206 inline long DtUtmCS::userSetZone() const
207 {
208  return myZone;
209 }
210 
211 inline void DtUtmCS::setUserSetZone(long c)
212 {
213  myZone = c;
214 }
215 
216 #endif
virtual void disBody2localBody(const DtVector &in, DtVector &out) const
const DtUtmReferencePoint * utmReferencePoint() const
Definition: utmCS.h:191
int myUseDynamicSceneOrigin
Definition: utmCS.h:185
virtual void updateDynamicSceneOrigin(const DtVector &New_Origin)
void setUserSetZone(long)
Definition: utmCS.h:211
double myScaleFactor
Definition: utmCS.h:187
double myDynamicSceneOriginDeadband
Definition: utmCS.h:186
virtual bool isSameCS(const Coordinate_System *CSystem) const
long userSetZone() const
Definition: utmCS.h:206
DtUtmReferencePoint myUtmReferencePoint
Definition: utmCS.h:188
virtual void setOrigin(const DtGeodeticCoord &)
Definition: utmCS.h:29
DtDcm myOriginUtm2Dis
Definition: utmCS.h:178
virtual void localToTopo(const DtVector &localPosition, DtDcm &localToTopo) const
double projectionScale() const
Definition: utmCS.h:201
Definition: coordSystem.h:54
virtual void local2dis(const DtVector &in, DtVector &out) const
virtual void dis2local(const DtVector &in, DtVector &out) const
virtual void topoToLocal(const DtVector &localPosition, DtDcm &topoToLocal) const
int myStandardOffsets
Definition: utmCS.h:184
Coordinate_System & operator=(const Coordinate_System &orig)
virtual void geodeticToLocal(const DtGeodeticCoord &geodeticPosition, DtVector &localPosition) const
virtual DtVector down(const DtVector &localPosition) const
virtual Coordinate_System * clone() const
DtDegMinSec myRefLongitude
Definition: utmCS.h:182
virtual void localBody2disBody(const DtVector &in, DtVector &out) const
virtual void localToGeodetic(const DtVector &localPosition, DtGeodeticCoord &geodeticPosition) const
long myZone
Definition: utmCS.h:183
DtDcm myOriginDis2Utm
Definition: utmCS.h:177
virtual DtString coordinateSystemName() const
#define DT_DLL_terrainCS
Definition: terrainCSDefines.h:23
static double UTM_Projection_Scale
Definition: utmCS.h:166
DtDegMinSec myRefLatitude
Definition: utmCS.h:181
int zoneOrigin() const
Definition: utmCS.h:196

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)