CIvfMouseViewHandler Class Reference

#include <ivfwidget/IvfMouseViewHandler.h>

Inheritance diagram for CIvfMouseViewHandler:

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

Public Types

enum  TKeyHandling { KH_NORMAL, KH_MIDDLE_BUTTON }

Public Member Functions

 CIvfMouseViewHandler (CIvfWidgetBase *widget, CIvfCamera *camera)
virtual ~CIvfMouseViewHandler ()
 IvfClassInfo ("CIvfMouseViewHandler", CIvfBase)
void setPanScalefactor (double factor)
double getPanScalefactor ()
void setZoomScalefactor (double factor)
double getZoomScalefactor ()
void setAutoScale (bool flag)
bool getAutoScale ()
void setAutoScaleBias (double bias)
double getAutoScaleBias ()
void setKeyHandling (TKeyHandling keyHandling)
TKeyHandling getKeyHandling ()
virtual void doResize (int width, int height)
virtual void doMouseDown (int x, int y)
virtual void doMouseMove (int x, int y)
virtual void doMouseUp (int x, int y)
virtual void onMouseDown (int x, int y)
virtual void onMouseMove (int x, int y)
virtual void onMouseUp (int x, int y)
virtual void onResize (int width, int height)

Detailed Description

Mouse view handler

This class implements basic mouse view handling. Default mode is view rotation using the left mouse button. Panning is done using the left mouse button Zooming is done using the right mouse button and the [Shift] key.

Examples:

handlers.cpp, and manip.cpp.

Definition at line 45 of file IvfMouseViewHandler.h.


Constructor & Destructor Documentation

CIvfMouseViewHandler::CIvfMouseViewHandler CIvfWidgetBase widget,
CIvfCamera camera
 

Class constructor

Parameters:
widget reference to CIvfWidgetBase class.
camera reference to a CIvfCamera to be manipulated.

virtual CIvfMouseViewHandler::~CIvfMouseViewHandler  )  [virtual]
 

Class destructor


Member Function Documentation

bool CIvfMouseViewHandler::getAutoScale  ) 
 

Return auto scale state

double CIvfMouseViewHandler::getAutoScaleBias  ) 
 

Return auto scale bias factor

TKeyHandling CIvfMouseViewHandler::getKeyHandling  ) 
 

Return key handling mode

double CIvfMouseViewHandler::getPanScalefactor  ) 
 

Return panning scale factor

double CIvfMouseViewHandler::getZoomScalefactor  ) 
 

Return zoom scale factor

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

onMouseUp method

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

Reimplemented from CIvfMouseDownEvent.

virtual void CIvfMouseViewHandler::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 CIvfMouseViewHandler::onMouseUp int  x,
int  y
[virtual]
 

onMouseMove method

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

Reimplemented from CIvfMouseUpEvent.

virtual void CIvfMouseViewHandler::onResize int  width,
int  height
[virtual]
 

onResize method

The onResize method occurs when the widget has changed size. Typically code for initialising the viewport and perspective transformation goes here.

Reimplemented from CIvfResizeEvent.

void CIvfMouseViewHandler::setAutoScale bool  flag  ) 
 

Enable/disable auto scaling

The different scale factor are calculated as follows:

pan_scale_factor = auto_scale_bias*eye_target_distance/screen_width; zoom_scale_factor = auto_scale_bias*eye_target_distance/screen_width; rotate_factor = 4.0/screen_width;

void CIvfMouseViewHandler::setAutoScaleBias double  bias  ) 
 

Set autoscale bias factor

A factor to modify the calculated autoscale.

void CIvfMouseViewHandler::setKeyHandling TKeyHandling  keyHandling  ) 
 

Set type of key handling.

Parameters:
keyHandling Default set to CIvfMouseViewHandler::KH_NORMAL. this mode uses left/right buttons and the [Shift] key. CIvfMouseViewHandler::KH_MIDDLE_BUTTON uses the middle button (wheel) to handle zooming

void CIvfMouseViewHandler::setPanScalefactor double  factor  ) 
 

Set panning scale factor

Panning is calculated by:

View movement X = mouse_delta_x * factor View movement Y = mouse_delta_y * factor

void CIvfMouseViewHandler::setZoomScalefactor double  factor  ) 
 

Set zoom scale factor

Zoom is calculated by:

Forward/backward movement = mouse_delta * factor


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