Public Member Functions | Protected Attributes | Friends

VgEngine::VgPositionToolbox Class Reference

Provides various utility methods for VgEngine::VgPosition. More...

List of all members.

Public Member Functions

 VgPositionToolbox (VgIEngine &pEngine)
 Class contructor.
virtual ~VgPositionToolbox ()
 class destructor.
double computeDistance (const std::vector< VgPosition > &pPositions) const
 Computes the distance in meters from an ordered sequence of positions.
double computeDistance (const VgPosition &pPos1, const VgPosition &pPos2) const
 Computes the distance in meters between two positions.
double computeHeadingAngle (const VgPosition &pPosPivot, const VgPosition &pPos1, const VgPosition &pPos2) const
 Computes the heading angle, in degrees, between Pos1-Pivot and Pos2-Pivot.
double computePitchAngle (const VgPosition &pPosPivot, const VgPosition &pPos1, const VgEngine::VgPosition &pPos2) const
 Computes the pitch angle, in degrees, between Pos1-Pivot and Pos2-Pivot.
VgPosition computeMiddlePoint (const VgPosition &pPos1, const VgPosition &pPos2) const
 Computes the middle point of two positions.
VgPosition offsetPosition (const VgPosition &pPosition, const double pHeadingInDegrees, const double pPitchInDegrees, const double pDistanceInMeters) const
 Offsets a position with a distance in meters given a direction.
VgEngine::VgRefPtr
< VgEngine::VgSRS
editGeoReferencedSRS ()
 Returns the engine's main georeferenced SRS.
VgEngine::VgConstRefPtr
< VgEngine::VgSRS
getGeoReferencedSRS () const
 Returns the engine's main georeferenced SRS.
VgEngine::VgRefPtr
< VgEngine::VgSRS
editSceneSRS ()
 Returns the scene's metric SRS.
VgEngine::VgConstRefPtr
< VgEngine::VgSRS
getSceneSRS () const
 Returns the scene's metric SRS.
void convert (VgPosition &pPos, VgEngine::VgConstRefPtr< VgSRS > pSRS) const
 Utility method to convert a position to a given SRS.
void geoConvert (VgPosition &pPos, VgEngine::VgConstRefPtr< VgSRS > pSRS) const
 Utility method to convert a position to a given SRS with geographic coherence.
std::vector< VgEngine::VgPositionsimplifyLineForWidth (const std::vector< VgEngine::VgPosition > &pPositions, double pWidth) const
 Utility to simplify a line (vector of positions) such that the resulting line is simpler and its turn's radius is wider than half the width.

Protected Attributes

Private * mPrivate

Friends

class VgEngine::VgIEngine
class VgEngine::VgObjectBridge

Detailed Description

Provides various utility methods for VgEngine::VgPosition.


Constructor & Destructor Documentation

VgEngine::VgPositionToolbox::VgPositionToolbox ( VgIEngine pEngine )

Class contructor.

VgPositionToolbox can be created whenever needed, but the best way to get one is to get it from VgEngine::VgIEngine::getPositionToolbox.

virtual VgEngine::VgPositionToolbox::~VgPositionToolbox (  ) [virtual]

class destructor.


Member Function Documentation

double VgEngine::VgPositionToolbox::computeDistance ( const std::vector< VgPosition > &  pPositions ) const

Computes the distance in meters from an ordered sequence of positions.

Remarks:
Computes a cartesian distance, not geodesic.
Parameters:
pPositionsAn ordered sequence of positions.
Returns:
The total distance in meters. 0.0 if the parameter pPositions contains 0 or 1 elements. NaN if an error occurs.
double VgEngine::VgPositionToolbox::computeDistance ( const VgPosition pPos1,
const VgPosition pPos2 
) const

Computes the distance in meters between two positions.

Parameters:
pPos1Position one
pPos2Position two
Remarks:
it computes a cartesian distance, not geodesic.
Returns:
The distance in meters. NaN if an error occurs.
double VgEngine::VgPositionToolbox::computeHeadingAngle ( const VgPosition pPosPivot,
const VgPosition pPos1,
const VgPosition pPos2 
) const

Computes the heading angle, in degrees, between Pos1-Pivot and Pos2-Pivot.

Parameters:
pPosPivotPivot Position
pPos1Position one
pPos2Position two
Returns:
Heading angle in degrees [0,360] (0 for north, increasing in value starting from the east). If at least two positions are equal, the result is undefined. NaN if an error occurs.
computeHeadingAngle.jpg
VgPosition VgEngine::VgPositionToolbox::computeMiddlePoint ( const VgPosition pPos1,
const VgPosition pPos2 
) const

Computes the middle point of two positions.

The positions will be converted to scene SRS with geographic coherence before computing. The result position will be expressed in the georeferenced SRS.

Parameters:
pPos1The first position.
pPos2The second position.
Returns:
The middle point's position in the georeferenced SRS.
Version:
2.0.8955
double VgEngine::VgPositionToolbox::computePitchAngle ( const VgPosition pPosPivot,
const VgPosition pPos1,
const VgEngine::VgPosition pPos2 
) const

Computes the pitch angle, in degrees, between Pos1-Pivot and Pos2-Pivot.

Parameters:
pPosPivotPivot Position
pPos1Position 1
pPos2Position 2
Returns:
Pitch angle in degrees [-90,90] (0 to look "forward" towards the horizon, negative values look down). NaN if an error occurs.
computePitchAngle.jpg
void VgEngine::VgPositionToolbox::convert ( VgPosition pPos,
VgEngine::VgConstRefPtr< VgSRS pSRS 
) const

Utility method to convert a position to a given SRS.

Parameters:
pPosThe position to convert.
pSRSThe spatial reference system in which to convert the position. If NULL it is assumed that WGS84 is wanted.
Note:
No conversion will take place if the Geograhpical SRS hasn't been initialised. The Geograhpical SRS is initialised as a result of calling the VgIDatabase::selectDataset() method.
Version:
2.0
VgEngine::VgRefPtr< VgEngine::VgSRS > VgEngine::VgPositionToolbox::editGeoReferencedSRS (  )

Returns the engine's main georeferenced SRS.

Version:
2.0
VgEngine::VgRefPtr< VgEngine::VgSRS > VgEngine::VgPositionToolbox::editSceneSRS (  )

Returns the scene's metric SRS.

Version:
2.0
void VgEngine::VgPositionToolbox::geoConvert ( VgPosition pPos,
VgEngine::VgConstRefPtr< VgSRS pSRS 
) const

Utility method to convert a position to a given SRS with geographic coherence.

Parameters:
pPosThe position to convert.
pSRSThe spatial reference system in which to convert the position. If NULL it is assumed that WGS84 is wanted.
Version:
2.0.8955
VgEngine::VgConstRefPtr< VgEngine::VgSRS > VgEngine::VgPositionToolbox::getGeoReferencedSRS (  ) const

Returns the engine's main georeferenced SRS.

Version:
2.0
VgEngine::VgConstRefPtr< VgEngine::VgSRS > VgEngine::VgPositionToolbox::getSceneSRS (  ) const

Returns the scene's metric SRS.

Version:
2.0
VgPosition VgEngine::VgPositionToolbox::offsetPosition ( const VgPosition pPosition,
const double  pHeadingInDegrees,
const double  pPitchInDegrees,
const double  pDistanceInMeters 
) const

Offsets a position with a distance in meters given a direction.

Parameters:
pPositionStart position
pHeadingInDegreesHeading in degrees [0,360] (0 for north, increasing value start to east).
pPitchInDegreesPitch in degrees [-90,90] (0 to look "forward" towards the horizon, negative values to look down)
pDistanceInMetersDistance in meters
Returns:
Offset position. If an error occurs, all components of the position are set to NaN.
std::vector< VgEngine::VgPosition > VgEngine::VgPositionToolbox::simplifyLineForWidth ( const std::vector< VgEngine::VgPosition > &  pPositions,
double  pWidth 
) const

Utility to simplify a line (vector of positions) such that the resulting line is simpler and its turn's radius is wider than half the width.

This function for advanced users is used for computing positions and subsequently creating lines to be seen at different distances.

Parameters:
pPositionsinput vector of positions
pSRSThe spatial reference system in which to convert the position. If NULL it is assumed that WGS84 is wanted.
Returns:
new positions vector with less or equal number of points.
Version:
2.0.8955

Friends And Related Function Documentation

friend class VgEngine::VgIEngine [friend]
friend class VgEngine::VgObjectBridge [friend]

Member Data Documentation


The documentation for this class was generated from the following file:
VisioDevKit 2.0, Visioglobe® 2013