CIvfFlyHandler Class Reference

#include <ivfwidget/IvfFlyHandler.h>

Inheritance diagram for CIvfFlyHandler:

CIvfHandlerBase CIvfKeyboardEvent CIvfMouseUpEvent CIvfMouseMoveEvent CIvfMouseDownEvent CIvfBase CIvfRefCountBase CIvfRTTIBase List of all members.

Public Member Functions

 CIvfFlyHandler (CIvfWidgetBase *widget, CIvfCamera *camera)
 IvfClassInfo ("CIvfFlyHandler", CIvfHandlerBase)
void update ()
void setMouseSensitivity (double value)
double getMouseSensitivity ()
void setSpeedStep (double step)
double getSpeedStep ()
void setMaxSpeed (double speed)
double getMaxSpeed ()
void setRedraw (bool flag)
virtual void onKeyboard (int key, int x, int y)
virtual void onMouseUp (int x, int y)
virtual void onMouseDown (int x, int y)
virtual void onMouseMove (int x, int y)
void doKeyboard (int key, int x, int y)
void doMouseUp (int x, int y)
void doMouseMove (int x, int y)
void doMouseDown (int x, int y)

Protected Member Functions

virtual void doDeactivate ()
virtual void doActivate ()

Detailed Description

Fly view handler

This handler implements a fly navigation mode that can be used together with CIvfWidgetBase derived classes, such as CIvfFltkBase, CIvfWin32Window, CIvfMfcBase etc. The class take a reference to the active widget and a CIvfCamera derived class.

Controls:

w - Increase velocity
s - Decrease velocity
x - Sets velocity to zero.
q - Increase vertical velocity
a - Decrease vertical velocity

Examples:

handlers.cpp.

Definition at line 53 of file IvfFlyHandler.h.


Constructor & Destructor Documentation

CIvfFlyHandler::CIvfFlyHandler CIvfWidgetBase widget,
CIvfCamera camera
 

Class constructor

widget Reference to a CIvfWidgetBase class. In most cases this parameter can be set to this.

Parameters:
camera CIvfCamera derived class which will be modified.


Member Function Documentation

double CIvfFlyHandler::getMaxSpeed  ) 
 

Return max speed

double CIvfFlyHandler::getMouseSensitivity  ) 
 

Return mouse sensitivity

double CIvfFlyHandler::getSpeedStep  ) 
 

Return current speed step value

virtual void CIvfFlyHandler::onKeyboard int  key,
int  x,
int  y
[virtual]
 

onKeyboard method

The onKeyboard method is called when a key on the keyboard is pressed

Reimplemented from CIvfKeyboardEvent.

virtual void CIvfFlyHandler::onMouseDown int  x,
int  y
[virtual]
 

onMouseUp method

The onMouse method is called when the mouse button is released.

Reimplemented from CIvfMouseDownEvent.

virtual void CIvfFlyHandler::onMouseMove int  x,
int  y
[virtual]
 

onMouseMove method

The onMouseMove method is called whenever the mouse is moved in the window.

Reimplemented from CIvfMouseMoveEvent.

virtual void CIvfFlyHandler::onMouseUp int  x,
int  y
[virtual]
 

onMouseMove method

The onMouseMove method is called whenever the mouse is moved in the window.

Reimplemented from CIvfMouseUpEvent.

void CIvfFlyHandler::setMaxSpeed double  speed  ) 
 

Set maximum speed

void CIvfFlyHandler::setMouseSensitivity double  value  ) 
 

Set mouse sensistivity

The mouse sensitivity is used determine the turning/rotate speed when the mouse is moved: mouse_delta_x * sensitivity * dt mouse_delta_y * sensitivity * dt

void CIvfFlyHandler::setRedraw bool  flag  ) 
 

Set redraw handling

The fly handler can handle screen redrawing automatically (flag=true) Sometimes it can be effective to control redrawing manually (flag=false)

void CIvfFlyHandler::setSpeedStep double  step  ) 
 

Set speed step

The speed step value determines how much the speed increases or decreases when the user presses the forward/back button (W/S) to increase/decrease the forward velocity.

void CIvfFlyHandler::update  ) 
 

View update routine

The fly handler needs to be updated regularly. This routine updates the state variables and the camera depending on the elapsed time. Typically this routine should be called from a timer or an application loop.


The documentation for this class was generated from the following file:
Generated on Fri Sep 1 15:36:51 2006 for Interactive Visualisation Framework - Ivf++ by  doxygen 1.4.6-NO