A halo highlight style. More...
#include <Inventor/actions/SoHaloHighlightRenderAction.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
SoHaloHighlightRenderAction () | |
SoHaloHighlightRenderAction (const SbViewportRegion &viewportRegion) | |
virtual | ~SoHaloHighlightRenderAction () |
void | setHaloColor (const SbColor &color) |
const SbColor & | getHaloColor () const |
void | setHaloWidth (int width) |
int | getHaloWidth () const |
void | setHaloAlwaysVisible (bool alwaysVisible) |
bool | isHaloAlwaysVisible () const |
void | setHaloSmoothFactor (float smoothFactor) |
float | getHaloSmoothFactor () const |
Static Public Member Functions | |
static SoType | getClassTypeId () |
static void | initClass () |
static void | exitClass () |
A halo highlight style.
SoHaloHighlightRenderAction is a render action which renders the specified scene graph, then renders a "halo" highlight around each selected object. See the images below for examples of this highlight technique. Halo highlighting works with all kinds of shapes including VolumeViz and MeshVizXLM. However, if a selected object does not write to the depth buffer for any reason, it will not be highlighted.
Selected objects are specified by the first selection node (SoSelection or SoExtSelection) node in the scene to which this action is applied. If there is no selection node in the scene graph, then no objects will be highlighted.
The application must explicitly tell Open Inventor to use a highlight render action in place of the default SoGLRenderAction in the SoSceneManager class using the setGLRenderAction() method. The viewer classes provide a convenience setGLRenderAction() method that calls SoSceneManager (see e.g. SoWinRenderArea).
For convenience, the viewer classes also provide the redrawOnSelectionChange() method. This method attaches a sensor to the specified selection node and automatically schedules a redraw if the set of selected objects is modified.
Here is an example of an SoAlgebraicCone highlighted with an SoHaloHighlightRenderAction:
Here are parameters that can be adjusted:
NOTES
2 selected objects are highlighted as one |
|
// Scene graph SoSelection* selectionNode = new SoSelection(); . . . // Viewer SoWinExaminerViewer* viewer = new SoWinExaminerViewer(); viewer->setSceneGraph( selectionNode ); // Set the highlight render action viewer->setGLRenderAction( new SoHaloHighlightRenderAction() ); // Request automatic redraw when selection changes viewer->redrawOnSelectionChange( selectionNode );
SoLineHighlightRenderAction, SoColorHighlightRenderAction, SoBoxHighlightRenderAction, SoHighlightRenderAction, SoGLRenderAction, SoSelection, SoWinRenderArea
SoHaloHighlightRenderAction::SoHaloHighlightRenderAction | ( | ) |
SoHaloHighlightRenderAction::SoHaloHighlightRenderAction | ( | const SbViewportRegion & | viewportRegion | ) |
virtual SoHaloHighlightRenderAction::~SoHaloHighlightRenderAction | ( | ) | [virtual] |
static void SoHaloHighlightRenderAction::exitClass | ( | ) | [static] |
Reimplemented from SoHighlightRenderAction.
static SoType SoHaloHighlightRenderAction::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoHighlightRenderAction.
const SbColor& SoHaloHighlightRenderAction::getHaloColor | ( | ) | const |
See setHaloColor().
float SoHaloHighlightRenderAction::getHaloSmoothFactor | ( | ) | const |
int SoHaloHighlightRenderAction::getHaloWidth | ( | ) | const |
See setHaloWidth().
virtual SoType SoHaloHighlightRenderAction::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoHighlightRenderAction.
static void SoHaloHighlightRenderAction::initClass | ( | ) | [static] |
Reimplemented from SoHighlightRenderAction.
bool SoHaloHighlightRenderAction::isHaloAlwaysVisible | ( | ) | const |
void SoHaloHighlightRenderAction::setHaloAlwaysVisible | ( | bool | alwaysVisible | ) |
Defines whether or not the halo can be seen through objects that are placed in front of selected shapes.
Default is FALSE.
The following images shows an example of halo highlighting with alwaysVisible set to FALSE and TRUE:
alwaysVisible = FALSE | alwaysVisible = TRUE |
| |
void SoHaloHighlightRenderAction::setHaloColor | ( | const SbColor & | color | ) |
Defines the color of the highlight.
Default is red (1,0,0).
Here are examples of halo highlighting with different colors:
Red | Green | Blue |
| | |
void SoHaloHighlightRenderAction::setHaloSmoothFactor | ( | float | smoothFactor | ) |
Defines the amount of alpha attenuation of the halo contour.
Default is 0. The value will be clamped between 0 and 1.
The following images shows an example of halo highlighting with different values for the smooth factor:
smoothFactor = 0 | smoothFactor = 0.33 | smoothFactor = 0.66 | smoothFactor = 1 |
| | | |
void SoHaloHighlightRenderAction::setHaloWidth | ( | int | width | ) |
Defines the width of the halo in pixels.
Default is 3.
Only values greater or equal to 1 are accepted. If a value of 0 or lower is given, the effective value will be clamped to 1.
The following images shows an example of halo highlighting with different values for the halo width:
width = 1 | width = 3 | width = 7 | width = 15 |
| | | |