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

LocalTangentSpaceAzimuthalSpherical.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: LocalTangentSpaceAzimuthalSpherical.h,v 1.18 2009/10/12 20:47:00 worleym Exp $
00075 
00076 #ifndef _LocalTangentSpaceAzimuthalSpherical_h
00077 #define _LocalTangentSpaceAzimuthalSpherical_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_LocalTangentSpaceAzimuthalSpherical: public BaseSRF_WithTangentPlaneSurface
00092 {
00093 public:
00097     static SRF_LocalTangentSpaceAzimuthalSpherical* create(      SRM_ORM_Code orm,
00098                                                                  SRM_RT_Code  rt,
00099                                                            const SRM_Local_Tangent_Parameters &params );
00100 
00104     static SRF_LocalTangentSpaceAzimuthalSpherical* 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 height_offset
00111                                                            );
00112 
00116     static SRF_LocalTangentSpaceAzimuthalSpherical* create( SRM_SRF_Parameters_Info srf_params )
00117     {
00118         return create( srf_params.value.srf_template.orm_code,
00119                        srf_params.rt_code,
00120                        srf_params.value.srf_template.parameters.ltsas_srf_parameters );
00121     }
00122 
00125     Coord3D* createCoordinate3D(SRM_Long_Float coord_comp1,
00126                                 SRM_Long_Float coord_comp2,
00127                                 SRM_Long_Float coord_comp3 );
00128 
00131     CoordSurf* createSurfaceCoordinate(SRM_Long_Float coord_surf_comp1,
00132                                        SRM_Long_Float coord_surf_comp2 );
00133 
00137     const SRM_Local_Tangent_Parameters &getSRFParameters() const;
00138 
00142     SRM_Long_Float get_geodetic_longitude() const;
00143 
00147     SRM_Long_Float get_geodetic_latitude() const;
00148 
00152     SRM_Long_Float get_azimuth() const;
00153 
00157     SRM_Long_Float get_height_offset() const;
00158 
00161     virtual bool isA( SRF_ClassType type ) const;
00162 
00165     virtual SRF_ClassType getClassType() const
00166     {
00167         return BaseSRF::SRF_TYP_LTSAS;
00168     }
00169 
00173     bool isEqual( const SRF_LocalTangentSpaceAzimuthalSpherical &srf ) const;
00174 
00178     bool operator==( const SRF_LocalTangentSpaceAzimuthalSpherical &rhs ) const;
00179 
00183     SRF_LocalTangentSpaceAzimuthalSpherical* makeCopy() const;
00184 
00188     const char* toString();
00189 
00190 protected:
00191     SRF_LocalTangentSpaceAzimuthalSpherical( void *impl ) : BaseSRF_WithTangentPlaneSurface(impl) {} 
00192     SRF_LocalTangentSpaceAzimuthalSpherical &operator =( const SRF_LocalTangentSpaceAzimuthalSpherical & ) { return *this; } 
00193     virtual ~SRF_LocalTangentSpaceAzimuthalSpherical() {} 
00194 };
00195 
00196 
00197 inline bool SRF_LocalTangentSpaceAzimuthalSpherical::isA( SRF_ClassType type ) const
00198 {
00199     if (type == BaseSRF::SRF_TYP_LTSAS)
00200         return true;
00201     else
00202         return BaseSRF_WithTangentPlaneSurface::isA(type);
00203 };
00204 
00205 
00207 typedef SRF_LocalTangentSpaceAzimuthalSpherical SRF_LTSAS;
00208 
00209 
00214 class EXPORT_SRM_CPP_DLL Coord3D_LocalTangentSpaceAzimuthalSpherical: public Coord3D
00215 {
00216 public:
00219     Coord3D_LocalTangentSpaceAzimuthalSpherical( SRF_LocalTangentSpaceAzimuthalSpherical *srf,
00220                                                  SRM_Long_Float azimuth = 0.0,
00221                                                  SRM_Long_Float angle = 0.0,
00222                                                  SRM_Long_Float radius = 0.0 )
00223     : Coord3D(srf)
00224     {
00225         setComponentValues(azimuth, angle, radius);
00226     }
00227 
00230     Coord3D_LocalTangentSpaceAzimuthalSpherical( const Coord3D_LocalTangentSpaceAzimuthalSpherical &coord )
00231     : Coord3D(coord._srf)
00232     {
00233         setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00234     }
00235 
00241     void copyTo( Coord3D_LocalTangentSpaceAzimuthalSpherical &coord ) const
00242     {
00243         if (coord._srf != _srf)
00244             throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00245 
00246         coord._values[0] = _values[0];
00247         coord._values[1] = _values[1];
00248         coord._values[2] = _values[2];
00249     }
00250 
00254     bool isEqual( const Coord3D_LocalTangentSpaceAzimuthalSpherical &coord ) const
00255     {
00256         return (_srf == coord._srf &&
00257                 _values[0] == coord._values[0] &&
00258                 _values[1] == coord._values[1] &&
00259                 _values[2] == coord._values[2] );
00260     }
00261 
00264     void setComponentValues( SRM_Long_Float azimuth, SRM_Long_Float angle, SRM_Long_Float radius )
00265     {
00266         _values[0] = azimuth;
00267         _values[1] = angle;
00268         _values[2] = radius;
00269     }
00270 
00273     SRM_Long_Float get_azimuth() const
00274     {
00275         return _values[0];
00276     }
00277 
00280     SRM_Long_Float get_angle() const
00281     {
00282         return _values[1];
00283     }
00284 
00287     SRM_Long_Float get_radius() const
00288     {
00289         return _values[2];
00290     }
00291 
00294     void set_azimuth( SRM_Long_Float value )
00295     {
00296         _values[0] = value;
00297     }
00298 
00301     void set_angle( SRM_Long_Float value )
00302     {
00303         _values[1] = value;
00304     }
00305 
00308     void set_radius( SRM_Long_Float value )
00309     {
00310         _values[2] = value;
00311     }
00312 
00315     virtual bool isA( Coord_ClassType type ) const;
00316 
00319     virtual Coord_ClassType getClassType() const
00320     {
00321         return Coord::COORD_TYP_LTSAS;
00322     }
00323 
00326     bool operator==( const Coord3D_LocalTangentSpaceAzimuthalSpherical &rhs ) const;
00327 
00333     bool isCompatibleWith( const Coord3D_LocalTangentSpaceAzimuthalSpherical &rhs ) const
00334     {
00335         return ((*(SRF_LocalTangentSpaceAzimuthalSpherical*)(this->_srf)) == (*(SRF_LocalTangentSpaceAzimuthalSpherical*)(rhs._srf)));
00336     }
00337 
00342     Coord3D_LocalTangentSpaceAzimuthalSpherical &operator= ( const Coord3D_LocalTangentSpaceAzimuthalSpherical &rhs )
00343     {
00344         if((*(SRF_LocalTangentSpaceAzimuthalSpherical*)(this->_srf)) == (*(SRF_LocalTangentSpaceAzimuthalSpherical*)(rhs._srf)))
00345         {
00346             _values[0] = rhs._values[0];
00347             _values[1] = rhs._values[1];
00348             _values[2] = rhs._values[2];
00349         }
00350         else
00351             throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00352                             "Coord3D_LocalTangentSpaceAzimuthalSpherical op=: incompatible rhs coordinate");
00353 
00354         return *this;
00355     }
00356 };
00357 
00358 
00359 inline bool Coord3D_LocalTangentSpaceAzimuthalSpherical::isA( Coord_ClassType type ) const
00360 {
00361     if (type == Coord::COORD_TYP_LTSAS)
00362         return true;
00363     else
00364         return Coord3D::isA(type);
00365 };
00366 
00367 
00369 typedef Coord3D_LocalTangentSpaceAzimuthalSpherical Coord3D_LTSAS;
00370 
00371 
00376 class EXPORT_SRM_CPP_DLL CoordSurf_LocalTangentSpaceAzimuthalSpherical: public CoordSurf
00377 {
00378 public:
00381     CoordSurf_LocalTangentSpaceAzimuthalSpherical( SRF_LocalTangentSpaceAzimuthalSpherical *srf,
00382                                                    SRM_Long_Float azimuth = 0.0,
00383                                                    SRM_Long_Float angle = 0.0 )
00384     : CoordSurf(srf)
00385     {
00386         setComponentValues(azimuth, angle);
00387     }
00388 
00391     CoordSurf_LocalTangentSpaceAzimuthalSpherical( const CoordSurf_LocalTangentSpaceAzimuthalSpherical &coord )
00392     : CoordSurf(coord._srf)
00393     {
00394         setComponentValues( coord._values[0], coord._values[1] );
00395     }
00396 
00402     void copyTo( CoordSurf_LocalTangentSpaceAzimuthalSpherical &coord ) const
00403     {
00404         if (coord._srf != _srf)
00405             throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00406 
00407         coord._values[0] = _values[0];
00408         coord._values[1] = _values[1];
00409     }
00410 
00414     bool isEqual( const CoordSurf_LocalTangentSpaceAzimuthalSpherical &coord ) const
00415     {
00416         return (_srf == coord._srf &&
00417                 _values[0] == coord._values[0] &&
00418                 _values[1] == coord._values[1] );
00419     }
00420 
00423     void setComponentValues( SRM_Long_Float azimuth, SRM_Long_Float angle )
00424     {
00425         _values[0] = azimuth;
00426         _values[1] = angle;
00427     }
00428 
00431     SRM_Long_Float get_azimuth() const
00432     {
00433         return _values[0];
00434     }
00435 
00438     SRM_Long_Float get_angle() const
00439     {
00440         return _values[1];
00441     }
00442 
00445     void set_azimuth( SRM_Long_Float value )
00446     {
00447         _values[0] = value;
00448     }
00449 
00452     void set_angle( SRM_Long_Float value )
00453     {
00454         _values[1] = value;
00455     }
00456 
00459     virtual bool isA( Coord_ClassType type ) const;
00460 
00463     virtual Coord_ClassType getClassType() const
00464     {
00465         return Coord::COORD_TYP_SURF_LTSAS;
00466     }
00467 
00470     bool operator==( const CoordSurf_LocalTangentSpaceAzimuthalSpherical &rhs ) const;
00471 
00477     bool isCompatibleWith( const CoordSurf_LocalTangentSpaceAzimuthalSpherical &rhs ) const
00478     {
00479         return ((*(SRF_LocalTangentSpaceAzimuthalSpherical*)(this->_srf)) == (*(SRF_LocalTangentSpaceAzimuthalSpherical*)(rhs._srf)));
00480     }
00481 
00486     CoordSurf_LocalTangentSpaceAzimuthalSpherical &operator= ( const CoordSurf_LocalTangentSpaceAzimuthalSpherical &rhs )
00487     {
00488         if((*(SRF_LocalTangentSpaceAzimuthalSpherical*)(this->_srf)) == (*(SRF_LocalTangentSpaceAzimuthalSpherical*)(rhs._srf)))
00489         {
00490             _values[0] = rhs._values[0];
00491             _values[1] = rhs._values[1];
00492         }
00493         else
00494             throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00495                             "CoordSurf_LocalTangentSpaceAzimuthalSpherical op=: incompatible rhs coordinate");
00496 
00497         return *this;
00498     }
00499 };
00500 
00501 
00502 inline bool CoordSurf_LocalTangentSpaceAzimuthalSpherical::isA( Coord_ClassType type ) const
00503 {
00504    if (type == Coord::COORD_TYP_SURF_LTSAS)
00505         return true;
00506     else
00507         return CoordSurf::isA(type);
00508 };
00509 
00510 
00512 typedef CoordSurf_LocalTangentSpaceAzimuthalSpherical CoordSurf_LTSAS;
00513 
00514 } // namespace srm
00515 
00516 #endif // _LocalTangentSpaceAzimuthalSpherical_h

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