Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

CrController Class Reference

Represents controller devices which generate events. More...

#include <CrController.h>

Inheritance diagram for CrController:

Subject CrHapticController CrWandController List of all members.

Public Member Functions

 CrController (const short &)
 Parameterized constructor takes sensor id.
virtual ~CrController ()
 Virtual destructor.
SoEvent * getEvent ()
 Get the CrController's current SoEvent.
void setEvent (SoEvent *)
 Sets the current SoEvent. (UNUSED?).
void setTool (CrTool *)
 Attaches a tool to which Events will be sent.

Protected Member Functions

virtual void updateController ()
 Checks the device state and updates the CrController's data.

Protected Attributes

SoEvent * m_event
 Current event object for the device state.
SbVec3f m_position
 Current 3D controller position.
SbRotation m_rotation
 Current 3D controller orientation stored as a quaternion.
short m_sensorID
 Identifies the sensor.
CrToolm_tool
 Tool currently attached to the controller.

Detailed Description

Represents controller devices which generate events.

Author:
Chris Scharver
Date
2004/03/11 00:35:29
Revision
1.11
The use of multiple control devices can significantly complicate interaction. The CAVELib provides a simple CAVEButtonChange() function, but it is easy to break. The Open Inventor scene graph is based on event-driver interaction. CrController is an abstract class that represents a control device. Concrete implementations must access device state information and generate the appropriate SoEvent objects. These events are passed as objects for handling within the rest of the application.

This implementation uses the Observer Pattern to notify observers that an event has taken place. Any observers must then get the controller's event and respond accordingly. A constroller may have a single CrTool object registered for directly receiving events. If multiple objects need to observe the controller, then a new observer may be needed.

See also:
CrControllerObserver, CrTool, Observer


Constructor & Destructor Documentation

CrController::CrController const short &   ) 
 

Parameterized constructor takes sensor id.

CrController::~CrController  )  [virtual]
 

Virtual destructor.


Member Function Documentation

SoEvent* CrController::getEvent  )  [inline]
 

Get the CrController's current SoEvent.

void CrController::setEvent SoEvent *   ) 
 

Sets the current SoEvent. (UNUSED?).

void CrController::setTool CrTool  ) 
 

Attaches a tool to which Events will be sent.

virtual void CrController::updateController  )  [inline, protected, virtual]
 

Checks the device state and updates the CrController's data.

Reimplemented in CrHapticController, and CrWandController.


Member Data Documentation

SoEvent* CrController::m_event [protected]
 

Current event object for the device state.

SbVec3f CrController::m_position [protected]
 

Current 3D controller position.

SbRotation CrController::m_rotation [protected]
 

Current 3D controller orientation stored as a quaternion.

short CrController::m_sensorID [protected]
 

Identifies the sensor.

CrTool* CrController::m_tool [protected]
 

Tool currently attached to the controller.


The documentation for this class was generated from the following files:
Generated on Wed May 18 01:24:58 2005 for SculptDemo by  doxygen 1.4.3