H3D::MouseSensor Class Reference
[H3D specific Node classes.]

A sensor node for reading mouse values. More...

#include <MouseSensor.h>

Inheritance diagram for H3D::MouseSensor:

Inheritance graph
List of all members.

Public Member Functions

 MouseSensor (Inst< SFBool > _enabled=0, Inst< SFNode > _metadata=0, Inst< SFBool > _isActive=0, Inst< SFVec2f > _position=0, Inst< SFBool > _leftButton=0, Inst< SFBool > _middleButton=0, Inst< SFBool > _rightButton=0, Inst< SFVec2f > _motion=0, Inst< SFBool > _scrollUp=0, Inst< SFBool > _scrollDown=0)
 Constructor.
virtual ~MouseSensor ()
 Destructor.
void addGLUTMouseMotionAction (int x, int y)
 Will be called when the mouse has moved.
virtual void addGLUTMouseButtonAction (int button, int state)
 Will be called when a mouse button event occurs.
virtual void addGLUTMouseWheelAction (int wheel, int direction)
 Will be called when a mouse scroll wheel event occurs.

Static Public Member Functions

static void glutMouseCallback (int button, int state, int x, int y)
 glut callback function.
static void glutMotionCallback (int x, int y)
 glut callback function.
static void glutMouseWheelCallback (int wheel, int direction, int x, int y)
 glut callback function for mouse scroll wheel.

Public Attributes

auto_ptr< SFVec2fposition
 The position of the mouse in window relative coordinates.
auto_ptr< SFBoolleftButton
 The status of the left button.
auto_ptr< SFBoolmiddleButton
 The status of the middle button.
auto_ptr< SFBoolrightButton
 The status of the right button.
auto_ptr< SFVec2fmotion
 The relative motion since in the last change of the position field.
auto_ptr< SFBoolscrollUp
 The scrollUp field generates a TRUE event when the mouse scroll wheel is moved up.
auto_ptr< SFBoolscrollDown
 The scrollDown field generates a TRUE event when the mouse scroll wheel is moved down.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.

Detailed Description

A sensor node for reading mouse values.

The scrollUp and scrollDown fields will only be usable if you are compiling against freeglut instead of GLUT.


Member Function Documentation

void MouseSensor::addGLUTMouseButtonAction int  button,
int  state
[virtual]
 

Will be called when a mouse button event occurs.

Parameters:
button is one of GLUT_LEFT_BUTTON, GLUT_MIDDLE_BUTTON, or GLUT_RIGHT_BUTTON.
state is either GLUT_UP or GLUT_DOWN indicating whether the callback was due to a release or press respectively.

void MouseSensor::addGLUTMouseMotionAction int  x,
int  y
 

Will be called when the mouse has moved.

The x and y parameters indicate the mouse location in window relative coordinates.

void MouseSensor::glutMotionCallback int  x,
int  y
[static]
 

glut callback function.

Calls addGLUTMouseMotionAction() on all MouseSensor instances.

void MouseSensor::glutMouseCallback int  button,
int  state,
int  x,
int  y
[static]
 

glut callback function.

Calls addGLUTMouseButtonAction() on all MouseSensor instances.


Member Data Documentation

auto_ptr< SFBool> H3D::MouseSensor::leftButton
 

The status of the left button.

TRUE indicates that it is pressed.

Access type: outputOnly

auto_ptr< SFBool> H3D::MouseSensor::middleButton
 

The status of the middle button.

TRUE indicates that it is pressed.

Access type: outputOnly

auto_ptr< SFVec2f> H3D::MouseSensor::motion
 

The relative motion since in the last change of the position field.

Access type: outputOnly

auto_ptr< SFVec2f> H3D::MouseSensor::position
 

The position of the mouse in window relative coordinates.

Access type: outputOnly

auto_ptr< SFBool> H3D::MouseSensor::rightButton
 

The status of the right button.

TRUE indicates that it is pressed.

Access type: outputOnly

auto_ptr< SFBool > H3D::MouseSensor::scrollDown
 

The scrollDown field generates a TRUE event when the mouse scroll wheel is moved down.

Access type: outputOnly

auto_ptr< SFBool > H3D::MouseSensor::scrollUp
 

The scrollUp field generates a TRUE event when the mouse scroll wheel is moved up.

Access type: outputOnly


Generated on Thu Aug 24 12:39:41 2006 for H3D API by  doxygen 1.4.5