Open Inventor Reference
SoLocateHighlight Class Reference

Special separator that performs locate highlighting. More...

#include <Inventor/nodes/SoLocateHighlight.h>

Inheritance diagram for SoLocateHighlight:
SoSeparator SoGroup SoNode SoFieldContainer SoBase SoWWWAnchor

List of all members.

Public Types

enum  Styles { EMISSIVE, EMISSIVE_DIFFUSE }
 Possible values for draw style. More...
enum  Modes { AUTO, ON, OFF }
 Possible values for the mode. More...

Public Member Functions

 SoLocateHighlight ()
 Creates a LocateHighlight node with default settings.
virtual void handleEvent (SoHandleEventAction *action)
 Override handleEvent to look for mouse motion, to do a pick and highlight if mouse is over us.
virtual void GLRenderBelowPath (SoGLRenderAction *action)
 These methods make render traversal faster by implementing different rendering paths corresponding to different action path codes.
virtual void GLRenderInPath (SoGLRenderAction *action)

Static Public Member Functions

static void initClass ()
 initialize the class
static void turnOffCurrentHighlight (SoGLRenderAction *action)
 This will de-highlight the currently highlighted node if any.

Public Attributes

Fields
SoSFColor color
 Highlighting color - default [.3, .3, .3].
SoSFEnum style
 Highlighting draw style - default EMISSIVE.
SoSFEnum mode
 Whether to highlight or not - default AUTO.

Protected Member Functions

virtual ~SoLocateHighlight ()
virtual void redrawHighlighted (SoAction *act, SbBool flag)
 This is called when this nodes needs to highlight or de-highlight.

Detailed Description

This is a subclass of SoSeparator that redraws itself in a different color when the cursor is over the contents of the separator.

The redraw happens for that separator only and not the entire window (redraw along the handle event pick path) and in the front buffer, to efficiently track the mouse motion. The highlighted redraw overrides the emissive and/or diffuse color of the subgraph based on the field values in this node.

NOTE: when using SoLightModel::BASE_COLOR (to turn lighting off) only the diffuse color will be used to render objects, so EMISSIVE_DIFFUSE must be used for this node to have any effect.

File Format/Default
LocateHighlight {
  renderCaching AUTO
  boundingBoxCaching AUTO
  renderCulling AUTO
  pickCulling AUTO
  mode AUTO
  style EMISSIVE
  color 0.300000011920929 0.300000011920929 0.300000011920929
}
Action Behavior
SoHandleEventAction
Checks to see if the cursor moves onto or off of the contents of the separator, and redraws appropriately (if mode is AUTO), otherwise traverses as a normal separator.
SoGLRenderAction
Redraws either highlighted (if cursor is over the contents of the separator when mode == AUTO or always if mode == ON), otherwise traverses as a normal separator.
See Also
SoSeparator, SoSelection, SoMaterial

Definition at line 126 of file SoLocateHighlight.h.


Member Enumeration Documentation

Enumerator:
AUTO 

highlight when mouse is over (default)

ON 

always highlight

OFF 

never highlight

Definition at line 139 of file SoLocateHighlight.h.

Enumerator:
EMISSIVE 

changes emissive color only (default)

EMISSIVE_DIFFUSE 

changes emissive and diffuse colors

Definition at line 133 of file SoLocateHighlight.h.


Constructor & Destructor Documentation

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

Member Function Documentation

virtual void SoLocateHighlight::GLRenderBelowPath ( SoGLRenderAction action) [virtual]

Reimplemented from SoSeparator.

virtual void SoLocateHighlight::GLRenderInPath ( SoGLRenderAction action) [virtual]

Reimplemented from SoSeparator.

virtual void SoLocateHighlight::handleEvent ( SoHandleEventAction action) [virtual]

The GLRender methods are redefined to draw highlighted if needed.

Reimplemented from SoSeparator.

Reimplemented in SoWWWAnchor.

static void SoLocateHighlight::initClass ( ) [static]

Reimplemented from SoSeparator.

Reimplemented in SoWWWAnchor.

virtual void SoLocateHighlight::redrawHighlighted ( SoAction act,
SbBool  flag 
) [protected, virtual]

It can be used by subclasses to be told when the status change.

Reimplemented in SoWWWAnchor.

static void SoLocateHighlight::turnOffCurrentHighlight ( SoGLRenderAction action) [static]

this should be called when the cursor leaves a window or a mode changes happen which would prevent a highlighted node from receiving more mouse motion events. The GL render action used to render into that window needs to be passed to correctly un-highlight.


Member Data Documentation


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