Main Page   Namespace List   Alphabetical List   Data Structures   File List   Data Fields   Globals  

Mouse Class Reference


Public Methods

 Mouse ()
int pickObject (double x, double y, double delX, double delY)
int processHits (int hits, int buffer[])
vec3 getPointFromPick (const int x, const int y, int *viewport)
int getPickResult (void)
void mouseDblClick (int x, int y)
void mousePressed (int button, int x, int y)
void mouseReleased (int button, int x, int y)
void mouseMotion (int button, int x, int y)

Data Fields

vec2i sceneOwnRot
 (should be computed in camera)

int moveVolume
 index of the super volume selected NO_VOLUME_SELECTED if none

Cameracamera
 here to bind mouse movement to camera movement

int viewMode
 solid, wireframe, ...

vec3 pickPoint
 picking point in world coordinates


Private Attributes

vec2i vstart
 start position of a drag

int selectBuf [SELECT_BUFSIZE]
 selection buffer to store picking data


Detailed Description

The mouse class handles everything regarding to mouse events. Especially useful for picking and for dragging. The viewMode automatically goes to wireframe if a mouse button is pressed and goes back to previous viewMode when the button is released.


Constructor & Destructor Documentation

Mouse::Mouse  
 

Constructor, inits mouse properties


Member Function Documentation

int Mouse::getPickResult void   
 

2nd part of the picking operation as seen from exterior it returns the identity of the pick point

vec3 Mouse::getPointFromPick const int    x,
const int    y,
int *    viewport
 

Gives the world coordinates of the 3D point picked from the mouse coordinates of the picking point <x,y> in screen

void Mouse::mouseDblClick int    x,
int    y
 

Procedure called in case of double click event detected This is only the primary operation, the picking needs to be finalised by getPickResult

Parameters:
x:  1st coordinate of the picking point on the screen
y:  2nd coordinate of the picking point on the screen

void Mouse::mouseMotion int    button,
int    x,
int    y
 

Alters display during a mouse motion with button pressed (translation or rotation or object picking) called by the callback mouseMotion

void Mouse::mousePressed int    button,
int    x,
int    y
 

Mouse handling for button pressed

Parameters:
x,y  : current screen coordinates
button  : the button (left, right or middle)

void Mouse::mouseReleased int    button,
int    x,
int    y
 

Mouse handling for button released

Parameters:
x,y  : current screen coordinates
button  : the button (left, right or middle)

int Mouse::pickObject double    x,
double    y,
double    delX,
double    delY
 

Starts the picking, defining the area and selection buffer on the rectangle <x,y ; delx,dely> this method is described in a lot of tutorials on the web

See also:
www.opengl.org/developers/faqs/technical/selection.htm for a good presentation of the typical method

int Mouse::processHits int    hits,
int    buffer[]
 

Returns the name of the closest hit from the content of the selection array.

Returns:
index of the first object picked, if there is ambiguity the first found is taken, NO_VOLUME_SELECTED otherwise


Field Documentation

Camera* Mouse::camera
 

here to bind mouse movement to camera movement

int Mouse::moveVolume
 

index of the super volume selected NO_VOLUME_SELECTED if none

vec3 Mouse::pickPoint
 

picking point in world coordinates

vec2i Mouse::sceneOwnRot
 

(should be computed in camera)

int Mouse::selectBuf[SELECT_BUFSIZE] [private]
 

selection buffer to store picking data

int Mouse::viewMode
 

solid, wireframe, ...

vec2i Mouse::vstart [private]
 

start position of a drag


The documentation for this class was generated from the following files:
Generated on Wed Feb 18 16:32:54 2004 for POVAMA by doxygen1.2.18