Public Member Functions | Protected Member Functions

VgEngine::VgICamera Interface Reference

This interface is used to retreive and control the camera parameters. More...

List of all members.

Public Member Functions

virtual ~VgICamera ()
 Destructor.
virtual void setPosition (const VgEngine::VgPosition &pPosition)=0
 Sets the camera's position.
virtual void setHeading (double pHeadingInDegrees)=0
 Sets the camera's heading (0 for north, increasing value start to east).
virtual void setPitch (double pPitchInDegrees)=0
 Sets the camera's pitch.
virtual const VgEngine::VgPosition getPosition () const =0
 Retrieves the current camera's position.
virtual double getHeading () const =0
 Retrieves the current camera's heading (in degrees).
virtual double getPitch () const =0
 Retrieves the current camera's pitch (in degrees).
virtual void setViewpoint (const VgIViewPoint &pViewpoint)=0
 Sets the camera viewpoint.
virtual const VgIViewPointgetViewpoint ()=0
 Gets the camera viewpoint.
virtual void projectOnScreen (const VgEngine::VgPosition &pPosition, double &pXScreen, double &pYScreen, double *pZScreen=NULL) const =0
 Projects a position on the screen.
virtual bool pickGeographicPoint (const double &pX, const double &pY, VgEngine::VgPosition &pPosition) const =0
 Casts a ray from a point on the screen in the 3D scene.
virtual VgIViewPoint getViewpointFromPositions (const std::vector< VgEngine::VgPosition > &pPositions, UInt pTop, UInt pBottom, UInt pLeft, UInt pRight, double pPitch, double pHeading)=0
 Computes a viewpoint using the current pitch and heading, at which all given positions are visible.
virtual VgIViewPoint getViewpointFromPositions (const std::vector< VgEngine::VgPosition > &pPositions, UInt pTop, UInt pBottom, UInt pLeft, UInt pRight)=0
 Computes a viewpoint using the current pitch and heading, at which all given positions are visible.
virtual double getFovX () const =0
 Gets the camera's horizontal field of view.
virtual double getFovY () const =0
 Gets the camera's vertical field of view.
virtual void setFovX (double pFovX, double pRatio=-1.0f)=0
 Sets the camera's field of view.

Protected Member Functions

 VgICamera ()
 Constructor.

Detailed Description

This interface is used to retreive and control the camera parameters.

Those parameters are the camera's position, heading and pitch. The position is expressed in "scene" coordinates (See VgICamera::getPosition and VgICamera::setPosition for more information). The heading is the angle with the North direction (See VgICamera::setHeading for more information). The pitch is the angle with the tangent plane (See VgICamera::setPitch for more information).

Date:
25/02/2010

Constructor & Destructor Documentation

VgEngine::VgICamera::VgICamera (  ) [inline, protected]

Constructor.

virtual VgEngine::VgICamera::~VgICamera (  ) [inline, virtual]

Destructor.


Member Function Documentation

virtual double VgEngine::VgICamera::getFovX (  ) const [pure virtual]

Gets the camera's horizontal field of view.

Returns:
The camera's horizontal field of view angle in degrees.
Remarks:
This value depends on the rendering viewport size. Remember to call this after resize if necessary.
Version:
2.0
virtual double VgEngine::VgICamera::getFovY (  ) const [pure virtual]

Gets the camera's vertical field of view.

Returns:
The camera's vertical field of view angle in degrees.
Remarks:
This value depends on the rendering viewport size. Remember to call this after resize if necessary.
Version:
2.0
virtual double VgEngine::VgICamera::getHeading (  ) const [pure virtual]

Retrieves the current camera's heading (in degrees).

See VgICamera::setHeading for more information.

virtual double VgEngine::VgICamera::getPitch (  ) const [pure virtual]

Retrieves the current camera's pitch (in degrees).

See VgICamera::setPitch for more information.

virtual const VgEngine::VgPosition VgEngine::VgICamera::getPosition (  ) const [pure virtual]

Retrieves the current camera's position.

Returns:
The camera's position expressed in the scene's metric SRS.
virtual const VgIViewPoint& VgEngine::VgICamera::getViewpoint (  ) [pure virtual]

Gets the camera viewpoint.

Note:
The same note on positions as in VgEngine::VgICamera::getPosition applies here. Position in the returned viewpoint is in the scene's SRS.
virtual VgIViewPoint VgEngine::VgICamera::getViewpointFromPositions ( const std::vector< VgEngine::VgPosition > &  pPositions,
UInt  pTop,
UInt  pBottom,
UInt  pLeft,
UInt  pRight,
double  pPitch,
double  pHeading 
) [pure virtual]

Computes a viewpoint using the current pitch and heading, at which all given positions are visible.

Parameters:
pPositionsList of positions to see.
pTopThe top padding area's height to use (in pixels)
pBottomThe bottom padding area's height to use (in pixels)
pLeftThe left padding area's width to use (in pixels)
pRightThe right padding area's width to use (in pixels)
pPitchThe pitch to use for computation if "not-a-number" current pitch will be used.
pHeadingThe pitch to use for computation if "not-a-number" current heading will be used.
Note:
When no position is provided (empty vector), the current viewpoint is returned.
When only one position is provided there is an additional constraint that forces the viewpoint to keep the current altitude. This can lead to results where the provided position would be behind the camera. For example, this will happen if the view is looking down and the point is above the camera.
The same notes on positions as in VgEngine::VgICamera::setPosition and VgEngine::VgICamera::getPosition apply here. The input positions will be converted to the scene's metric SRS. The computing will be done in the scene's metric SRS, and the resulting viewpoint's position expressed in it.
virtual VgIViewPoint VgEngine::VgICamera::getViewpointFromPositions ( const std::vector< VgEngine::VgPosition > &  pPositions,
UInt  pTop,
UInt  pBottom,
UInt  pLeft,
UInt  pRight 
) [pure virtual]

Computes a viewpoint using the current pitch and heading, at which all given positions are visible.

Parameters:
pPositionsList of positions to see.
pTopThe top padding area's height to use (in pixels)
pBottomThe bottom padding area's height to use (in pixels)
pLeftThe left padding area's width to use (in pixels)
pRightThe right padding area's width to use (in pixels)
Note:
When no position is provided (empty vector), the current viewpoint is returned.
When only one position is provided there is an additional constraint that forces the viewpoint to keep the current altitude. This can lead to results where the provided position would be behind the camera. For example, this will happen if the view is looking down and the point is above the camera.
The same notes on positions as in VgEngine::VgICamera::setPosition and VgEngine::VgICamera::getPosition apply here. The input positions will be converted to the scene's metric SRS. The computing will be done in the scene's metric SRS, and the resulting viewpoint's position expressed in it.
virtual bool VgEngine::VgICamera::pickGeographicPoint ( const double &  pX,
const double &  pY,
VgEngine::VgPosition pPosition 
) const [pure virtual]

Casts a ray from a point on the screen in the 3D scene.

Parameters:
pXthe normalized X screen coordinate (0 is on the left of the screen, 1 on the right).
pYthe normalized Y screen coordinate (0 is on the bottom of the screen, 1 on the top).
pPositionthe geographic position if an intersection has been found. Expressed in the scene's SRS
Returns:
true if there is an intersection, false otherwise.
virtual void VgEngine::VgICamera::projectOnScreen ( const VgEngine::VgPosition pPosition,
double &  pXScreen,
double &  pYScreen,
double *  pZScreen = NULL 
) const [pure virtual]

Projects a position on the screen.

Parameters:
pPositionthe geographic position to be projected on the screen.
pXScreenthe projected X coordinate on the screen. This value is normalized between 0 and 1, where 0 is on the left of the screen
pYScreenthe projected Y coordinate on the screen. This value is normalized between 0 and 1, where 0 is on the bottom of the screen.
pZScreenthe projected Z coordinate on the screen. If the projected point is in the view frustum the value is between 0 and 1.
Note:
The same note on positions as in VgEngine::VgICamera::setPosition applies here.
virtual void VgEngine::VgICamera::setFovX ( double  pFovX,
double  pRatio = -1.0f 
) [pure virtual]

Sets the camera's field of view.

The VisioDevKit's policy for the field of view is adaptative, this means that the engine will try to always have the same "amount of view" per pixel. As a result, when the size of the rendering surface changes, the field of view changes in order to keep a constant pixel ratio.

Parameters:
pFovXThe new field of view angle in degrees (will be clamped to reasonable values).
pRatioOptional aspect ratio (if negative, ratio will be computed from screen resolution).
Version:
2.0.8744
virtual void VgEngine::VgICamera::setHeading ( double  pHeadingInDegrees ) [pure virtual]

Sets the camera's heading (0 for north, increasing value start to east).

Parameters:
pHeadingInDegreesHeading angle, expressed in degrees.
virtual void VgEngine::VgICamera::setPitch ( double  pPitchInDegrees ) [pure virtual]

Sets the camera's pitch.

0 to look "forward" (at the horizon), -85 to look down and +85 to towards the zenith.

Parameters:
pPitchInDegreesPitch angle, expressed in degrees.
virtual void VgEngine::VgICamera::setPosition ( const VgEngine::VgPosition pPosition ) [pure virtual]

Sets the camera's position.

Parameters:
pPositionThe position where the camera must be placed.
Note:
Since verion 2.0, the positions can now be expressed in various spatial reference systems. As a camera can only exist in "scene" coordinates, the provided position will be converted to the scene's spatial reference system. see VgEngine::VgPosition and VgEngine::VgSRS for more details.
Remarks:
In case the pPosition parameter is in the WGS84 spatial reference system, if the new position is not in the current dataset but is in the same UTM zone, the position remains unchanged. If the new position is in another UTM zone, the behaviour is undefined.
virtual void VgEngine::VgICamera::setViewpoint ( const VgIViewPoint pViewpoint ) [pure virtual]

Sets the camera viewpoint.

Parameters:
pViewpointThe viewpoint to set.
Note:
The same note on positions as in VgEngine::VgICamera::setPosition applies here.

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