version 3.3

VRS::Navigation Class Reference

#include <vrs/sg/navigation.h>

Inheritance diagram for VRS::Navigation:

VRS::Manipulator VRS::Interaction VRS::LeafBehavior VRS::BehaviorNode VRS::SharedObj VRS::Visitable VRS::ApproachNavigation VRS::GameNavigation VRS::JumpNavigation VRS::PathNavigation VRS::PhysicalNavigation VRS::PlaneNavigation VRS::FlyerPhysicalNavigation VRS::UfoPhysicalNavigation

List of all members.

Public Types

enum  NavMode {
  Sphere, Cone, Zoom, Flyer,
  SmoothFlyer, ZoomTurn, ZoomShift, Pan,
  ElevateLookFixed, LookAround, MoveFocus, WheelZoom,
  Approach, Game, Jump, Plane,
  SmoothGlider, Ufo
}

Public Member Functions

 VRS_SERIALIZABLE_CLASS_ENUM (NavMode)
 Defines the navigation metaphor currently used for transformation between mouse and camera motions.
virtual void setNavMode (NavMode mode)
 Change the currently used navigation metaphor.
NavMode getNavMode () const
 Get the currently used navigation metaphor.
void clearActiveNavigation ()
void setLookAt (LookAt *)
 Assign a new LookAt object.
LookAtgetLookAt () const
 Get a pointer to currently assigned LookAt object.
VRS::Vector getFocus () const
 Returns the current focus point.
virtual
BehaviorNode::InvalidationHint 
handle (Event *)
virtual
BehaviorNode::InvalidationHint 
dragStart (int x, int y, ButtonEvent *)
virtual
BehaviorNode::InvalidationHint 
dragMotion (int x, int y, MotionEvent *)
virtual
BehaviorNode::InvalidationHint 
dragEnd (int x, int y, ButtonEvent *)
virtual void storeCamera (const std::string &name)
virtual void activateCamera (const std::string &name)
virtual void removeCamera (const std::string &name)
virtual void clearCameras ()
virtual VRS::Iterator
< std::string > * 
cameraNames () const
virtual void setConstraintChecker (ConstraintChecker *checker)
virtual ConstraintCheckergetConstraintChecker () const
 VRS_TYPEINFO (Navigation, Manipulator)
 VRS_SERIALIZABLE (Navigation)

Static Public Member Functions

static SO< FilterTaggetIgnoreFilterTag ()
static SO< NavigationactiveNavigation ()
static void setActiveNavigation (SO< Navigation > navigation)

Protected Member Functions

CameraMementofindCamera (const std::string &name)
void addCamera (const std::string &name, CameraMemento *cm)
void addCamera (const std::string &name, LookAt *lookAt)
 Navigation (LookAt *lookAt=NULL, InputEvent::Button button=InputEvent::MouseButton1, InputEvent::Modifier must_modifier=InputEvent::NoModifier, InputEvent::Modifier must_not_modifier=InputEvent::NoModifier, Callback *startCallback=NULL, Callback *motionCallback=NULL, Callback *endCallback=NULL)

Static Protected Member Functions

static SO< FiltergetIgnoreFilter ()

Static Protected Attributes

static SO< NavigationactiveNavigation_


Detailed Description

Abstract base class for navigation metaphors. It serves to prevent conflicts when several navigations share a single LookAt object. On each time event only one navigation object should control the LookAt. This navigation object is specified by activeNavigation. If a navigation receives a user interaction (e.g. key press or mouse move) this object takes control of the shared LookAt object for the ensuing time events by setting activeNavigation to itself. When implementing an own Navigation please note: To prevent conflicts with other navigations it should only change the LookAt at a time event if it is the active navigation.

Member Enumeration Documentation

Enumerator:
Sphere 
Cone 
Zoom 
Flyer 
SmoothFlyer 
ZoomTurn 
ZoomShift 
Pan 
ElevateLookFixed 
LookAround 
MoveFocus 
WheelZoom 
Approach 
Game 
Jump 
Plane 
SmoothGlider 
Ufo 


Constructor & Destructor Documentation

VRS::Navigation::Navigation ( LookAt lookAt = NULL,
InputEvent::Button  button = InputEvent::MouseButton1,
InputEvent::Modifier  must_modifier = InputEvent::NoModifier,
InputEvent::Modifier  must_not_modifier = InputEvent::NoModifier,
Callback startCallback = NULL,
Callback motionCallback = NULL,
Callback endCallback = NULL 
) [protected]


Member Function Documentation

VRS::Navigation::VRS_SERIALIZABLE_CLASS_ENUM ( NavMode   ) 

Defines the navigation metaphor currently used for transformation between mouse and camera motions.

Sphere - The camera is moved on the surface of a sphere centered around the focus, x-coordinate motions affect the longitude, y-coordinate motions affect latitude position of the camera. Cone - The camera can be moved on the mantle of a cone with the focus as the cone's top and the cone being axis parallel to the y-axis (0,1,0). y-coordinate motions affect the distance from focus, x-coordinate motions rotate the camera around an axis through the focus, parallel to (0,1,0). Flyer - The camera flies forward alongside the viewing direction while the mouse button is pressed with y-coordinate motions causing the virtual plane to lift/descend and x-coordinate motions change directions. ZoomTurn - y-coordinate motions move the camera forward and backwards, x-coordinate motions rotate the camera around an axis through the current position, parallel through (0,1,0). ZoomShift - y-coordinate motions move the camera forward and backwards, x-coordinate motions shift the camera around the terrain, both preserving the original direction of view. Pan - x- and y-coordinate mouse motions with buttons pressed cause a corresponding shift of the camera position to the left/right and up/down, leaving the original direction of view unchanged. ElevateLookFixed - allows to shift camera position left/right and up/down through corresponding x/y-coordinate mouse motions while preserving the original focus. LookAround - preserves the current camera position while shifting the camera view direction left/right and up/down by corresponding x/y-coordinate mouse motions. MoveFocus - allows to set the focus to any point in the scene by clicking on it using the mouse. WheelZoom - zooms in and out when the mouse wheel is activated (NOTE: use an arbitrary mouse button for this mode!).

virtual void VRS::Navigation::setNavMode ( NavMode  mode  )  [virtual]

Change the currently used navigation metaphor.

Reimplemented in VRS::ApproachNavigation, VRS::JumpNavigation, and VRS::PlaneNavigation.

Navigation::NavMode VRS::Navigation::getNavMode (  )  const [inline]

Get the currently used navigation metaphor.

Button motions can be used to change the look-to point, look-from point or the distance between look-to and look-from points. Navigation metaphors describe how this transformation is carried out. The currently used navigation metaphor, as element of the locally held NavMode enumeration, can be set and retrieved using this set of methods.

void VRS::Navigation::clearActiveNavigation (  ) 

void VRS::Navigation::setLookAt ( LookAt  ) 

Assign a new LookAt object.

LookAt* VRS::Navigation::getLookAt (  )  const

Get a pointer to currently assigned LookAt object.

VRS::Vector VRS::Navigation::getFocus (  )  const

Returns the current focus point.

virtual BehaviorNode::InvalidationHint VRS::Navigation::handle ( Event  )  [virtual]

An interaction process can receive and propagate canvas events. Other events are ignored. According to the conditions, `handle' triggers the start, process, end, and abort methods.

Reimplemented from VRS::Interaction.

Reimplemented in VRS::ApproachNavigation, VRS::GameNavigation, VRS::JumpNavigation, VRS::PathNavigation, VRS::PhysicalNavigation, VRS::PlaneNavigation, and VRS::UfoPhysicalNavigation.

virtual BehaviorNode::InvalidationHint VRS::Navigation::dragStart ( int  x,
int  y,
ButtonEvent  
) [virtual]

virtual BehaviorNode::InvalidationHint VRS::Navigation::dragMotion ( int  x,
int  y,
MotionEvent  
) [virtual]

virtual BehaviorNode::InvalidationHint VRS::Navigation::dragEnd ( int  x,
int  y,
ButtonEvent e 
) [virtual]

These methods implements the concrete manipulator functionality. They are overloaded by subclasses. `dragStart' is called if an event of type `ButtonEvent` is received which matches the button condition. `dragMotion' is called if the interaction has been started already and an `MotionEvent' has been received which matches the modifier conditions. `dragEnd' is called if the interaction has been started already and an event of type `ButtonEvent' has been received which matches the button condition. The return value specifies the redrawing code required by `handle'. (It specifies if the world, a canvas or nothing has to be redrawn).

Implements VRS::Manipulator.

Reimplemented in VRS::ApproachNavigation, VRS::GameNavigation, VRS::PhysicalNavigation, and VRS::PlaneNavigation.

virtual void VRS::Navigation::storeCamera ( const std::string &  name  )  [virtual]

virtual void VRS::Navigation::activateCamera ( const std::string &  name  )  [virtual]

virtual void VRS::Navigation::removeCamera ( const std::string &  name  )  [virtual]

virtual void VRS::Navigation::clearCameras (  )  [virtual]

virtual VRS::Iterator<std::string>* VRS::Navigation::cameraNames (  )  const [virtual]

virtual void VRS::Navigation::setConstraintChecker ( ConstraintChecker checker  )  [virtual]

virtual ConstraintChecker* VRS::Navigation::getConstraintChecker (  )  const [virtual]

static SO<FilterTag> VRS::Navigation::getIgnoreFilterTag (  )  [static]

static SO<Navigation> VRS::Navigation::activeNavigation (  )  [static]

static void VRS::Navigation::setActiveNavigation ( SO< Navigation navigation  )  [static]

VRS::Navigation::VRS_TYPEINFO ( Navigation  ,
Manipulator   
)

VRS::Navigation::VRS_SERIALIZABLE ( Navigation   ) 

static SO<Filter> VRS::Navigation::getIgnoreFilter (  )  [static, protected]

CameraMemento* VRS::Navigation::findCamera ( const std::string &  name  )  [protected]

void VRS::Navigation::addCamera ( const std::string &  name,
CameraMemento cm 
) [protected]

void VRS::Navigation::addCamera ( const std::string &  name,
LookAt lookAt 
) [protected]


Member Data Documentation


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

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