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

srm::BaseSRF Class Reference

The BaseSRF abstract class is the base class for all SRFs. More...

#include <BaseSRF.h>

Inheritance diagram for srm::BaseSRF:

Inheritance graph
[legend]
List of all members.

Public Types

enum  SRF_ClassType {
  SRF_TYP_TWO_D, SRF_TYP_THREE_D, SRF_TYP_WITH_TANGENT_PLANE_SURFACE, SRF_TYP_WITH_ELLIPSOIDAL_HEIGHT,
  SRF_TYP_MAP_PROJECTION, SRF_TYP_LSA, SRF_TYP_CC, SRF_TYP_CD,
  SRF_TYP_CM, SRF_TYP_EC, SRF_TYP_EI, SRF_TYP_HAEC,
  SRF_TYP_HEEC, SRF_TYP_HEEQ, SRF_TYP_LCC, SRF_TYP_LCE_3D,
  SRF_TYP_LSR_2D, SRF_TYP_LSR_3D, SRF_TYP_LTSAS, SRF_TYP_LTSC,
  SRF_TYP_LTSE, SRF_TYP_M, SRF_TYP_OMS, SRF_TYP_PD,
  SRF_TYP_LSP, SRF_TYP_PS, SRF_TYP_SEC, SRF_TYP_SEQ,
  SRF_TYP_SME, SRF_TYP_SMD, SRF_TYP_TM
}
 The type of an SRF.


Public Member Functions

virtual void release ()
 Releases the pointer to the SRF.

virtual void getCodes (SRM_SRFT_Code &t_code, SRM_SRF_Code &srf_code, SRM_SRFS_Code_Info &srfs_code_info) const
 Returns the codes that identify this class.

virtual SRM_CS_Code getCSCode () const
 Returns the CS code.

virtual SRM_ORM_Code get_orm () const
 Returns this SRF's Object Reference Model code.

virtual SRM_RT_Code get_rt () const
 Returns this SRF's RT code.

virtual SRF_ClassType getClassType () const=0
 Returns the class type of this SRF instance.

virtual bool isA (SRF_ClassType type) const
 Returns true if this SRF is of the given class type.

virtual SRM_Coordinate_Valid_Region changeCoordinateSRF (const Coord &src_coord, Coord &des_coord)
 Changes a coordinate's values to this SRF.

virtual SRM_Coordinate_Valid_Region checkCoordinate (const Coord &src)
 Checks a coordinate in this SRF for valid region.

virtual void freeCoordinate (Coord *coord)
 Frees a coordinate in this SRF.

virtual const char * toString ()=0
 Returns a string representation of this SRF.

virtual BaseSRFclone ()
 Returns a new reference to this SRF.


Static Public Member Functions

BaseSRFcreateStandardSRF (SRM_SRF_Code srf_code, SRM_RT_Code rt_code)
 Creates a Standard SRF from its SRF code.

BaseSRFcreateSRFSetMember (SRM_SRFS_Info srfs_info, SRM_RT_Code rt)
 Creates an SRF from a SRF set code, a set member code specific to that set, and an ORM code.

bool querySRFTSupport (SRM_SRFT_Code srft_code)
 Queries for the SRFT support by the implementation.

bool queryORMSupport (SRM_ORM_Code orm_code, SRM_RT_Code rt_code)
 Queries for the ORM/RT pair support by the implementation.

SRM_Long_Float calculateEuclideanDistance (const Coord &coord1, const Coord &coord2)
 Returns the euclidean distance (in metres) between two coordinates.


Protected Member Functions

 BaseSRF (void *impl)
 No stack allocation.

BaseSRFoperator= (const BaseSRF &)
 No copy constructor.

virtual ~BaseSRF ()
 Use release().


Protected Attributes

unsigned int _ref_cnt
 Reference counting.

void * _impl
 Implementation data.


Friends

class Coord3D
class BaseSRF_3D
class BaseSRF_2D
class BaseSRF_MapProjection
class BaseSRF_WithEllipsoidalHeight
class BaseSRF_WithTangentPlaneSurface

Detailed Description

The BaseSRF abstract class is the base class for all SRFs.

SRFs are allocated by the API, and when no longer needed they should be released by calling the release() method.

Author:
Warren Macchi, David Shen
See also:
BaseSRF_2D, BaseSRF_3D

Definition at line 182 of file BaseSRF.h.


Member Function Documentation

SRM_Long_Float srm::BaseSRF::calculateEuclideanDistance const Coord coord1,
const Coord coord2
[static]
 

Returns the euclidean distance (in metres) between two coordinates.

Exceptions:
This method throws srm::Exception
Note:
The input coordinates must be of the same dimension.

The input coordinates can be created from any SRF.

virtual SRM_Coordinate_Valid_Region srm::BaseSRF::changeCoordinateSRF const Coord src_coord,
Coord des_coord
[virtual]
 

Changes a coordinate's values to this SRF.

Note:
The destination coordinate must have been created using this SRF.
Parameters:
src_coord in: the source coordinate in some other SRF
des_coord out: the destination coordinate in this SRF
Returns:
validity code for the destination coordinate
Exceptions:
This method throws srm::Exception
Note:
The source and destination coordinatesmust be of the same base coordinate class. They have to be both Coord3D, Coord2D, or CoordSurf.

The conversion from one surface coordinate to another is a convinient function equivalent to promoting them to 3D coordinates, performing the conversion, and then derive destination surface coordinate from the resulting destination 3D coordinate.

virtual SRM_Coordinate_Valid_Region srm::BaseSRF::checkCoordinate const Coord src  )  [virtual]
 

Checks a coordinate in this SRF for valid region.

Parameters:
src in: the coodinate in this SRF
Returns:
validity code for the coordinate
Exceptions:
This method throws srm::Exception

BaseSRF * srm::BaseSRF::clone  )  [inline, virtual]
 

Returns a new reference to this SRF.

See also:
release()
Returns:
a new pointer to this SRF

Definition at line 398 of file BaseSRF.h.

BaseSRF* srm::BaseSRF::createSRFSetMember SRM_SRFS_Info  srfs_info,
SRM_RT_Code  rt
[static]
 

Creates an SRF from a SRF set code, a set member code specific to that set, and an ORM code.

Note:
An SRF can be directly created from:
  1. an SRF code and a RT code for a standard SRF (see createStandardSRF()),
  2. an SRF set code info and a RT code (see createSRFSetMember()), or
  3. a concrete template-based SRF class (see the concrete SRF classes).

The returned SRF should be freed by calling its release() method.

Parameters:
srfs_info in: the set code, member code and orm code.
rt in: the RT code to use in the created SRF
Returns:
a pointer to an SRF set member if successful
Exceptions:
This method throws srm::Exception

BaseSRF* srm::BaseSRF::createStandardSRF SRM_SRF_Code  srf_code,
SRM_RT_Code  rt_code
[static]
 

Creates a Standard SRF from its SRF code.

Note:
An SRF can be directly created from:
  1. an SRF code and a RT code for a standard SRF (see createStandardSRF()),
  2. an SRF set code info and a RT code (see createSRFSetMember()), or
  3. a concrete template-based SRF class (see the concrete SRF classes).

The returned SRF should be freed by calling its release() method.

Parameters:
srf_code in: the code for a standard SRF to create
rt_code in: the RT code to use in the created SRF
Returns:
a pointer to an SRF if successful
Exceptions:
This method throws srm::Exception

virtual void srm::BaseSRF::freeCoordinate Coord coord  )  [virtual]
 

Frees a coordinate in this SRF.

Exceptions:
This method throws srm::Exception

virtual SRM_ORM_Code srm::BaseSRF::get_orm  )  const [virtual]
 

Returns this SRF's Object Reference Model code.

Returns:
an ORM code

virtual SRM_RT_Code srm::BaseSRF::get_rt  )  const [virtual]
 

Returns this SRF's RT code.

Returns:
an RT code

virtual SRF_ClassType srm::BaseSRF::getClassType  )  const [pure virtual]
 

Returns the class type of this SRF instance.

You can use the return value of this method to cast a pointer to an SRF to its concrete template-based class.

Returns:
an SRF template code

Implemented in srm::SRF_LocalSpaceAzimuthal, srm::SRF_Celestiocentric, srm::SRF_Celestiodetic, srm::SRF_Celestiomagnetic, srm::SRF_EquatorialInertial, srm::SRF_EquidistantCylindrical, srm::SRF_HeliosphericAriesEcliptic, srm::SRF_HeliosphericEarthEcliptic, srm::SRF_HeliosphericEarthEquatorial, srm::SRF_LambertConformalConic, srm::SRF_LocalSpaceRectangular2D, srm::SRF_LocalSpaceRectangular3D, srm::SRF_LocalTangentSpaceAzimuthalSpherical, srm::SRF_LocalTangentSpaceCylindrical, srm::SRF_LocalTangentSpaceEuclidean, srm::SRF_Mercator, srm::SRF_LocalSpacePolar, srm::SRF_Planetodetic, srm::SRF_PolarStereographic, srm::SRF_SolarEcliptic, srm::SRF_SolarEquatorial, srm::SRF_SolarMagneticEcliptic, srm::SRF_SolarMagneticDipole, srm::SRF_TransverseMercator, srm::SRF_ObliqueMercatorSpherical, and srm::SRF_LococentricEuclidean3D.

virtual void srm::BaseSRF::getCodes SRM_SRFT_Code t_code,
SRM_SRF_Code srf_code,
SRM_SRFS_Code_Info srfs_code_info
const [virtual]
 

Returns the codes that identify this class.

An SRF can be directly created from:

  1. an SRF code for a standard SRF (see createStandardSRF()),
  2. an SRF set code and a set member code (see createSRFSetMember()), or
  3. a concrete template-based SRF class (see the concrete SRF classes).
All SRFs are intrinsically created from a template, hence the appropriate template code will always be returned from this method. However, if the SRF was created by either of 1) or 2) above, then this method allows you to retrieve the codes used to create it. If a code is not applicable, its value will be set to 0.
Parameters:
t_code out: the SRF Template code
srf_code out: the standard SRF code. It returns SRM_SRFCOD_UNSPECIFIED (0) if not created using a Standard SRF Code
srfs_code_info out: the SRF Set and its Member code. It returns SRM_SRFSCOD_UNSPECIFIED (0) if not created using a SRFS Code

virtual SRM_CS_Code srm::BaseSRF::getCSCode  )  const [virtual]
 

Returns the CS code.

Returns:
a CS code

bool srm::BaseSRF::queryORMSupport SRM_ORM_Code  orm_code,
SRM_RT_Code  rt_code
[static]
 

Queries for the ORM/RT pair support by the implementation.

Parameters:
orm_code in: the object reference model code.
rt_code in: the reference transformation code.
Returns:
true if the ORM/RT pair is supported by this implementation.
Exceptions:
This method throws srm::Exception
Note:
Not all the supported SRFTs is compatible with all the supported ORM/RT pairs.

bool srm::BaseSRF::querySRFTSupport SRM_SRFT_Code  srft_code  )  [static]
 

Queries for the SRFT support by the implementation.

Parameters:
srft_code in: the SRF Template code.
Returns:
true if the SRFT is supported by this implementation.
Exceptions:
This method throws srm::Exception

virtual void srm::BaseSRF::release  )  [virtual]
 

Releases the pointer to the SRF.

SRF classes are reference counted, since coordinates maintain a reference to them. When all references to an SRF are released, the SRF's memory is deleted.

Note:
If you need to store multiple pointers to an SRF, you should use the clone() method to obtain each pointer, and then call the release() method for each pointer when they are no longer needed.
Exceptions:
This method throws srm::Exception
See also:
clone()


The documentation for this class was generated from the following file:
Spatial Reference Model C++ API Version 4.1 - 26 Jun 2006
Copyright © 2006 SEDRIS Docs by Doxygen 1.3.2