Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

LocalTangentSpaceEuclidean.h

Go to the documentation of this file.
00001 
00005 // SRM SDK Release 4.1.2 - July 1, 2009
00006 
00007 // - SRM spec. 4.1
00008 
00009 /*
00010  *                             NOTICE
00011  * 
00012  * This software is provided openly and freely for use in representing and
00013  * interchanging environmental data & databases.
00014  * 
00015  * This software was developed for use by the United States Government with
00016  * unlimited rights.  The software was developed under contract
00017  * DASG60-02-D-0006 TO-193 by Science Applications International Corporation.
00018  * The software is unclassified and is deemed as Distribution A, approved
00019  * for Public Release.
00020  * 
00021  * Use by others is permitted only upon the ACCEPTANCE OF THE TERMS AND
00022  * CONDITIONS, AS STIPULATED UNDER THE FOLLOWING PROVISIONS:
00023  * 
00024  *    1. Recipient may make unlimited copies of this software and give
00025  *       copies to other persons or entities as long as the copies contain
00026  *       this NOTICE, and as long as the same copyright notices that
00027  *       appear on, or in, this software remain.
00028  * 
00029  *    2. Trademarks. All trademarks belong to their respective trademark
00030  *       holders.  Third-Party applications/software/information are
00031  *       copyrighted by their respective owners.
00032  * 
00033  *    3. Recipient agrees to forfeit all intellectual property and
00034  *       ownership rights for any version created from the modification
00035  *       or adaptation of this software, including versions created from
00036  *       the translation and/or reverse engineering of the software design.
00037  * 
00038  *    4. Transfer.  Recipient may not sell, rent, lease, or sublicense
00039  *       this software.  Recipient may, however enable another person
00040  *       or entity the rights to use this software, provided that this
00041  *       AGREEMENT and NOTICE is furnished along with the software and
00042  *       /or software system utilizing this software.
00043  * 
00044  *       All revisions, modifications, created by the Recipient, to this
00045  *       software and/or related technical data shall be forwarded by the 
00046  *       Recipient to the Government at the following address:
00047  * 
00048  *         SMDC
00049  *         Attention SEDRIS (TO193) TPOC
00050  *         P.O. Box 1500
00051  *         Hunstville, AL  35807-3801
00052  * 
00053  *         or via electronic mail to:  [email protected]
00054  * 
00055  *    5. No Warranty. This software is being delivered to you AS IS
00056  *       and there is no warranty, EXPRESS or IMPLIED, as to its use
00057  *       or performance.
00058  * 
00059  *       The RECIPIENT ASSUMES ALL RISKS, KNOWN AND UNKNOWN, OF USING
00060  *       THIS SOFTWARE.  The DEVELOPER EXPRESSLY DISCLAIMS, and the
00061  *       RECIPIENT WAIVES, ANY and ALL PERFORMANCE OR RESULTS YOU MAY
00062  *       OBTAIN BY USING THIS SOFTWARE OR DOCUMENTATION.  THERE IS
00063  *       NO WARRANTY, EXPRESS OR, IMPLIED, AS TO NON-INFRINGEMENT OF
00064  *       THIRD PARTY RIGHTS, MERCHANTABILITY, OR FITNESS FOR ANY
00065  *       PARTICULAR PURPOSE.  IN NO EVENT WILL THE DEVELOPER, THE
00066  *       UNITED STATES GOVERNMENT OR ANYONE ELSE ASSOCIATED WITH THE
00067  *       DEVELOPMENT OF THIS SOFTWARE BE HELD LIABLE FOR ANY CONSEQUENTIAL,
00068  *       INCIDENTAL OR SPECIAL DAMAGES, INCLUDING ANY LOST PROFITS
00069  *       OR LOST SAVINGS WHATSOEVER.
00070  */
00071 
00072 // SRM_OTHERS_GOES_HERE
00073 
00074 // $Id: LocalTangentSpaceEuclidean.h,v 1.16 2008/10/22 21:58:27 worleym Exp $
00075 
00076 #ifndef _LocalTangentSpaceEuclidean_h
00077 #define _LocalTangentSpaceEuclidean_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_LocalTangentSpaceEuclidean: public BaseSRF_WithTangentPlaneSurface
00092 {
00093 public:
00097     static SRF_LocalTangentSpaceEuclidean* create(const SRM_ORM_Code orm,
00098                                                   const SRM_RT_Code  rt,
00099                                                   const SRM_LTSE_Parameters &params );
00100 
00104     static SRF_LocalTangentSpaceEuclidean* create(
00105                                                   SRM_ORM_Code orm,
00106                                                   SRM_RT_Code  rt,
00107                                                   SRM_Long_Float geodetic_longitude,
00108                                                   SRM_Long_Float geodetic_latitude,
00109                                                   SRM_Long_Float azimuth,
00110                                                   SRM_Long_Float x_false_origin,
00111                                                   SRM_Long_Float y_false_origin,
00112                                                   SRM_Long_Float height_offset
00113                                                   );
00114 
00118     static SRF_LocalTangentSpaceEuclidean* create( SRM_SRF_Parameters_Info srf_params )
00119     {
00120         return create(srf_params.value.srf_template.orm_code,
00121                       srf_params.rt_code,
00122                       srf_params.value.srf_template.parameters.ltse_srf_parameters );
00123     }
00124 
00127     Coord3D* createCoordinate3D(SRM_Long_Float coord_comp1,
00128                                 SRM_Long_Float coord_comp2,
00129                                 SRM_Long_Float coord_comp3 );
00130 
00133     CoordSurf* createSurfaceCoordinate(SRM_Long_Float coord_surf_comp1,
00134                                        SRM_Long_Float coord_surf_comp2 );
00135 
00139     const SRM_LTSE_Parameters &getSRFParameters() const;
00140 
00144     SRM_Long_Float get_geodetic_longitude() const;
00145 
00149     SRM_Long_Float get_geodetic_latitude() const;
00150 
00154     SRM_Long_Float get_azimuth() const;
00155 
00159     SRM_Long_Float get_x_false_origin() const;
00160 
00164     SRM_Long_Float get_y_false_origin() const;
00165 
00169     SRM_Long_Float get_height_offset() const;
00170 
00173     virtual bool isA( SRF_ClassType type ) const;
00174 
00177     virtual SRF_ClassType getClassType() const
00178     {
00179         return BaseSRF::SRF_TYP_LTSE;
00180     }
00181 
00185     bool isEqual( const SRF_LocalTangentSpaceEuclidean &srf ) const;
00186 
00190     bool operator==( const SRF_LocalTangentSpaceEuclidean &rhs ) const;
00191 
00195     SRF_LocalTangentSpaceEuclidean* makeCopy() const;
00196 
00204     virtual SRM_Coordinate_Valid_Region changeCoordinate3DSRF(const Coord3D &src_coord,
00205                                                                     Coord3D &des_coord );
00206 
00210     const char* toString();
00211 
00212 protected:
00213     friend class BaseSRF;
00214     friend class BaseSRF_3D;
00215     friend class BaseSRF_WithEllipsoidalHeight;
00216     SRF_LocalTangentSpaceEuclidean( void *impl ); 
00217     SRF_LocalTangentSpaceEuclidean &operator =( const SRF_LocalTangentSpaceEuclidean & ) { return *this; } 
00218     virtual ~SRF_LocalTangentSpaceEuclidean(); 
00219 };
00220 
00221 
00222 inline bool SRF_LocalTangentSpaceEuclidean::isA( SRF_ClassType type ) const
00223 {
00224     if (type == BaseSRF::SRF_TYP_LTSE)
00225         return true;
00226     else
00227         return BaseSRF_WithTangentPlaneSurface::isA(type);
00228 };
00229 
00230 
00232 typedef SRF_LocalTangentSpaceEuclidean SRF_LTSE;
00233 
00234 
00239 class EXPORT_SRM_CPP_DLL Coord3D_LocalTangentSpaceEuclidean: public Coord3D
00240 {
00241 public:
00244     Coord3D_LocalTangentSpaceEuclidean(SRF_LocalTangentSpaceEuclidean *srf,
00245                                        SRM_Long_Float x = 0.0,
00246                                        SRM_Long_Float y = 0.0,
00247                                        SRM_Long_Float height = 0.0 )
00248     : Coord3D(srf)
00249     {
00250         setComponentValues(x, y, height);
00251     }
00252 
00255     Coord3D_LocalTangentSpaceEuclidean( const Coord3D_LocalTangentSpaceEuclidean &coord )
00256     : Coord3D(coord._srf)
00257     {
00258         setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00259     }
00260 
00266     void copyTo( Coord3D_LocalTangentSpaceEuclidean &coord ) const
00267     {
00268         if (coord._srf != _srf)
00269             throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00270 
00271         coord._values[0] = _values[0];
00272         coord._values[1] = _values[1];
00273         coord._values[2] = _values[2];
00274     }
00275 
00279     bool isEqual( const Coord3D_LocalTangentSpaceEuclidean &coord ) const
00280     {
00281         return (_srf == coord._srf &&
00282                 _values[0] == coord._values[0] &&
00283                 _values[1] == coord._values[1] &&
00284                 _values[2] == coord._values[2] );
00285     }
00286 
00289     void setComponentValues( SRM_Long_Float x, SRM_Long_Float y, SRM_Long_Float height )
00290     {
00291         _values[0] = x;
00292         _values[1] = y;
00293         _values[2] = height;
00294     }
00295 
00298     SRM_Long_Float get_x() const
00299     {
00300         return _values[0];
00301     }
00302 
00305     SRM_Long_Float get_y() const
00306     {
00307         return _values[1];
00308     }
00309 
00312     SRM_Long_Float get_height() const
00313     {
00314         return _values[2];
00315     }
00316 
00319     void set_x( SRM_Long_Float value )
00320     {
00321         _values[0] = value;
00322     }
00323 
00326     void set_y( SRM_Long_Float value )
00327     {
00328         _values[1] = value;
00329     }
00330 
00333     void set_height( SRM_Long_Float value )
00334     {
00335         _values[2] = value;
00336     }
00337 
00340     virtual bool isA( Coord_ClassType type ) const;
00341 
00344     virtual Coord_ClassType getClassType() const
00345     {
00346         return Coord::COORD_TYP_LTSE;
00347     }
00348 
00351     bool operator==( const Coord3D_LocalTangentSpaceEuclidean &rhs ) const;
00352 
00358     bool isCompatibleWith( const Coord3D_LocalTangentSpaceEuclidean &rhs ) const
00359     {
00360         return ((*(SRF_LocalTangentSpaceEuclidean*)(this->_srf)) == (*(SRF_LocalTangentSpaceEuclidean*)(rhs._srf)));
00361     }
00362 
00367     Coord3D_LocalTangentSpaceEuclidean &operator= ( const Coord3D_LocalTangentSpaceEuclidean &rhs )
00368     {
00369         if((*(SRF_LocalTangentSpaceEuclidean*)(this->_srf)) == (*(SRF_LocalTangentSpaceEuclidean*)(rhs._srf)))
00370         {
00371             _values[0] = rhs._values[0];
00372             _values[1] = rhs._values[1];
00373             _values[2] = rhs._values[2];
00374         }
00375         else
00376             throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00377                             "Coord3D_LocalTangentSpaceEuclidean op=: incompatible rhs coordinate");
00378 
00379         return *this;
00380     }
00381 };
00382 
00383 
00384 inline bool Coord3D_LocalTangentSpaceEuclidean::isA( Coord_ClassType type ) const
00385 {
00386     if (type == Coord::COORD_TYP_LTSE)
00387         return true;
00388     else
00389         return Coord3D::isA(type);
00390 };
00391 
00392 
00394 typedef Coord3D_LocalTangentSpaceEuclidean Coord3D_LTSE;
00395 
00396 
00401 class EXPORT_SRM_CPP_DLL CoordSurf_LocalTangentSpaceEuclidean: public CoordSurf
00402 {
00403 public:
00406     CoordSurf_LocalTangentSpaceEuclidean(SRF_LocalTangentSpaceEuclidean *srf,
00407                                          SRM_Long_Float x = 0.0,
00408                                          SRM_Long_Float y = 0.0 )
00409     : CoordSurf(srf)
00410     {
00411         setComponentValues(x, y);
00412     }
00413 
00416     CoordSurf_LocalTangentSpaceEuclidean( const CoordSurf_LocalTangentSpaceEuclidean &coord )
00417     : CoordSurf(coord._srf)
00418     {
00419         setComponentValues( coord._values[0], coord._values[1] );
00420     }
00421 
00427     void copyTo( CoordSurf_LocalTangentSpaceEuclidean &coord ) const
00428     {
00429         if (coord._srf != _srf)
00430             throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00431 
00432         coord._values[0] = _values[0];
00433         coord._values[1] = _values[1];
00434     }
00435 
00439     bool isEqual( const CoordSurf_LocalTangentSpaceEuclidean &coord ) const
00440     {
00441         return (_srf == coord._srf &&
00442                 _values[0] == coord._values[0] &&
00443                 _values[1] == coord._values[1] );
00444     }
00445 
00448     void setComponentValues( SRM_Long_Float x, SRM_Long_Float y )
00449     {
00450         _values[0] = x;
00451         _values[1] = y;
00452     }
00453 
00456     SRM_Long_Float get_x() const
00457     {
00458         return _values[0];
00459     }
00460 
00463     SRM_Long_Float get_y() const
00464     {
00465         return _values[1];
00466     }
00467 
00470     void set_x( SRM_Long_Float value )
00471     {
00472         _values[0] = value;
00473     }
00474 
00477     void set_y( SRM_Long_Float value )
00478     {
00479         _values[1] = value;
00480     }
00481 
00484     virtual bool isA( Coord_ClassType type ) const;
00485 
00488     virtual Coord_ClassType getClassType() const
00489     {
00490         return Coord::COORD_TYP_SURF_LTSE;
00491     }
00492 
00495     bool operator==( const CoordSurf_LocalTangentSpaceEuclidean &rhs ) const;
00496 
00502     bool isCompatibleWith( const CoordSurf_LocalTangentSpaceEuclidean &rhs ) const
00503     {
00504         return ((*(SRF_LocalTangentSpaceEuclidean*)(this->_srf)) == (*(SRF_LocalTangentSpaceEuclidean*)(rhs._srf)));
00505     }
00506 
00512     CoordSurf_LocalTangentSpaceEuclidean &operator= ( const CoordSurf_LocalTangentSpaceEuclidean &rhs )
00513     {
00514         if((*(SRF_LocalTangentSpaceEuclidean*)(this->_srf)) == (*(SRF_LocalTangentSpaceEuclidean*)(rhs._srf)))
00515         {
00516             _values[0] = rhs._values[0];
00517             _values[1] = rhs._values[1];
00518         }
00519         else
00520             throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00521                             "CoordSurf_LocalTangentSpaceEuclidean op=: incompatible rhs coordinate");
00522 
00523         return *this;
00524     }
00525 };
00526 
00527 
00528 inline bool CoordSurf_LocalTangentSpaceEuclidean::isA( Coord_ClassType type ) const
00529 {
00530     if (type == Coord::COORD_TYP_SURF_LTSE)
00531         return true;
00532     else
00533         return CoordSurf::isA(type);
00534 };
00535 
00536 
00538 typedef CoordSurf_LocalTangentSpaceEuclidean CoordSurf_LTSE;
00539 
00540 } // namespace srm
00541 
00542 #endif // _LocalTangentSpaceEuclidean_h

Spatial Reference Model C++ API Version 4.1.2 - 1 Jul 2009
Copyright © 2009 SEDRIS Docs by Doxygen 1.3.2