00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076 #ifndef _Coord_h
00077 #define _Coord_h
00078
00079 #if !defined(_WIN32)
00080 #define EXPORT_SRM_CPP_DLL
00081 #elif defined(BUILD_SRM_CPP)
00082 #if !defined(EXPORT_SRM_CPP_DLL)
00083 #if defined(_LIB)
00084 #define EXPORT_SRM_CPP_DLL
00085 #elif defined(_USRDLL)
00086 #define EXPORT_SRM_CPP_DLL __declspec(dllexport)
00087 #else
00088 #define EXPORT_SRM_CPP_DLL __declspec(dllimport)
00089 #endif
00090 #endif
00091 #else
00092 #define EXPORT_SRM_CPP_DLL
00093 #endif
00094
00095 #include "BaseSRF.h"
00096
00097 namespace srm
00098 {
00099
00108 class EXPORT_SRM_CPP_DLL Coord
00109 {
00110 public:
00113 enum Coord_ClassType
00114 {
00115 COORD_TYP_TWO_D,
00116 COORD_TYP_SURFACE,
00117 COORD_TYP_THREE_D,
00118 COORD_TYP_LSA,
00119 COORD_TYP_CC,
00120 COORD_TYP_CD,
00121 COORD_TYP_SURF_CD,
00122 COORD_TYP_CM,
00123 COORD_TYP_EC,
00124 COORD_TYP_SURF_EC,
00125 COORD_TYP_EI,
00126 COORD_TYP_HAEC,
00127 COORD_TYP_HEEC,
00128 COORD_TYP_HEEQ,
00129 COORD_TYP_LCC,
00130 COORD_TYP_SURF_LCC,
00131 COORD_TYP_LCE_3D,
00132 COORD_TYP_LSR_3D,
00133 COORD_TYP_LSR_2D,
00134 COORD_TYP_LTSAS,
00135 COORD_TYP_SURF_LTSAS,
00136 COORD_TYP_LTSC,
00137 COORD_TYP_SURF_LTSC,
00138 COORD_TYP_LTSE,
00139 COORD_TYP_SURF_LTSE,
00140 COORD_TYP_M,
00141 COORD_TYP_SURF_M,
00142 COORD_TYP_OMS,
00143 COORD_TYP_SURF_OMS,
00144 COORD_TYP_LSP,
00145 COORD_TYP_PS,
00146 COORD_TYP_SURF_PS,
00147 COORD_TYP_PD,
00148 COORD_TYP_SURF_PD,
00149 COORD_TYP_SEC,
00150 COORD_TYP_SEQ,
00151 COORD_TYP_SME,
00152 COORD_TYP_SMD,
00153 COORD_TYP_TM,
00154 COORD_TYP_SURF_TM
00155 };
00156
00159 BaseSRF *getSRF() const
00160 {
00161 return _srf;
00162 }
00163
00166 virtual Coord_ClassType getClassType() const = 0;
00167
00170 virtual bool isA( Coord_ClassType type ) const;
00171
00174 virtual const char *toString() = 0;
00175
00176 protected:
00179 Coord( BaseSRF *srf )
00180 {
00181 _srf = srf->clone();
00182 }
00183
00188 Coord &operator =( const Coord &coord )
00189 {
00190 return *this;
00191 }
00192
00195 virtual ~Coord()
00196 {
00197 _srf->release();
00198 }
00199
00202 BaseSRF *_srf;
00203 };
00204
00205 inline bool Coord::isA( Coord_ClassType type ) const
00206 {
00207 return false;
00208 }
00209
00213 class EXPORT_SRM_CPP_DLL Coord2D: public Coord
00214 {
00215 public:
00218 virtual bool isA( Coord_ClassType type ) const;
00219
00222 const SRM_Long_Float *getValues() const
00223 {
00224 return _values;
00225 }
00226
00229 void setValues( const SRM_Long_Float values[2])
00230 {
00231 _values[0] = values[0];
00232 _values[1] = values[1];
00233 }
00234
00237 const char *toString();
00238
00239 protected:
00242 Coord2D( BaseSRF *srf )
00243 : Coord(srf)
00244 {
00245 }
00246
00249 SRM_Long_Float _values[2];
00250 };
00251
00252
00255 inline bool Coord2D::isA( Coord_ClassType type ) const
00256 {
00257 if ( type == Coord::COORD_TYP_TWO_D )
00258 return true;
00259 else
00260 return Coord::isA(type);
00261 }
00262
00263
00267 class EXPORT_SRM_CPP_DLL CoordSurf: public Coord
00268 {
00269 public:
00272 virtual bool isA( Coord_ClassType type ) const;
00273
00276 const SRM_Long_Float *getValues() const
00277 {
00278 return _values;
00279 }
00280
00283 void setValues( const SRM_Long_Float values[2] )
00284 {
00285 _values[0] = values[0];
00286 _values[1] = values[1];
00287 }
00288
00291 virtual const char *toString();
00292
00293 protected:
00296 CoordSurf( BaseSRF *srf )
00297 : Coord(srf)
00298 {
00299 }
00300
00303 SRM_Long_Float _values[2];
00304 };
00305
00306 inline bool CoordSurf::isA( Coord_ClassType type ) const
00307 {
00308 if ( type == Coord::COORD_TYP_SURFACE )
00309 return true;
00310 else
00311 return Coord::isA(type);
00312 }
00313
00317 class EXPORT_SRM_CPP_DLL Coord3D: public Coord
00318 {
00319 public:
00322 virtual bool isA( Coord_ClassType type ) const;
00323
00326 const SRM_Long_Float *getValues() const
00327 {
00328 return _values;
00329 }
00330
00333 void setValues( const SRM_Long_Float values[3])
00334 {
00335 _values[0] = values[0];
00336 _values[1] = values[1];
00337 _values[2] = values[2];
00338 }
00339
00342 virtual const char* toString();
00343
00354 virtual const char* getMGRS( SRM_Integer precision );
00355
00366 virtual void setCoord( const char* mgrs );
00367
00368 protected:
00371 Coord3D( BaseSRF *srf )
00372 : Coord(srf)
00373 {
00374 }
00375
00378 SRM_Long_Float _values[3];
00379 };
00380
00381 inline bool Coord3D::isA( Coord_ClassType type ) const
00382 {
00383 if ( type == Coord::COORD_TYP_THREE_D )
00384 return true;
00385 else
00386 return Coord::isA(type);
00387 }
00388
00389 }
00390
00391 #endif // _Coord_h