Provides various utility methods for VgEngine::VgPosition. More...
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::VgPosition > | 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. | |
Protected Attributes | |
Private * | mPrivate |
Friends | |
class | VgEngine::VgIEngine |
class | VgEngine::VgObjectBridge |
Provides various utility methods for VgEngine::VgPosition.
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.
double VgEngine::VgPositionToolbox::computeDistance | ( | const std::vector< VgPosition > & | pPositions ) | const |
Computes the distance in meters from an ordered sequence of positions.
pPositions | An ordered sequence of positions. |
double VgEngine::VgPositionToolbox::computeDistance | ( | const VgPosition & | pPos1, |
const VgPosition & | pPos2 | ||
) | const |
Computes the distance in meters between two positions.
pPos1 | Position one |
pPos2 | Position two |
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.
pPosPivot | Pivot Position |
pPos1 | Position one |
pPos2 | Position two |
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.
pPos1 | The first position. |
pPos2 | The second position. |
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.
pPosPivot | Pivot Position |
pPos1 | Position 1 |
pPos2 | Position 2 |
void VgEngine::VgPositionToolbox::convert | ( | VgPosition & | pPos, |
VgEngine::VgConstRefPtr< VgSRS > | pSRS | ||
) | const |
Utility method to convert a position to a given SRS.
pPos | The position to convert. |
pSRS | The spatial reference system in which to convert the position. If NULL it is assumed that WGS84 is wanted. |
VgEngine::VgRefPtr< VgEngine::VgSRS > VgEngine::VgPositionToolbox::editGeoReferencedSRS | ( | ) |
Returns the engine's main georeferenced SRS.
VgEngine::VgRefPtr< VgEngine::VgSRS > VgEngine::VgPositionToolbox::editSceneSRS | ( | ) |
Returns the scene's metric SRS.
void VgEngine::VgPositionToolbox::geoConvert | ( | VgPosition & | pPos, |
VgEngine::VgConstRefPtr< VgSRS > | pSRS | ||
) | const |
Utility method to convert a position to a given SRS with geographic coherence.
pPos | The position to convert. |
pSRS | The spatial reference system in which to convert the position. If NULL it is assumed that WGS84 is wanted. |
VgEngine::VgConstRefPtr< VgEngine::VgSRS > VgEngine::VgPositionToolbox::getGeoReferencedSRS | ( | ) | const |
Returns the engine's main georeferenced SRS.
VgEngine::VgConstRefPtr< VgEngine::VgSRS > VgEngine::VgPositionToolbox::getSceneSRS | ( | ) | const |
Returns the scene's metric SRS.
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.
pPosition | Start position |
pHeadingInDegrees | Heading in degrees [0,360] (0 for north, increasing value start to east). |
pPitchInDegrees | Pitch in degrees [-90,90] (0 to look "forward" towards the horizon, negative values to look down) |
pDistanceInMeters | Distance in meters |
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.
pPositions | input vector of positions |
pSRS | The spatial reference system in which to convert the position. If NULL it is assumed that WGS84 is wanted. |
friend class VgEngine::VgIEngine [friend] |
friend class VgEngine::VgObjectBridge [friend] |
Private* VgEngine::VgPositionToolbox::mPrivate [protected] |