MeVisLabToolboxReference
SoFocus Class Reference

SoFocus is a general facility to detect focus changes. More...

#include <SoFocus.h>

List of all members.

Public Member Functions

 SoFocus ()
 Constructor.
virtual void handleEvent (SoHandleEventAction *action)
 handle event is reimplemented to handle the mouse events.
void setFocusState (FocusState state, bool updateField=true)
 Set focus state for this module.

Static Public Member Functions

static void initClass ()
 Initializes this class (called on dll initialization).

Public Attributes

SoSFBool active
 Should this module change the focus state?
SoSFBool hasFocus
 Current state (has focus or has no focus).
SoSFBool supportWheelEvents
 Should this module support mouse wheel events?
SoSFVec2f normClickCoords
 Display the normalized coordinates of the click event that caused the focus state.

Protected Member Functions

virtual ~SoFocus ()
 Protected destructor.
void nodeChanged (SoNodeSensor *sensor)
 Called by the static function _nodeChangedCB to notify node changes.
virtual void GLRender (SoGLRenderAction *action)
 React to render action -> pass focus to state.

Static Protected Member Functions

static void nodeChangedCB (void *data, SoSensor *sens)
 Called by _nodeSensor when any field in node changes.

Protected Attributes

SoNodeSensor * _nodeSensor
 Sensor to detect changes in node's fields.

Detailed Description

SoFocus is a general facility to detect focus changes.

The information, if a sub graph has the focus, is passed to the inventor state.

Definition at line 36 of file SoFocus.h.


Constructor & Destructor Documentation

SoFocus::SoFocus ( )

Constructor.

virtual SoFocus::~SoFocus ( ) [protected, virtual]

Protected destructor.


Member Function Documentation

virtual void SoFocus::GLRender ( SoGLRenderAction *  action) [protected, virtual]

React to render action -> pass focus to state.

virtual void SoFocus::handleEvent ( SoHandleEventAction *  action) [virtual]

handle event is reimplemented to handle the mouse events.

The events are not consumed, so that following modules in the scene graph can handle them.

static void SoFocus::initClass ( ) [static]

Initializes this class (called on dll initialization).

void SoFocus::nodeChanged ( SoNodeSensor *  sensor) [protected]

Called by the static function _nodeChangedCB to notify node changes.

static void SoFocus::nodeChangedCB ( void *  data,
SoSensor *  sens 
) [static, protected]

Called by _nodeSensor when any field in node changes.

Only redirects the call of this static function to the class method nodeChanged.

void SoFocus::setFocusState ( FocusState  state,
bool  updateField = true 
)

Set focus state for this module.

If updateField is true, the field "hasFocus" is updated.


Member Data Documentation

SoNodeSensor* SoFocus::_nodeSensor [protected]

Sensor to detect changes in node's fields.

Definition at line 80 of file SoFocus.h.

SoSFBool SoFocus::active

Should this module change the focus state?

Definition at line 51 of file SoFocus.h.

Current state (has focus or has no focus).

Definition at line 54 of file SoFocus.h.

Display the normalized coordinates of the click event that caused the focus state.

This is useful if one Viewer has several regions that should be activated separately. For example, if a SoView2d has more than 1 slice, SoView2DBorder is drawn several times. normClickCoords can be used to determine which border should be highlighted.

Definition at line 63 of file SoFocus.h.

Should this module support mouse wheel events?

Definition at line 57 of file SoFocus.h.


The documentation for this class was generated from the following file: