VisioMove SDK (iOS)  2.1.22
VgEngine::VgPositionToolbox Class Reference

Public Member Functions

virtual ~VgPositionToolbox ()
 
double computeDistance (const std::vector< VgPosition > &pPositions) const
 
double computeDistance (const VgPosition &pPos1, const VgPosition &pPos2) const
 
double computeHeadingAngle (const VgPosition &pPosPivot, const VgPosition &pPos1, const VgPosition &pPos2) const
 
double computePitchAngle (const VgPosition &pPosPivot, const VgPosition &pPos1, const VgEngine::VgPosition &pPos2) const
 
VgPosition computeMiddlePoint (const VgPosition &pPos1, const VgPosition &pPos2) const
 
VgPosition offsetPosition (const VgPosition &pPosition, const double pHeadingInDegrees, const double pPitchInDegrees, const double pDistanceInMeters) const
 
VgEngine::VgRefPtr< VgEngine::VgSRSeditGeoReferencedSRS ()
 
VgEngine::VgConstRefPtr< VgEngine::VgSRSgetGeoReferencedSRS () const
 
VgEngine::VgRefPtr< VgEngine::VgSRSeditSceneSRS ()
 
VgEngine::VgConstRefPtr< VgEngine::VgSRSgetSceneSRS () const
 
void convert (VgPosition &pPos, VgEngine::VgConstRefPtr< VgSRS > pSRS) const
 
void geoConvert (VgPosition &pPos, VgEngine::VgConstRefPtr< VgSRS > pSRS) const
 
std::vector< VgEngine::VgPositionsimplifyLineForWidth (const std::vector< VgEngine::VgPosition > &pPositions, double pWidth) const
 
bool isInside2D (const VgEngine::VgPosition &pPosition, const std::vector< VgEngine::VgPosition > &pPolygon) const
 

Protected Member Functions

 VgPositionToolbox (VgIEngine &pEngine)=delete
 
 VgPositionToolbox ()
 

Protected Attributes

Private * mPrivate
 

Friends

class VgEngine::VgIEngine
 
class VgEngine::VgObjectBridge
 

Detailed Description

Provides various utility methods for VgEngine::VgPosition

Constructor & Destructor Documentation

virtual VgEngine::VgPositionToolbox::~VgPositionToolbox ( )
virtual

class destructor.

VgEngine::VgPositionToolbox::VgPositionToolbox ( VgIEngine pEngine)
protecteddelete

Class contructor. VgPositionToolbox can not be instantiated, the best way to get one is to get it from VgEngine::VgIEngine::getPositionToolbox.

Deprecated:
As of 2.1.19 this constructor can't be called by client code.
VgEngine::VgPositionToolbox::VgPositionToolbox ( )
protected

Class contructor. VgPositionToolbox can not be instantiated, the best way to get one is to get it from VgEngine::VgIEngine::getPositionToolbox.

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
bool VgEngine::VgPositionToolbox::isInside2D ( const VgEngine::VgPosition pPosition,
const std::vector< VgEngine::VgPosition > &  pPolygon 
) const

Utility to determine if a position is inside a polygon

Parameters
pPositionposition to test
pPolygonvector of points, it assumes the VgSRS of all its points are the same, it should have at least 3 elements.
Returns
true if pPosition is inside the polygon defined by pPolygon points.
Version
2.1.4
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
pWidthThe width of the line that is to be simplified. The larger the width, the greater the simplifiction of the line's position vector.
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

Private* VgEngine::VgPositionToolbox::mPrivate
protected

The documentation for this class was generated from the following file:
VisioMove 2.1.22, Visioglobe® 2016