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

LococentricEuclidean3D.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: LococentricEuclidean3D.h,v 1.12 2009/11/06 23:21:31 worleym Exp $
00075 
00076 #ifndef _LococentricEuclidean3D_h
00077 #define _LococentricEuclidean3D_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_LococentricEuclidean3D: public BaseSRF_3D
00092 {
00093 public:
00097     static SRF_LococentricEuclidean3D* create(      SRM_ORM_Code orm,
00098                                                     SRM_RT_Code  rt,
00099                                               const SRM_LCE_3D_Parameters &params );
00100 
00104     static SRF_LococentricEuclidean3D* create(
00105                                                     SRM_ORM_Code    orm,
00106                                                     SRM_RT_Code     rt,
00107                                               const SRM_Vector_3D &lococentre,
00108                                               const SRM_Vector_3D &primary_axis,
00109                                               const SRM_Vector_3D &secondary_axis
00110                                               );
00111 
00115     static SRF_LococentricEuclidean3D* create( SRM_SRF_Parameters_Info srf_params )
00116     {
00117         return create(srf_params.value.srf_template.orm_code,
00118                       srf_params.rt_code,
00119                       srf_params.value.srf_template.parameters.lce_3d_srf_parameters );
00120     }
00121 
00124     Coord3D* createCoordinate3D(SRM_Long_Float coord_comp1,
00125                                 SRM_Long_Float coord_comp2,
00126                                 SRM_Long_Float coord_comp3 );
00127 
00131     const SRM_LCE_3D_Parameters &getSRFParameters() const;
00132 
00136     void get_lococentre( SRM_Vector_3D &lococentre );
00137 
00141     void get_primary_axis( SRM_Vector_3D &primary_axis );
00142 
00146     void get_secondary_axis( SRM_Vector_3D &secondary_axis );
00147 
00150     virtual bool isA( SRF_ClassType type ) const;
00151 
00154     virtual SRF_ClassType getClassType() const
00155     {
00156         return BaseSRF::SRF_TYP_LCE_3D;
00157     }
00158 
00162     bool isEqual( const SRF_LococentricEuclidean3D &srf ) const;
00163 
00167     bool operator==( const SRF_LococentricEuclidean3D &rhs ) const;
00168 
00172     SRF_LococentricEuclidean3D* makeCopy() const;
00173 
00181     virtual SRM_Coordinate_Valid_Region changeCoordinate3DSRF(const Coord3D &src_coord,
00182                                                                     Coord3D &des_coord );
00183 
00187     const char* toString();
00188 
00189 protected:
00190     SRF_LococentricEuclidean3D( void *impl ); 
00191     SRF_LococentricEuclidean3D &operator =( const SRF_LococentricEuclidean3D & ) { return *this; } 
00192     virtual ~SRF_LococentricEuclidean3D(); 
00193 };
00194 
00195 
00196 inline bool SRF_LococentricEuclidean3D::isA( SRF_ClassType type ) const
00197 {
00198     if (type == BaseSRF::SRF_TYP_LCE_3D)
00199         return true;
00200     else
00201         return BaseSRF_3D::isA(type);
00202 };
00203 
00204 
00206 typedef SRF_LococentricEuclidean3D SRF_LCE_3D;
00207 
00208 
00213 class EXPORT_SRM_CPP_DLL Coord3D_LococentricEuclidean3D: public Coord3D
00214 {
00215 public:
00218     Coord3D_LococentricEuclidean3D(SRF_LococentricEuclidean3D *srf,
00219                                    SRM_Long_Float u = 0.0,
00220                                    SRM_Long_Float v = 0.0,
00221                                    SRM_Long_Float w = 0.0 )
00222     : Coord3D(srf)
00223     {
00224         setComponentValues(u, v, w);
00225     }
00226 
00229     Coord3D_LococentricEuclidean3D( const Coord3D_LococentricEuclidean3D &coord )
00230     : Coord3D(coord._srf)
00231     {
00232         setComponentValues( coord._values[0], coord._values[1], coord._values[2] );
00233     }
00234 
00240     void copyTo( Coord3D_LococentricEuclidean3D &coord ) const
00241     {
00242         if (coord._srf != _srf)
00243             throw Exception( SRM_STATCOD_INVALID_SOURCE_COORDINATE, "copyTo: Coordinate associated with a difference SRF" );
00244 
00245         coord._values[0] = _values[0];
00246         coord._values[1] = _values[1];
00247         coord._values[2] = _values[2];
00248     }
00249 
00253     bool isEqual( const Coord3D_LococentricEuclidean3D &coord ) const
00254     {
00255         return (_srf == coord._srf &&
00256                 _values[0] == coord._values[0] &&
00257                 _values[1] == coord._values[1] &&
00258                 _values[2] == coord._values[2] );
00259     }
00260 
00263     void setComponentValues( SRM_Long_Float u, SRM_Long_Float v, SRM_Long_Float w )
00264     {
00265         _values[0] = u;
00266         _values[1] = v;
00267         _values[2] = w;
00268     }
00269 
00272     SRM_Long_Float get_u() const
00273     {
00274         return _values[0];
00275     }
00276 
00279     SRM_Long_Float get_v() const
00280     {
00281         return _values[1];
00282     }
00283 
00286     SRM_Long_Float get_w() const
00287     {
00288         return _values[2];
00289     }
00290 
00293     void set_u( SRM_Long_Float value )
00294     {
00295         _values[0] = value;
00296     }
00297 
00300     void set_v( SRM_Long_Float value )
00301     {
00302         _values[1] = value;
00303     }
00304 
00307     void set_w( SRM_Long_Float value )
00308     {
00309         _values[2] = value;
00310     }
00311 
00314     virtual bool isA( Coord_ClassType type ) const;
00315 
00318     virtual Coord_ClassType getClassType() const
00319     {
00320         return Coord::COORD_TYP_LCE_3D;
00321     }
00322 
00325     bool operator==( const Coord3D_LococentricEuclidean3D &rhs ) const;
00326 
00332     bool isCompatibleWith( const Coord3D_LococentricEuclidean3D &rhs ) const
00333     {
00334         return ((*(SRF_LococentricEuclidean3D*)(this->_srf)) == (*(SRF_LococentricEuclidean3D*)(rhs._srf)));
00335     }
00336 
00341     Coord3D_LococentricEuclidean3D &operator= ( const Coord3D_LococentricEuclidean3D &rhs )
00342     {
00343         if((*(SRF_LococentricEuclidean3D*)(this->_srf)) == (*(SRF_LococentricEuclidean3D*)(rhs._srf)))
00344         {
00345             _values[0] = rhs._values[0];
00346             _values[1] = rhs._values[1];
00347             _values[2] = rhs._values[2];
00348         }
00349         else
00350             throw Exception(SRM_STATCOD_INVALID_TARGET_COORDINATE,
00351                             "Coord3D_LocalTangentSpaceEuclidean op=: incompatible rhs coordinate");
00352 
00353         return *this;
00354     }
00355 };
00356 
00357 
00358 inline bool Coord3D_LococentricEuclidean3D::isA( Coord_ClassType type ) const
00359 {
00360     if (type == Coord::COORD_TYP_LCE_3D)
00361         return true;
00362     else
00363         return Coord3D::isA(type);
00364 };
00365 
00366 
00368 typedef Coord3D_LococentricEuclidean3D Coord3D_LCE_3D;
00369 
00370 
00371 } // namespace srm
00372 
00373 #endif // _LococentricEuclidean3D_h

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