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 _Celestiodetic_h
00077 #define _Celestiodetic_h
00078
00079 #include "BaseSRF.h"
00080 #include "Coord.h"
00081 #include "Exception.h"
00082
00083 namespace srm
00084 {
00091 class EXPORT_SRM_CPP_DLL SRF_Celestiodetic: public BaseSRF_WithEllipsoidalHeight
00092 {
00093 public:
00097 static SRF_Celestiodetic* create( SRM_ORM_Code orm,
00098 SRM_RT_Code rt );
00099
00103 static SRF_Celestiodetic* create( SRM_SRF_Parameters_Info srf_params )
00104 {
00105 return create( srf_params.value.srf_template.orm_code, srf_params.rt_code );
00106 }
00107
00110 Coord3D* createCoordinate3D(SRM_Long_Float coord_comp1,
00111 SRM_Long_Float coord_comp2,
00112 SRM_Long_Float coord_comp3 );
00113
00116 CoordSurf* createSurfaceCoordinate(SRM_Long_Float coord_surf_comp1,
00117 SRM_Long_Float coord_surf_comp2 );
00118
00121 virtual bool isA( SRF_ClassType type ) const;
00122
00125 virtual SRF_ClassType getClassType() const
00126 {
00127 return BaseSRF::SRF_TYP_CD;
00128 }
00129
00133 bool isEqual( const SRF_Celestiodetic &srf ) const;
00134
00138 bool operator==( const SRF_Celestiodetic &rhs ) const;
00139
00143 SRF_Celestiodetic* makeCopy() const;
00144
00152 virtual SRM_Coordinate_Valid_Region changeCoordinate3DSRF(const Coord3D &src_coord,
00153 Coord3D &des_coord );
00154
00158 const char* toString();
00159
00160 protected:
00161 friend class BaseSRF;
00162 SRF_Celestiodetic( void *impl );
00163 SRF_Celestiodetic &operator =( const SRF_Celestiodetic & ) { return *this; }
00164 virtual ~SRF_Celestiodetic();
00165 };
00166
00167
00168 inline bool SRF_Celestiodetic::isA( SRF_ClassType type ) const
00169 {
00170 if (type == BaseSRF::SRF_TYP_CD)
00171 return true;
00172 else
00173 return BaseSRF_WithEllipsoidalHeight::isA(type);
00174 };
00175
00176
00178 typedef SRF_Celestiodetic SRF_CD;
00179
00180
00185 class EXPORT_SRM_CPP_DLL Coord3D_Celestiodetic: public Coord3D
00186 {
00187 public:
00190 Coord3D_Celestiodetic(SRF_Celestiodetic *srf,
00191 SRM_Long_Float longitude = 0.0,
00192 SRM_Long_Float latitude = 0.0,
00193 SRM_Long_Float ellipsoidal_height = 0.0 )
00194 : Coord3D(srf)
00195 {
00196 setComponentValues(longitude, latitude, ellipsoidal_height);
00197 }
00198
00201 Coord3D_Celestiodetic( const Coord3D_Celestiodetic &coord )
00202 : Coord3D(coord._srf)
00203 {
00204 setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00205 }
00206
00212 void copyTo( Coord3D_Celestiodetic &coord ) const
00213 {
00214 if (coord._srf != _srf)
00215 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00216
00217 coord._values[0] = _values[0];
00218 coord._values[1] = _values[1];
00219 coord._values[2] = _values[2];
00220 }
00221
00225 bool isEqual( const Coord3D_Celestiodetic &coord ) const
00226 {
00227 return (_srf == coord._srf &&
00228 _values[0] == coord._values[0] &&
00229 _values[1] == coord._values[1] &&
00230 _values[2] == coord._values[2] );
00231 }
00232
00235 void setComponentValues( SRM_Long_Float longitude, SRM_Long_Float latitude, SRM_Long_Float ellipsoidal_height )
00236 {
00237 _values[0] = longitude;
00238 _values[1] = latitude;
00239 _values[2] = ellipsoidal_height;
00240 }
00241
00244 SRM_Long_Float get_longitude() const
00245 {
00246 return _values[0];
00247 }
00248
00251 SRM_Long_Float get_latitude() const
00252 {
00253 return _values[1];
00254 }
00255
00258 SRM_Long_Float get_ellipsoidal_height() const
00259 {
00260 return _values[2];
00261 }
00262
00265 void set_longitude( SRM_Long_Float value )
00266 {
00267 _values[0] = value;
00268 }
00269
00272 void set_latitude( SRM_Long_Float value )
00273 {
00274 _values[1] = value;
00275 }
00276
00279 void set_ellipsoidal_height( SRM_Long_Float value )
00280 {
00281 _values[2] = value;
00282 }
00283
00286 virtual bool isA( Coord_ClassType type ) const;
00287
00290 virtual Coord_ClassType getClassType() const
00291 {
00292 return Coord::COORD_TYP_CD;
00293 }
00294
00297 bool operator==( const Coord3D_Celestiodetic &rhs ) const;
00298
00304 bool isCompatibleWith( const Coord3D_Celestiodetic &rhs ) const
00305 {
00306 return ((*(SRF_Celestiodetic*)(this->_srf)) == (*(SRF_Celestiodetic*)(rhs._srf)));
00307 }
00308
00313 Coord3D_Celestiodetic &operator= ( const Coord3D_Celestiodetic &rhs )
00314 {
00315 if((*(SRF_Celestiodetic*)(this->_srf)) == (*(SRF_Celestiodetic*)(rhs._srf)))
00316 {
00317 _values[0] = rhs._values[0];
00318 _values[1] = rhs._values[1];
00319 _values[2] = rhs._values[2];
00320 }
00321 else
00322 throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00323 "Coord3D_Celestiodetic op=: incompatible rhs coordinate");
00324
00325 return *this;
00326 }
00327 };
00328
00329
00330 inline bool Coord3D_Celestiodetic::isA( Coord_ClassType type ) const
00331 {
00332 if (type == Coord::COORD_TYP_CD)
00333 return true;
00334 else
00335 return Coord3D::isA(type);
00336 };
00337
00338
00340 typedef Coord3D_Celestiodetic Coord3D_CD;
00341
00342
00347 class EXPORT_SRM_CPP_DLL CoordSurf_Celestiodetic: public CoordSurf
00348 {
00349 public:
00352 CoordSurf_Celestiodetic(SRF_Celestiodetic *srf,
00353 SRM_Long_Float longitude = 0.0,
00354 SRM_Long_Float latitude = 0.0 )
00355 : CoordSurf(srf)
00356 {
00357 setComponentValues(longitude, latitude);
00358 }
00359
00362 CoordSurf_Celestiodetic( const CoordSurf_Celestiodetic &coord )
00363 : CoordSurf(coord._srf)
00364 {
00365 setComponentValues( coord._values[0], coord._values[1] );
00366 }
00367
00373 void copyTo( CoordSurf_Celestiodetic &coord ) const
00374 {
00375 if (coord._srf != _srf)
00376 throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00377
00378 coord._values[0] = _values[0];
00379 coord._values[1] = _values[1];
00380 }
00381
00385 bool isEqual( const CoordSurf_Celestiodetic &coord ) const
00386 {
00387 return (_srf == coord._srf &&
00388 _values[0] == coord._values[0] &&
00389 _values[1] == coord._values[1] );
00390 }
00391
00394 void setComponentValues( SRM_Long_Float longitude, SRM_Long_Float latitude )
00395 {
00396 _values[0] = longitude;
00397 _values[1] = latitude;
00398 }
00399
00402 SRM_Long_Float get_longitude() const
00403 {
00404 return _values[0];
00405 }
00406
00409 SRM_Long_Float get_latitude() const
00410 {
00411 return _values[1];
00412 }
00413
00416 void set_longitude( SRM_Long_Float value )
00417 {
00418 _values[0] = value;
00419 }
00420
00423 void set_latitude( SRM_Long_Float value )
00424 {
00425 _values[1] = value;
00426 }
00427
00430 virtual bool isA( Coord_ClassType type ) const;
00431
00434 virtual Coord_ClassType getClassType() const
00435 {
00436 return Coord::COORD_TYP_SURF_CD;
00437 }
00438
00441 bool operator==(const CoordSurf_Celestiodetic &rhs) const;
00442
00448 bool isCompatibleWith( const CoordSurf_Celestiodetic &rhs ) const
00449 {
00450 return ((*(SRF_Celestiodetic*)(this->_srf)) == (*(SRF_Celestiodetic*)(rhs._srf)));
00451 }
00452
00457 CoordSurf_Celestiodetic &operator= ( const CoordSurf_Celestiodetic &rhs )
00458 {
00459 if((*(SRF_Celestiodetic*)(this->_srf)) == (*(SRF_Celestiodetic*)(rhs._srf)))
00460 {
00461 _values[0] = rhs._values[0];
00462 _values[1] = rhs._values[1];
00463 }
00464 else
00465 throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00466 "CoordSurf_Celestiodetic op=: incompatible rhs coordinate");
00467
00468 return *this;
00469 }
00470 };
00471
00472
00473 inline bool CoordSurf_Celestiodetic::isA( Coord_ClassType type ) const
00474 {
00475 if (type == Coord::COORD_TYP_SURF_CD)
00476 return true;
00477 else
00478 return CoordSurf::isA(type);
00479 };
00480
00481
00483 typedef CoordSurf_Celestiodetic CoordSurf_CD;
00484
00485 }
00486
00487 #endif // _Celestiodetic_h