VisioMove SDK (Android)  2.1.22
 All Classes Functions Variables Pages
VgPositionToolbox Class Reference

Public Member Functions

double computeDistance (VgPositionVector pPositions)
 
double computeDistance (VgPosition pPos1, VgPosition pPos2)
 
double computeHeadingAngle (VgPosition pPosPivot, VgPosition pPos1, VgPosition pPos2)
 
double computePitchAngle (VgPosition pPosPivot, VgPosition pPos1, VgPosition pPos2)
 
VgPosition computeMiddlePoint (VgPosition pPos1, VgPosition pPos2)
 
VgPosition offsetPosition (VgPosition pPosition, double pHeadingInDegrees, double pPitchInDegrees, double pDistanceInMeters)
 
VgSRSRefPtr editGeoReferencedSRS ()
 
VgSRSConstRefPtr getGeoReferencedSRS ()
 
VgSRSRefPtr editSceneSRS ()
 
VgSRSConstRefPtr getSceneSRS ()
 
void convert (VgPosition pPos, VgSRSConstRefPtr pSRS)
 
void geoConvert (VgPosition pPos, VgSRSConstRefPtr pSRS)
 
VgPositionVector simplifyLineForWidth (VgPositionVector pPositions, double pWidth)
 
boolean isInside2D (VgPosition pPosition, VgPositionVector pPolygon)
 

Detailed Description

Provides various utility methods for VgEngine::VgPosition

Member Function Documentation

double VgPositionToolbox.computeDistance ( VgPositionVector  pPositions)

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 VgPositionToolbox.computeDistance ( VgPosition  pPos1,
VgPosition  pPos2 
)

Computes the distance in meters between two positions.

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

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.
VgPosition VgPositionToolbox.computeMiddlePoint ( VgPosition  pPos1,
VgPosition  pPos2 
)

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.
Version
2.0.8955
Returns
The middle point's position in the georeferenced SRS.
double VgPositionToolbox.computePitchAngle ( VgPosition  pPosPivot,
VgPosition  pPos1,
VgPosition  pPos2 
)

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.
void VgPositionToolbox.convert ( VgPosition  pPos,
VgSRSConstRefPtr  pSRS 
)

Utility method to convert a position to a given SRS.

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.
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
VgSRSRefPtr VgPositionToolbox.editGeoReferencedSRS ( )

Returns the engine's main georeferenced SRS.

Version
2.0
VgSRSRefPtr VgPositionToolbox.editSceneSRS ( )

Returns the scene's metric SRS.

Version
2.0
void VgPositionToolbox.geoConvert ( VgPosition  pPos,
VgSRSConstRefPtr  pSRS 
)

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
VgSRSConstRefPtr VgPositionToolbox.getGeoReferencedSRS ( )

Returns the engine's main georeferenced SRS.

Version
2.0
VgSRSConstRefPtr VgPositionToolbox.getSceneSRS ( )

Returns the scene's metric SRS.

Version
2.0
boolean VgPositionToolbox.isInside2D ( VgPosition  pPosition,
VgPositionVector  pPolygon 
)

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.
Version
2.1.4
Returns
true if pPosition is inside the polygon defined by pPolygon points.
VgPosition VgPositionToolbox.offsetPosition ( VgPosition  pPosition,
double  pHeadingInDegrees,
double  pPitchInDegrees,
double  pDistanceInMeters 
)

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.
VgPositionVector VgPositionToolbox.simplifyLineForWidth ( VgPositionVector  pPositions,
double  pWidth 
)

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.
Version
2.0.8955
Returns
new positions vector with less or equal number of points.

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