version 3.3

VRS::ZoomGroundPlateNavigation Class Reference

The ZoomGroundPlateNavigation allows to move the camera rapidly towards or away from a given focus point. More...

#include <vrs/sg/zoomgroundplatenavigation.h>

Inheritance diagram for VRS::ZoomGroundPlateNavigation:

VRS::GroundPlateNavigation VRS::InteractionTechnique VRS::SharedObj VRS::Visitable VRS::ZoomOrthoGroundPlateNavigation

List of all members.

Public Member Functions

 ZoomGroundPlateNavigation (double yValOfGroundPlate=0.0)
void setWheelZoomFactor (double factor=0.8)
 Each time the wheel is rolled one unit up, the distance to the focus point is multiplied with the wheel zoom factor.
double getWheelZoomFactor () const
 Returns the wheel zoom factor.
void setDragZoomFactor (double factor=0.5)
 When zooming by dragging, 100 pixels up-dragging is translated into a multiplication of the distance with the drag zoom factor.
double getDragZoomFactor () const
 Returns the drag zoom factor.
void setMinDistance (double distance=0.001)
 Sets the minimum allowed distance from the focus point. 'distance' must be positive.
double getMinDistance () const
 Returns the minimum distance.
void setMaxDistance (double distance=0.0)
 Sets a maximum allowed distance.
double getMaxDistance () const
 Returns the maximum allowed distance.
virtual void onDragMotion (int x, int y, SO< MotionEvent >, MouseButtonFunctionID id, int startX, int startY)
virtual void onDragEnd (int x, int y, SO< ButtonEvent >, MouseButtonFunctionID id, int startX, int startY)
virtual void onWheelEvent (SO< WheelEvent > we)
 Performs zoom due to wheel events.
 VRS_TYPEINFO (ZoomGroundPlateNavigation, GroundPlateNavigation)

Static Public Attributes

static const MouseButtonFunctionID Zoom

Protected Member Functions

virtual void zoom (double factor, SO< Canvas > canvas)
bool updateFocus (const Vector &from, const Vector &to, SO< Canvas > canvas, Vector &newFocus)
void updateFocus (SO< Canvas > canvas)

Protected Attributes

bool focusValid_
Vector lastFocus_
double wheelZoomFactor_
double dragZoomFactor_
double minDistance_
double maxDistance_

Static Protected Attributes

static const double EPSILON


Detailed Description

The ZoomGroundPlateNavigation allows to move the camera rapidly towards or away from a given focus point.

The zoom can be performed by mouse dragging or mouse wheel.


Constructor & Destructor Documentation

VRS::ZoomGroundPlateNavigation::ZoomGroundPlateNavigation ( double  yValOfGroundPlate = 0.0  ) 


Member Function Documentation

void VRS::ZoomGroundPlateNavigation::setWheelZoomFactor ( double  factor = 0.8  ) 

Each time the wheel is rolled one unit up, the distance to the focus point is multiplied with the wheel zoom factor.

Similarly, the distance is divided by the factor, when the wheel is rolled back. 'factor' must be value in ]0,1[.

double VRS::ZoomGroundPlateNavigation::getWheelZoomFactor (  )  const

Returns the wheel zoom factor.

void VRS::ZoomGroundPlateNavigation::setDragZoomFactor ( double  factor = 0.5  ) 

When zooming by dragging, 100 pixels up-dragging is translated into a multiplication of the distance with the drag zoom factor.

double VRS::ZoomGroundPlateNavigation::getDragZoomFactor (  )  const

Returns the drag zoom factor.

void VRS::ZoomGroundPlateNavigation::setMinDistance ( double  distance = 0.001  ) 

Sets the minimum allowed distance from the focus point. 'distance' must be positive.

double VRS::ZoomGroundPlateNavigation::getMinDistance (  )  const

Returns the minimum distance.

void VRS::ZoomGroundPlateNavigation::setMaxDistance ( double  distance = 0.0  ) 

Sets a maximum allowed distance.

If 'distance' is invalid (i.e. smaller than minDistance), the upper distance limit is disabled.

double VRS::ZoomGroundPlateNavigation::getMaxDistance (  )  const

Returns the maximum allowed distance.

virtual void VRS::ZoomGroundPlateNavigation::onDragMotion ( int  x,
int  y,
SO< MotionEvent ,
MouseButtonFunctionID  id,
int  startX,
int  startY 
) [virtual]

virtual void VRS::ZoomGroundPlateNavigation::onDragEnd ( int  x,
int  y,
SO< ButtonEvent ,
MouseButtonFunctionID  id,
int  startX,
int  startY 
) [virtual]

virtual void VRS::ZoomGroundPlateNavigation::onWheelEvent ( SO< WheelEvent we  )  [virtual]

Performs zoom due to wheel events.

Reimplemented from VRS::InteractionTechnique.

VRS::ZoomGroundPlateNavigation::VRS_TYPEINFO ( ZoomGroundPlateNavigation  ,
GroundPlateNavigation   
)

virtual void VRS::ZoomGroundPlateNavigation::zoom ( double  factor,
SO< Canvas canvas 
) [protected, virtual]

bool VRS::ZoomGroundPlateNavigation::updateFocus ( const Vector from,
const Vector to,
SO< Canvas canvas,
Vector newFocus 
) [protected]

void VRS::ZoomGroundPlateNavigation::updateFocus ( SO< Canvas canvas  )  [protected]


Member Data Documentation

const double VRS::ZoomGroundPlateNavigation::EPSILON [static, protected]


The documentation for this class was generated from the following file:

Generated on Wed May 22 06:00:34 2013 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact