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

BaseSRF.h

Go to the documentation of this file.
00001 // SRM_SDK_VER_GOES_HERE
00002 

00004 

00006 
00007 // SRM_OTHERS_GOES_HERE
00008 
00009 // $Id: BaseSRF.h,v 1.40 2006/05/19 15:23:20 shend Exp $
00010 
00129 #ifndef _BaseSRF_h
00130 #define _BaseSRF_h
00131 
00132 #if !defined(_WIN32)
00133 #define EXPORT_SRM_CPP_DLL
00134 #elif defined(BUILD_SRM_CPP) /* SRM CPP Case */
00135 #if !defined(EXPORT_SRM_CPP_DLL)
00136 #if defined(_LIB)
00137 #define EXPORT_SRM_CPP_DLL
00138 #elif defined(_USRDLL)
00139 #define EXPORT_SRM_CPP_DLL __declspec(dllexport)
00140 #else
00141 #define EXPORT_SRM_CPP_DLL __declspec(dllimport)
00142 #endif
00143 #endif
00144 #else /* SRM C Case */
00145 #define EXPORT_SRM_CPP_DLL
00146 #endif /* _WIN32 && EXPORT_DLL */
00147 
00153 #include <stdio.h>
00154 #include "srm_types.h"
00155 
00156 namespace srm
00157 {
00158 
00160 class Coord;
00161 class Coord2D;
00162 class CoordSurf;
00163 class Coord3D;
00164 class Direction;
00165 class Orientation;
00166 class SRF_LocalTangentSpaceEuclidean;
00167 
00169 typedef SRM_Long_Float Vector2[2];
00171 typedef SRM_Long_Float Vector3[3];
00173 typedef SRM_Long_Float Matrix3x3[3][3];
00174 
00175 
00182 class EXPORT_SRM_CPP_DLL BaseSRF
00183 {
00184 public:
00185 
00187     enum SRF_ClassType
00188     {
00189         SRF_TYP_TWO_D,
00190         SRF_TYP_THREE_D,
00191         SRF_TYP_WITH_TANGENT_PLANE_SURFACE,
00192         SRF_TYP_WITH_ELLIPSOIDAL_HEIGHT,
00193         SRF_TYP_MAP_PROJECTION,
00194         SRF_TYP_LSA,
00195         SRF_TYP_CC,
00196         SRF_TYP_CD,
00197         SRF_TYP_CM,
00198         SRF_TYP_EC,
00199         SRF_TYP_EI,
00200         SRF_TYP_HAEC,
00201         SRF_TYP_HEEC,
00202         SRF_TYP_HEEQ,
00203         SRF_TYP_LCC,
00204         SRF_TYP_LCE_3D,
00205         SRF_TYP_LSR_2D,
00206         SRF_TYP_LSR_3D,
00207         SRF_TYP_LTSAS,
00208         SRF_TYP_LTSC,
00209         SRF_TYP_LTSE,
00210         SRF_TYP_M,
00211         SRF_TYP_OMS,
00212         SRF_TYP_PD,
00213         SRF_TYP_LSP,
00214         SRF_TYP_PS,
00215         SRF_TYP_SEC,
00216         SRF_TYP_SEQ,
00217         SRF_TYP_SME,
00218         SRF_TYP_SMD,
00219         SRF_TYP_TM
00220     };
00221 
00236     static BaseSRF *createStandardSRF( SRM_SRF_Code srf_code, 
00237                        SRM_RT_Code rt_code );
00238 
00254     static BaseSRF *createSRFSetMember( SRM_SRFS_Info srfs_info,
00255                                         SRM_RT_Code rt );
00256 
00268     virtual void release();
00269 
00287     virtual void getCodes( SRM_SRFT_Code &t_code, 
00288                SRM_SRF_Code  &srf_code,
00289                SRM_SRFS_Code_Info  &srfs_code_info ) const;
00290 
00294     virtual SRM_CS_Code getCSCode() const;
00295 
00299     virtual SRM_ORM_Code get_orm() const;
00300 
00304     virtual SRM_RT_Code get_rt() const;
00305 
00311     static bool querySRFTSupport( SRM_SRFT_Code srft_code );
00312 
00313 
00321     static bool queryORMSupport( SRM_ORM_Code orm_code,
00322                  SRM_RT_Code rt_code );
00323 
00329     virtual SRF_ClassType getClassType() const = 0;
00330 
00332     virtual bool isA( SRF_ClassType type ) const;
00333 
00347     virtual SRM_Coordinate_Valid_Region changeCoordinateSRF( const Coord &src_coord, Coord &des_coord );
00348 
00354     virtual SRM_Coordinate_Valid_Region checkCoordinate( const Coord &src );
00355 
00359     virtual void freeCoordinate( Coord *coord );
00360 
00366     static SRM_Long_Float calculateEuclideanDistance( const Coord &coord1,
00367                               const Coord &coord2 );
00368 
00371     virtual const char *toString() = 0;
00372 
00377     virtual BaseSRF *clone();
00378 
00379 protected:
00380 
00381     friend class Coord3D;
00382     friend class BaseSRF_3D;
00383     friend class BaseSRF_2D;
00384     friend class BaseSRF_MapProjection;
00385     friend class BaseSRF_WithEllipsoidalHeight;
00386     friend class BaseSRF_WithTangentPlaneSurface;
00387     BaseSRF( void *impl ) : _ref_cnt(1), _impl(impl) {} 
00388     BaseSRF &operator =( const BaseSRF & ) { return *this; } 
00389     virtual ~BaseSRF() {} 
00390 
00392     unsigned int _ref_cnt;
00394     void *_impl;
00395 };
00396 
00397 
00398 inline BaseSRF *BaseSRF::clone()
00399 {
00400     ++_ref_cnt;
00401     return this;
00402 }
00403 
00404 inline bool BaseSRF::isA( SRF_ClassType type ) const
00405 {
00406     return false;
00407 }
00408 
00409 
00416 class EXPORT_SRM_CPP_DLL BaseSRF_2D : public BaseSRF
00417 {
00418 public:
00419 
00421     virtual bool isA( SRF_ClassType type ) const;
00422 
00427     virtual Coord2D *createCoordinate2D( SRM_Long_Float coord_comp1,
00428                      SRM_Long_Float coord_comp2 ) = 0;
00429 
00433     virtual void getCoordinate2DValues( const Coord2D &coord,
00434                                         SRM_Long_Float &coord_comp1,
00435                                         SRM_Long_Float &coord_comp2 ) const;
00436 
00440     virtual void freeCoordinate2D( Coord2D *coord );
00441 
00448     virtual void changeCoordinate2DSRF( const Coord2D &src_coord,
00449                           Coord2D &des_coord );
00450 
00461     virtual void changeCoordinate2DArraySRF( Coord2D                     **src_coord_array,
00462                                              SRM_Integer_Positive        *index,
00463                          Coord2D                     **des_coord_array );
00464 
00474     virtual void changeCoordinate2DSRFObject( const Coord2D                              &src_coord,
00475                           const SRM_ORM_Transformation_2D_Parameters hst,
00476                                 Coord2D                              &des_coord );
00477 
00491     virtual void changeCoordinate2DArraySRFObject( Coord2D                                    **src_coord_array,
00492                            const SRM_ORM_Transformation_2D_Parameters hst,
00493                                                    SRM_Integer_Positive                       *index,
00494                            Coord2D                                    **des_coord_array );
00495     
00496 
00501     static SRM_Long_Float calculateEuclideanDistance( const Coord2D &coord1,
00502                               const Coord2D &coord2 );
00503 
00504 protected:
00505 
00506     BaseSRF_2D( void *impl ) : BaseSRF(impl) {} 
00507     BaseSRF_2D &operator =( const BaseSRF & ) { return *this; } 
00508     virtual ~BaseSRF_2D() {} 
00509 
00510 };
00511 
00512 
00513 inline bool BaseSRF_2D::isA( SRF_ClassType type ) const
00514 {
00515     if (type == BaseSRF::SRF_TYP_TWO_D)
00516         return true;
00517     else
00518         return BaseSRF::isA(type);
00519 }
00520 
00521 
00528 class EXPORT_SRM_CPP_DLL BaseSRF_3D : public BaseSRF
00529 {
00530 public:
00531 
00533     virtual bool isA( SRF_ClassType type ) const;
00534 
00540     virtual Coord3D *createCoordinate3D( SRM_Long_Float coord_comp1,
00541                      SRM_Long_Float coord_comp2,
00542                      SRM_Long_Float coord_comp3 ) = 0;
00543 
00547     virtual void freeCoordinate3D( Coord3D *coord );
00548 
00552     virtual void getCoordinate3DValues( const Coord3D &coord,
00553                                         SRM_Long_Float &coord_comp1,
00554                                         SRM_Long_Float &coord_comp2,
00555                                         SRM_Long_Float &coord_comp3 ) const;
00556 
00564     virtual SRM_Coordinate_Valid_Region changeCoordinate3DSRF( const Coord3D &src_coord, 
00565                                          Coord3D &des_coord );
00566 
00578     virtual void changeCoordinate3DArraySRF( Coord3D                                    **src_coord_array,
00579                          SRM_Integer_Positive                       *index,
00580                          Coord3D                                    **des_coord_array,
00581                          SRM_Coordinate_Valid_Region                *region_array );
00582     
00593     virtual SRM_Coordinate_Valid_Region changeCoordinate3DSRFObject( const Coord3D &src_coord,
00594                                      const SRM_ORM_Transformation_3D_Parameters hst,
00595                                            Coord3D &des_coord );
00596 
00609     virtual void changeCoordinate3DArraySRFObject( Coord3D                                    **src_coord_array,
00610                            const SRM_ORM_Transformation_3D_Parameters hst,
00611                                                    SRM_Integer_Positive                       *index,
00612                            Coord3D                                    **des_coord_array,
00613                                                    SRM_Coordinate_Valid_Region                *region_array );
00614     
00629     virtual void setValidRegion( const SRM_Integer component, 
00630                  const SRM_Interval_Type type,
00631                  const SRM_Long_Float lower,
00632                  const SRM_Long_Float upper );
00633 
00652     virtual void setExtendedValidRegion( const SRM_Integer component, 
00653                      const SRM_Interval_Type type,
00654                      const SRM_Long_Float extended_lower,
00655                      const SRM_Long_Float lower,
00656                      const SRM_Long_Float upper,
00657                      const SRM_Long_Float extended_upper );
00658 
00670     virtual void getValidRegion( const SRM_Integer component, 
00671                        SRM_Interval_Type &type,
00672                        SRM_Long_Float &lower,
00673                        SRM_Long_Float &upper );
00674 
00688     virtual void getExtendedValidRegion( const SRM_Integer component, 
00689                            SRM_Interval_Type &type,
00690                            SRM_Long_Float &extended_lower,
00691                            SRM_Long_Float &lower,
00692                            SRM_Long_Float &upper,
00693                            SRM_Long_Float &extended_upper );
00694 
00699     virtual Direction *createDirection( const Coord3D &ref_coord,
00700                                         const Vector3 vec );
00701 
00706     virtual Direction *createDirection( const Coord3D &ref_coord,
00707                                         const SRM_Long_Float vectorComp1,
00708                                         const SRM_Long_Float vectorComp2,
00709                                         const SRM_Long_Float vectorComp3 );
00710 
00718     virtual Direction *createDirection();
00719 
00720 
00724     virtual void freeDirection( Direction *direction );
00725 
00729     virtual void getDirectionValues( const Direction &direction,
00730                      Coord3D &ref_coord,
00731                      Vector3 vec ) const;
00732 
00740     virtual SRM_Coordinate_Valid_Region changeDirectionSRF( const Direction &src_dir, Direction &des_dir );
00741 
00753     void changeDirectionArraySRF( Direction                   **src_direction_array,
00754                   SRM_Integer_Positive        *index,
00755                   Direction                   **des_direction_array,
00756                   SRM_Coordinate_Valid_Region *region_array );
00757 
00768     virtual SRM_Coordinate_Valid_Region changeDirectionSRFObject( const Direction &src_dir,
00769                                   const SRM_ORM_Transformation_3D_Parameters hst,
00770                                         Direction &des_dir);
00771 
00786     void changeDirectionArraySRFObject( Direction                     **src_direction_array,
00787                     const SRM_ORM_Transformation_3D_Parameters hst,
00788                     SRM_Integer_Positive          *index,
00789                     Direction                     **des_direction_array,
00790                     SRM_Coordinate_Valid_Region   *region_array );
00791     
00794     virtual SRM_Coordinate_Valid_Region checkDirection( const Direction &direction );
00795 
00802     virtual Orientation *createOrientation( const Coord3D &ref_coord,
00803                         const Matrix3x3 mat );
00804 
00813     virtual Orientation *createOrientation( const Coord3D &ref_coord,
00814                         const Vector3 vec1,
00815                         const Vector3 vec2,
00816                         const Vector3 vec3 );
00817 
00827     virtual Orientation *createOrientation( const Direction &dir1,
00828                         const Direction &dir2,
00829                         const Direction &dir3 );
00830 
00838     virtual Orientation *createOrientation();
00839 
00843     virtual void freeOrientation( Orientation *orientation );
00844 
00848     virtual void getOrientationValues( const Orientation &orientation,
00849                        Coord3D &ref_coord,
00850                        Matrix3x3 mat ) const;
00851 
00855     virtual SRM_Coordinate_Valid_Region checkOrientation( const Orientation &orientation );
00856 
00864     virtual SRM_Coordinate_Valid_Region changeOrientationSRF( const Orientation &src_orient,
00865                                   Orientation &des_orient );
00866 
00870     virtual void instanceAbstractSpaceCoordinate( const Coord3D &src_coord,
00871                           const Orientation &orientation,
00872                           Coord3D &des_coord );
00873 
00883     static SRM_SRFS_Code_Info getNaturalSRFSetMemberCode( const Coord3D &src_coord,
00884                             SRM_ORM_Code orm_dst,
00885                             SRM_RT_Code rt_dst,
00886                             SRM_SRFS_Code tgt_srfs);
00887     
00897     static BaseSRF_3D* getNaturalSRFSetMember( Coord3D &src_coord,
00898                            SRM_ORM_Code orm_dst,
00899                            SRM_RT_Code rt_dst,
00900                            SRM_SRFS_Code tgt_srfs);
00901     
00906     static SRM_Long_Float calculateEuclideanDistance( const Coord3D &coord1,
00907                               const Coord3D &coord2 );
00908     
00909 protected:
00910 
00911     BaseSRF_3D( void *impl ) : BaseSRF(impl) {} 
00912     BaseSRF_3D &operator =( const BaseSRF & ) { return *this; } 
00913     virtual ~BaseSRF_3D() {} 
00914 };
00915 
00916 
00917 inline bool BaseSRF_3D::isA( SRF_ClassType type ) const
00918 {
00919     if (type == BaseSRF::SRF_TYP_THREE_D)
00920         return true;
00921     else
00922         return BaseSRF::isA(type);
00923 }
00924 
00925 
00933 class EXPORT_SRM_CPP_DLL BaseSRF_WithTangentPlaneSurface : public BaseSRF_3D
00934 {
00935 public:
00936 
00938     virtual bool isA( SRF_ClassType type ) const;
00939 
00943     virtual CoordSurf *createSurfaceCoordinate( SRM_Long_Float coord_surf_comp1,
00944                         SRM_Long_Float coord_surf_comp2 ) = 0;
00945 
00949     virtual void getSurfaceCoordinateValues( const CoordSurf &coord_surf,
00950                          SRM_Long_Float &coord_surf_comp1,
00951                          SRM_Long_Float &coord_surf_comp2 ) const;
00952 
00956     virtual void freeSurfaceCoordinate( CoordSurf *coord_surf );
00957 
00961     virtual void getAssociatedSurfaceCoordinate( const Coord3D &coord,
00962                          CoordSurf &on_surface_coord );
00963 
00968     virtual void getPromotedSurfaceCoordinate( const CoordSurf &surf_coord,
00969                            Coord3D &three_d_coord );
00970 
00975     static SRM_Long_Float calculateEuclideanDistance( const CoordSurf &coord1,
00976                               const CoordSurf &coord2 );
00977 
00978 protected:
00979 
00980     BaseSRF_WithTangentPlaneSurface( void *impl ) : BaseSRF_3D(impl) {} 
00981     BaseSRF_WithTangentPlaneSurface &operator =( const BaseSRF & ) { return *this; } 
00982     virtual ~BaseSRF_WithTangentPlaneSurface() {} 
00983 };
00984 
00985 
00986 inline bool BaseSRF_WithTangentPlaneSurface::isA( SRF_ClassType type ) const
00987 {
00988     if (type == BaseSRF::SRF_TYP_WITH_TANGENT_PLANE_SURFACE)
00989         return true;
00990     else
00991         return BaseSRF_3D::isA(type);
00992 }
00993 
00994 
01002 class EXPORT_SRM_CPP_DLL BaseSRF_WithEllipsoidalHeight : public BaseSRF_3D
01003 {
01004 public:
01005 
01007     virtual bool isA( SRF_ClassType type ) const;
01008 
01012     virtual CoordSurf *createSurfaceCoordinate( SRM_Long_Float coord_surf_comp1,
01013                         SRM_Long_Float coord_surf_comp2 ) = 0;
01014 
01018     virtual void getSurfaceCoordinateValues( const CoordSurf &coord_surf,
01019                          SRM_Long_Float &coord_surf_comp1,
01020                          SRM_Long_Float &coord_surf_comp2 ) const;
01021 
01025     virtual void freeSurfaceCoordinate( CoordSurf *coord_surf );
01026 
01030     virtual void getAssociatedSurfaceCoordinate( const Coord3D &coord,
01031                          CoordSurf &on_surface_coord );
01032 
01037     virtual void getPromotedSurfaceCoordinate( const CoordSurf &surf_coord,
01038                            Coord3D &three_d_coord );
01039 
01044     virtual SRF_LocalTangentSpaceEuclidean 
01045       *createLocalTangentSpaceEuclideanSRF(
01046                        const CoordSurf &surf_coord,
01047                        SRM_Long_Float azimuth,
01048                        SRM_Long_Float false_x_origin,
01049                        SRM_Long_Float false_y_origin,
01050                        SRM_Long_Float offset_height );
01051     
01061     static SRM_SRFS_Code_Info getNaturalSRFSetMemberCode( CoordSurf &src_coord,
01062                             SRM_ORM_Code orm_dst,
01063                             SRM_RT_Code rt_dst,
01064                             SRM_SRFS_Code tgt_srfs);
01065     
01066 
01076     static BaseSRF_3D* getNaturalSRFSetMember( CoordSurf &src_coord,
01077                            SRM_ORM_Code orm_dst,
01078                            SRM_RT_Code rt_dst,
01079                            SRM_SRFS_Code tgt_srfs);
01080 
01085     static SRM_Long_Float calculateEuclideanDistance( const CoordSurf &coord1,
01086                               const CoordSurf &coord2 );
01087 
01092     static SRM_Long_Float calculateGeodesicDistance( const CoordSurf &src_coord,
01093                              const CoordSurf &des_coord );
01094     
01098     virtual SRM_Long_Float calculateVerticalSeparationOffset( SRM_DSS_Code vos,
01099                                   const CoordSurf &surf_coord );
01100     
01101 
01102 protected:
01103 
01104     BaseSRF_WithEllipsoidalHeight( void *impl ) : BaseSRF_3D(impl) {} 
01105     BaseSRF_WithEllipsoidalHeight &operator =( const BaseSRF & ) { return *this; } 
01106     virtual ~BaseSRF_WithEllipsoidalHeight() {} 
01107 };
01108 
01109 
01110 inline bool BaseSRF_WithEllipsoidalHeight::isA( SRF_ClassType type ) const
01111 {
01112     if (type == BaseSRF::SRF_TYP_WITH_ELLIPSOIDAL_HEIGHT)
01113         return true;
01114     else
01115         return BaseSRF_3D::isA(type);
01116 }
01117 
01118 
01126 class EXPORT_SRM_CPP_DLL BaseSRF_MapProjection : public BaseSRF_WithEllipsoidalHeight
01127 {
01128 public:
01129 
01131     virtual bool isA( SRF_ClassType type ) const;
01132 
01147     virtual void setValidGeodeticRegion( const SRM_Integer component, 
01148                      const SRM_Interval_Type type,
01149                      const SRM_Long_Float lower,
01150                      const SRM_Long_Float upper );
01151 
01170     virtual void setExtendedValidGeodeticRegion( const SRM_Integer component, 
01171                          const SRM_Interval_Type type,
01172                          const SRM_Long_Float extended_lower,
01173                          const SRM_Long_Float lower,
01174                          const SRM_Long_Float upper,
01175                          const SRM_Long_Float extended_upper );
01176 
01188     virtual void getValidGeodeticRegion( const SRM_Integer component, 
01189                      SRM_Interval_Type &type,
01190                      SRM_Long_Float &lower,
01191                      SRM_Long_Float &upper );
01192 
01206     virtual void getExtendedValidGeodeticRegion( const SRM_Integer component, 
01207                          SRM_Interval_Type &type,
01208                          SRM_Long_Float &extended_lower,
01209                          SRM_Long_Float &lower,
01210                          SRM_Long_Float &upper,
01211                          SRM_Long_Float &extended_upper );
01212 
01217     virtual SRM_Long_Float calculateConvergenceOfTheMeridian( const CoordSurf &surf_coord );
01218 
01222     virtual SRM_Long_Float calculatePointDistortion( const CoordSurf &surf_coord );
01223 
01227     virtual SRM_Long_Float calculateMapAzimuth( const CoordSurf &src_coord,
01228                         const CoordSurf &des_coord );
01229 
01230 protected:
01231 
01232     BaseSRF_MapProjection( void *impl ) : BaseSRF_WithEllipsoidalHeight(impl) {} 
01233     BaseSRF_MapProjection &operator =( const BaseSRF & ) { return *this; } 
01234     virtual ~BaseSRF_MapProjection() {} 
01235 };
01236 
01237 
01238 inline bool BaseSRF_MapProjection::isA( SRF_ClassType type ) const
01239 {
01240     if (type == BaseSRF::SRF_TYP_MAP_PROJECTION)
01241         return true;
01242     else
01243         return BaseSRF_WithEllipsoidalHeight::isA(type);
01244 }
01245 
01246 
01247 } // namespace srm
01248 
01249 #endif // _BaseSRF_h

Spatial Reference Model C++ API Version 4.1 - 26 Jun 2006
Copyright © 2006 SEDRIS Docs by Doxygen 1.3.2