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.4.0 - December 7, 2009
00006 
00007 // - SRM spec. 4.4
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.17 2009/10/12 19:30:35 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
00098     (
00099               SRM_ORM_Code         orm,
00100               SRM_RT_Code          rt,
00101         const SRM_LTSE_Parameters &params
00102     );
00103 
00107     static SRF_LocalTangentSpaceEuclidean* create(
00108                                                   SRM_ORM_Code   orm,
00109                                                   SRM_RT_Code    rt,
00110                                                   SRM_Long_Float geodetic_longitude,
00111                                                   SRM_Long_Float geodetic_latitude,
00112                                                   SRM_Long_Float azimuth,
00113                                                   SRM_Long_Float x_false_origin,
00114                                                   SRM_Long_Float y_false_origin,
00115                                                   SRM_Long_Float height_offset
00116                                                   );
00117 
00121     static SRF_LocalTangentSpaceEuclidean* create( SRM_SRF_Parameters_Info srf_params )
00122     {
00123         return create(srf_params.value.srf_template.orm_code,
00124                       srf_params.rt_code,
00125                       srf_params.value.srf_template.parameters.ltse_srf_parameters );
00126     }
00127 
00130     Coord3D* createCoordinate3D(SRM_Long_Float coord_comp1,
00131                                 SRM_Long_Float coord_comp2,
00132                                 SRM_Long_Float coord_comp3 );
00133 
00136     CoordSurf* createSurfaceCoordinate(SRM_Long_Float coord_surf_comp1,
00137                                        SRM_Long_Float coord_surf_comp2 );
00138 
00142     const SRM_LTSE_Parameters &getSRFParameters() const;
00143 
00147     SRM_Long_Float get_geodetic_longitude() const;
00148 
00152     SRM_Long_Float get_geodetic_latitude() const;
00153 
00157     SRM_Long_Float get_azimuth() const;
00158 
00162     SRM_Long_Float get_x_false_origin() const;
00163 
00167     SRM_Long_Float get_y_false_origin() const;
00168 
00172     SRM_Long_Float get_height_offset() const;
00173 
00176     virtual bool isA( SRF_ClassType type ) const;
00177 
00180     virtual SRF_ClassType getClassType() const
00181     {
00182         return BaseSRF::SRF_TYP_LTSE;
00183     }
00184 
00188     bool isEqual( const SRF_LocalTangentSpaceEuclidean &srf ) const;
00189 
00193     bool operator==( const SRF_LocalTangentSpaceEuclidean &rhs ) const;
00194 
00198     SRF_LocalTangentSpaceEuclidean* makeCopy() const;
00199 
00207     virtual SRM_Coordinate_Valid_Region changeCoordinate3DSRF(const Coord3D &src_coord,
00208                                                                     Coord3D &des_coord );
00209 
00213     const char* toString();
00214 
00215 protected:
00216     friend class BaseSRF;
00217     friend class BaseSRF_3D;
00218     friend class BaseSRF_WithEllipsoidalHeight;
00219     SRF_LocalTangentSpaceEuclidean( void *impl ); 
00220     SRF_LocalTangentSpaceEuclidean &operator =( const SRF_LocalTangentSpaceEuclidean & ) { return *this; } 
00221     virtual ~SRF_LocalTangentSpaceEuclidean(); 
00222 };
00223 
00224 
00225 inline bool SRF_LocalTangentSpaceEuclidean::isA( SRF_ClassType type ) const
00226 {
00227     if (type == BaseSRF::SRF_TYP_LTSE)
00228         return true;
00229     else
00230         return BaseSRF_WithTangentPlaneSurface::isA(type);
00231 };
00232 
00233 
00235 typedef SRF_LocalTangentSpaceEuclidean SRF_LTSE;
00236 
00237 
00242 class EXPORT_SRM_CPP_DLL Coord3D_LocalTangentSpaceEuclidean: public Coord3D
00243 {
00244 public:
00247     Coord3D_LocalTangentSpaceEuclidean(SRF_LocalTangentSpaceEuclidean *srf,
00248                                        SRM_Long_Float x = 0.0,
00249                                        SRM_Long_Float y = 0.0,
00250                                        SRM_Long_Float height = 0.0 )
00251     : Coord3D(srf)
00252     {
00253         setComponentValues(x, y, height);
00254     }
00255 
00258     Coord3D_LocalTangentSpaceEuclidean( const Coord3D_LocalTangentSpaceEuclidean &coord )
00259     : Coord3D(coord._srf)
00260     {
00261         setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00262     }
00263 
00269     void copyTo( Coord3D_LocalTangentSpaceEuclidean &coord ) const
00270     {
00271         if (coord._srf != _srf)
00272             throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00273 
00274         coord._values[0] = _values[0];
00275         coord._values[1] = _values[1];
00276         coord._values[2] = _values[2];
00277     }
00278 
00282     bool isEqual( const Coord3D_LocalTangentSpaceEuclidean &coord ) const
00283     {
00284         return (_srf == coord._srf &&
00285                 _values[0] == coord._values[0] &&
00286                 _values[1] == coord._values[1] &&
00287                 _values[2] == coord._values[2] );
00288     }
00289 
00292     void setComponentValues( SRM_Long_Float x, SRM_Long_Float y, SRM_Long_Float height )
00293     {
00294         _values[0] = x;
00295         _values[1] = y;
00296         _values[2] = height;
00297     }
00298 
00301     SRM_Long_Float get_x() const
00302     {
00303         return _values[0];
00304     }
00305 
00308     SRM_Long_Float get_y() const
00309     {
00310         return _values[1];
00311     }
00312 
00315     SRM_Long_Float get_height() const
00316     {
00317         return _values[2];
00318     }
00319 
00322     void set_x( SRM_Long_Float value )
00323     {
00324         _values[0] = value;
00325     }
00326 
00329     void set_y( SRM_Long_Float value )
00330     {
00331         _values[1] = value;
00332     }
00333 
00336     void set_height( SRM_Long_Float value )
00337     {
00338         _values[2] = value;
00339     }
00340 
00343     virtual bool isA( Coord_ClassType type ) const;
00344 
00347     virtual Coord_ClassType getClassType() const
00348     {
00349         return Coord::COORD_TYP_LTSE;
00350     }
00351 
00354     bool operator==( const Coord3D_LocalTangentSpaceEuclidean &rhs ) const;
00355 
00361     bool isCompatibleWith( const Coord3D_LocalTangentSpaceEuclidean &rhs ) const
00362     {
00363         return ((*(SRF_LocalTangentSpaceEuclidean*)(this->_srf)) == (*(SRF_LocalTangentSpaceEuclidean*)(rhs._srf)));
00364     }
00365 
00370     Coord3D_LocalTangentSpaceEuclidean &operator= ( const Coord3D_LocalTangentSpaceEuclidean &rhs )
00371     {
00372         if((*(SRF_LocalTangentSpaceEuclidean*)(this->_srf)) == (*(SRF_LocalTangentSpaceEuclidean*)(rhs._srf)))
00373         {
00374             _values[0] = rhs._values[0];
00375             _values[1] = rhs._values[1];
00376             _values[2] = rhs._values[2];
00377         }
00378         else
00379             throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00380                             "Coord3D_LocalTangentSpaceEuclidean op=: incompatible rhs coordinate");
00381 
00382         return *this;
00383     }
00384 };
00385 
00386 
00387 inline bool Coord3D_LocalTangentSpaceEuclidean::isA( Coord_ClassType type ) const
00388 {
00389     if (type == Coord::COORD_TYP_LTSE)
00390         return true;
00391     else
00392         return Coord3D::isA(type);
00393 };
00394 
00395 
00397 typedef Coord3D_LocalTangentSpaceEuclidean Coord3D_LTSE;
00398 
00399 
00404 class EXPORT_SRM_CPP_DLL CoordSurf_LocalTangentSpaceEuclidean: public CoordSurf
00405 {
00406 public:
00409     CoordSurf_LocalTangentSpaceEuclidean(SRF_LocalTangentSpaceEuclidean *srf,
00410                                          SRM_Long_Float x = 0.0,
00411                                          SRM_Long_Float y = 0.0 )
00412     : CoordSurf(srf)
00413     {
00414         setComponentValues(x, y);
00415     }
00416 
00419     CoordSurf_LocalTangentSpaceEuclidean( const CoordSurf_LocalTangentSpaceEuclidean &coord )
00420     : CoordSurf(coord._srf)
00421     {
00422         setComponentValues( coord._values[0], coord._values[1] );
00423     }
00424 
00430     void copyTo( CoordSurf_LocalTangentSpaceEuclidean &coord ) const
00431     {
00432         if (coord._srf != _srf)
00433             throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00434 
00435         coord._values[0] = _values[0];
00436         coord._values[1] = _values[1];
00437     }
00438 
00442     bool isEqual( const CoordSurf_LocalTangentSpaceEuclidean &coord ) const
00443     {
00444         return (_srf == coord._srf &&
00445                 _values[0] == coord._values[0] &&
00446                 _values[1] == coord._values[1] );
00447     }
00448 
00451     void setComponentValues( SRM_Long_Float x, SRM_Long_Float y )
00452     {
00453         _values[0] = x;
00454         _values[1] = y;
00455     }
00456 
00459     SRM_Long_Float get_x() const
00460     {
00461         return _values[0];
00462     }
00463 
00466     SRM_Long_Float get_y() const
00467     {
00468         return _values[1];
00469     }
00470 
00473     void set_x( SRM_Long_Float value )
00474     {
00475         _values[0] = value;
00476     }
00477 
00480     void set_y( SRM_Long_Float value )
00481     {
00482         _values[1] = value;
00483     }
00484 
00487     virtual bool isA( Coord_ClassType type ) const;
00488 
00491     virtual Coord_ClassType getClassType() const
00492     {
00493         return Coord::COORD_TYP_SURF_LTSE;
00494     }
00495 
00498     bool operator==( const CoordSurf_LocalTangentSpaceEuclidean &rhs ) const;
00499 
00505     bool isCompatibleWith( const CoordSurf_LocalTangentSpaceEuclidean &rhs ) const
00506     {
00507         return ((*(SRF_LocalTangentSpaceEuclidean*)(this->_srf)) == (*(SRF_LocalTangentSpaceEuclidean*)(rhs._srf)));
00508     }
00509 
00515     CoordSurf_LocalTangentSpaceEuclidean &operator= ( const CoordSurf_LocalTangentSpaceEuclidean &rhs )
00516     {
00517         if((*(SRF_LocalTangentSpaceEuclidean*)(this->_srf)) == (*(SRF_LocalTangentSpaceEuclidean*)(rhs._srf)))
00518         {
00519             _values[0] = rhs._values[0];
00520             _values[1] = rhs._values[1];
00521         }
00522         else
00523             throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00524                             "CoordSurf_LocalTangentSpaceEuclidean op=: incompatible rhs coordinate");
00525 
00526         return *this;
00527     }
00528 };
00529 
00530 
00531 inline bool CoordSurf_LocalTangentSpaceEuclidean::isA( Coord_ClassType type ) const
00532 {
00533     if (type == Coord::COORD_TYP_SURF_LTSE)
00534         return true;
00535     else
00536         return CoordSurf::isA(type);
00537 };
00538 
00539 
00541 typedef CoordSurf_LocalTangentSpaceEuclidean CoordSurf_LTSE;
00542 
00543 } // namespace srm
00544 
00545 #endif // _LocalTangentSpaceEuclidean_h

Spatial Reference Model C++ API Version 4.4 - December 7, 2009
Copyright © 2009 SEDRIS Docs by Doxygen 1.3.2