com.visioglobe.libVisioDevKit
Class VgPositionToolbox

java.lang.Object
  extended by com.visioglobe.libVisioDevKit.VgPositionToolbox

public class VgPositionToolbox
extends java.lang.Object

Provides various utility methods for VgEngine::VgPosition


Field Summary
protected  boolean swigCMemOwn
           
 
Constructor Summary
VgPositionToolbox(long cPtr, boolean cMemoryOwn)
          Class contructor.
VgPositionToolbox(VgIEngine pEngine)
           
 
Method Summary
 double computeDistance(VgPositionVector pPositions)
          Computes the distance in meters from an ordered sequence of positions.
 double computeDistance(VgPosition pPos1, VgPosition pPos2)
          Computes the distance in meters between two positions.
 double computeHeadingAngle(VgPosition pPosPivot, VgPosition pPos1, VgPosition pPos2)
          Computes the heading angle, in degrees, between Pos1-Pivot and Pos2-Pivot.
 VgPosition computeMiddlePoint(VgPosition pPos1, VgPosition pPos2)
          Computes the middle point of two positions.
 double computePitchAngle(VgPosition pPosPivot, VgPosition pPos1, VgPosition pPos2)
          Computes the pitch angle, in degrees, between Pos1-Pivot and Pos2-Pivot.
 void convert(VgPosition pPos, VgSRSConstRefPtr pSRS)
          Utility method to convert a position to a given SRS.
 void delete()
           
 VgSRSRefPtr editGeoReferencedSRS()
          Returns the engine's main georeferenced SRS.
 VgSRSRefPtr editSceneSRS()
          Returns the scene's metric SRS.
protected  void finalize()
           
 void geoConvert(VgPosition pPos, VgSRSConstRefPtr pSRS)
          Utility method to convert a position to a given SRS with geographic coherence.
static long getCPtr(VgPositionToolbox obj)
           
 VgSRSConstRefPtr getGeoReferencedSRS()
          Returns the engine's main georeferenced SRS.
 VgSRSConstRefPtr getSceneSRS()
          Returns the scene's metric SRS.
 VgPosition offsetPosition(VgPosition pPosition, double pHeadingInDegrees, double pPitchInDegrees, double pDistanceInMeters)
          Offsets a position with a distance in meters given a direction.
 VgPositionVector simplifyLineForWidth(VgPositionVector pPositions, double pWidth)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

swigCMemOwn

protected boolean swigCMemOwn
Constructor Detail

VgPositionToolbox

public VgPositionToolbox(long cPtr,
                         boolean cMemoryOwn)
Class contructor. VgPositionToolbox can be created whenever needed, but the best way to get one is to get it from VgEngine::VgIEngine::getPositionToolbox.


VgPositionToolbox

public VgPositionToolbox(VgIEngine pEngine)
Method Detail

getCPtr

public static long getCPtr(VgPositionToolbox obj)

finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object

delete

public void delete()

computeDistance

public double computeDistance(VgPositionVector pPositions)
Computes the distance in meters from an ordered sequence of positions.

Parameters:
pPositions - An 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.
Remark:
Computes a cartesian distance, not geodesic.

computeDistance

public double computeDistance(VgPosition pPos1,
                              VgPosition pPos2)
Computes the distance in meters between two positions.

Parameters:
pPos1 - Position one
pPos2 - Position two
Returns:
The distance in meters. NaN if an error occurs.
Remark:
it computes a cartesian distance, not geodesic.

computeHeadingAngle

public double computeHeadingAngle(VgPosition pPosPivot,
                                  VgPosition pPos1,
                                  VgPosition pPos2)
Computes the heading angle, in degrees, between Pos1-Pivot and Pos2-Pivot.

Parameters:
pPosPivot - Pivot Position
pPos1 - Position one
pPos2 - Position 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.

computePitchAngle

public double computePitchAngle(VgPosition pPosPivot,
                                VgPosition pPos1,
                                VgPosition pPos2)
Computes the pitch angle, in degrees, between Pos1-Pivot and Pos2-Pivot.

Parameters:
pPosPivot - Pivot Position
pPos1 - Position 1
pPos2 - Position 2
Returns:
Pitch angle in degrees [-90,90] (0 to look "forward" towards the horizon, negative values look down). NaN if an error occurs.

computeMiddlePoint

public VgPosition 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:
pPos1 - The first position.
pPos2 - The second position.
Returns:
The middle point's position in the georeferenced SRS.

offsetPosition

public VgPosition offsetPosition(VgPosition pPosition,
                                 double pHeadingInDegrees,
                                 double pPitchInDegrees,
                                 double pDistanceInMeters)
Offsets a position with a distance in meters given a direction.

Parameters:
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
Returns:
Offset position. If an error occurs, all components of the position are set to NaN.

editGeoReferencedSRS

public VgSRSRefPtr editGeoReferencedSRS()
Returns the engine's main georeferenced SRS.


getGeoReferencedSRS

public VgSRSConstRefPtr getGeoReferencedSRS()
Returns the engine's main georeferenced SRS.


editSceneSRS

public VgSRSRefPtr editSceneSRS()
Returns the scene's metric SRS.


getSceneSRS

public VgSRSConstRefPtr getSceneSRS()
Returns the scene's metric SRS.


convert

public void convert(VgPosition pPos,
                    VgSRSConstRefPtr pSRS)
Utility method to convert a position to a given SRS.

Parameters:
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.
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.

geoConvert

public void geoConvert(VgPosition pPos,
                       VgSRSConstRefPtr pSRS)
Utility method to convert a position to a given SRS with geographic coherence.

Parameters:
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.

simplifyLineForWidth

public VgPositionVector simplifyLineForWidth(VgPositionVector pPositions,
                                             double pWidth)

VisioDevKit 2.0, Visioglobe® 2013