Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SoHaloHighlightRenderAction Class Reference

A halo highlight style. More...

#include <Inventor/actions/SoHaloHighlightRenderAction.h>

+ Inheritance diagram for SoHaloHighlightRenderAction:

Public Member Functions

virtual SoType getTypeId () const
 Returns the type identifier for this specific instance.
 
 SoHaloHighlightRenderAction ()
 
 SoHaloHighlightRenderAction (const SbViewportRegion &viewportRegion)
 
virtual ~SoHaloHighlightRenderAction ()
 
void setHaloColor (const SbColor &color)
 Defines the color of the highlight.
 
const SbColorgetHaloColor () const
 See setHaloColor()
 
void setHaloWidth (int width)
 Defines the width of the halo in pixels.
 
int getHaloWidth () const
 See setHaloWidth()
 
void setHaloAlwaysVisible (bool alwaysVisible)
 Defines whether or not the halo can be seen through objects that are placed in front of selected shapes.
 
bool isHaloAlwaysVisible () const
 See setHaloAlwaysVisible()
 
void setHaloSmoothFactor (float smoothFactor)
 Defines the amount of alpha attenuation of the halo contour.
 
float getHaloSmoothFactor () const
 See setHaloSmoothFactor()
 
- Public Member Functions inherited from SoHighlightRenderAction
virtual void clearApplyResult ()
 When applied, an action may reference nodes or create objects (e.g.
 
virtual void apply (SoNode *node)
 This renders the passed scene graph, and also renders highlighted selected objects as specified by the first SoSelection node found in the scene graph.
 
void setVisible (SbBool b)
 This provides a convenient mechanism for turning highlights off or on.
 
SbBool isVisible () const
 Returns whether highlights will be rendered or not.
 
- Public Member Functions inherited from SoGLRenderAction
 SoGLRenderAction (const SbViewportRegion &viewportRegion)
 Constructor.
 
void setViewportRegion (const SbViewportRegion &newRegion)
 Changes viewport region to use for rendering.
 
const SbViewportRegiongetViewportRegion () const
 Returns viewport region to use for rendering.
 
void setLogicalViewportRegion (const SbViewportRegion &newLogicalRegion)
 Sets current logical viewport region to use for rendering.
 
const SbViewportRegiongetLogicalViewportRegion () const
 Returns current logical viewport region.
 
void setUpdateArea (const SbVec2f &origin, const SbVec2f &size)
 Sets the current update area, which is the rectangular area of the viewport region that will actually be rendered into.
 
void getUpdateArea (SbVec2f &origin, SbVec2f &size) const
 Returns the current update area.
 
void setAbortCallback (SoGLRenderAbortCB *func, void *userData)
 Sets callback to call during rendering to test for an abort condition.
 
void setTransparencyType (TransparencyType type)
 Sets global transparency algorithm to use when rendering.
 
TransparencyType getTransparencyType () const
 Returns transparency quality level to use when rendering.
 
void setFastEditSavePolicy (FastEditSavePolicy policy, SbBool fastEditDelayedObjects=FALSE)
 Sets fast editing save policy to use when rendering.
 
FastEditSavePolicy getFastEditSavePolicy () const
 Returns fast editing save policy used when rendering.
 
SoDEPRECATED void setSmoothing (SbBool smooth)
 Sets smoothing flag.
 
SoDEPRECATED SbBool isSmoothing () const
 Returns smoothing flag.
 
void setNumPasses (int num)
 Sets number of rendering passes for multipass antialiasing.
 
int getNumPasses () const
 Gets number of rendering passes for multipass rendering.
 
void setPassUpdate (SbBool flag)
 Sets a flag indicating whether intermediate results are displayed after each antialiasing pass for progressive improvement (default is FALSE).
 
SbBool isPassUpdate () const
 Returns a flag indicating whether intermediate results are displayed after each antialiasing pass for progressive improvement.
 
void setPassCallback (SoGLRenderPassCB *func, void *userData)
 Sets a callback function to invoke between passes when antialiasing.
 
void setCacheContext (uint32_t context)
 Sets the OpenGL cache context.
 
uint32_t getCacheContext () const
 Returns the OpenGL cache context id for this action.
 
void setSortedLayersNumPasses (int num)
 Sets the number of rendering passes used when transparency type is SORTED_PIXEL.
 
int getSortedLayersNumPasses () const
 Returns the number of rendering passes used when transparency type is SORTED_PIXEL.
 
void setAlphaTest (SbBool flag)
 Enable or disable the OpenGL alpha test for rendering.
 
SbBool isAlphaTest () const
 Returns whether the OpenGL alpha test is enabled for rendering.
 
void setRenderingIsRemote (SbBool flag)
 Sets whether or not "remote" rendering is done.
 
SbBool getRenderingIsRemote () const
 Returns TRUE if remote rendering is being done.
 
virtual void invalidateState ()
 Invalidate the state, forcing it to be recreated at the next apply.
 
void setDecimationValue (SoDecimationTypeElement::Type type, float percentage=1.0)
 Sets decimation percentage, the value should be a number between 0.0 and 1.0 Useful for reducing the number of triangles rendered in the scene.
 
SoDecimationTypeElement::Type getDecimationType ()
 Gets decimation type.
 
float getDecimationPercentage ()
 Gets decimation percentage, the value should be a number between 0.0 and 1.0.
 
void setInvalidateCacheMode (InvalidateCacheMode icm)
 Enables or disables the invalidation of render caches.
 
InvalidateCacheMode getInvalidateCacheMode ()
 Returns the current cache invalidation mode.
 
uint32_t getFrameCounter () const
 Returns the current frame counter.
 
void resetFrameCounter (uint32_t count=0)
 Reset the frame counter.
 
virtual void apply (SoPath *path)
 Initiates an action on the graph defined by a path.
 
virtual void apply (const SoPathList &pathList, SbBool obeysRules=FALSE)
 Initiates an action on the graph defined by a list of paths.
 
void shouldAutoCache (AutoCacheMode mode)
 Called by nodes to say that they should/shouldn't be auto-cached (pass TRUE if should, FALSE if shouldn't, don't call this method at all if the node doesn't care):
 
- Public Member Functions inherited from SoAction
virtual ~SoAction ()
 Destructor.
 
void stopActionInBranch ()
 This function stops the action in the current Scene Graph branch.
 
SbBool getContinueActionInBranchFlag () const
 This function indicates if the action must stop in the current branch.
 
void resetContinueActionInBranchFlag ()
 This function resets the continue action flag.
 
void useAlternateRep (const SbBool enable)
 Tell the action to use alternate representations during traversal when available.
 
SbBool isUsingAlternateRep () const
 Returns TRUE if current action is using alternate representations.
 
void setSceneManager (SoSceneManager *mgr)
 Set the scene manager associated with this action (if any ).
 
SoSceneManagergetSceneManager () const
 Return the SoSceneManager associated with this action.
 
virtual void forwardTraversal (SoNode *node)
 Traverse a node that is not part of the current scenegraph.
 
virtual void forwardTraversal (SoPath *path)
 Traverse a path that is not part of the current scenegraph.
 
DistribMode getDistribMode () const
 Returns the distribution mode of this action across a cluster (ScaleViz-Cluster only).
 
AppliedCode getWhatAppliedTo () const
 Returns code indicating what action is being applied to.
 
SoNodegetNodeAppliedTo () const
 Returns the node the action is being applied to.
 
SoPathgetPathAppliedTo () const
 Returns the path the action is being applied to.
 
const SoPathListgetPathListAppliedTo () const
 Returns the path list the action is being applied to.
 
const SoPathListgetOriginalPathListAppliedTo () const
 Returns the original path list the action is being applied to.
 
SbBool isLastPathListAppliedTo () const
 Returns TRUE if the current list is the last one from the original.
 
PathCode getPathCode (int &numIndices, const int *&indices)
 Returns path code based on where current node (the node at the end of the current path) lies with respect to the path(s) the action is being applied to.
 
PathCode getPathCodeMI (int &numIndices, const int *&indices, const int *&instanceIndices)
 Extender API: available to programmers who wish to extend the toolkit
 
void traverse (SoNode *node)
 Does traversal of a graph rooted by a node.
 
SbBool hasTerminated () const
 Returns TRUE if the traversal has reached a termination condition.
 
const SoPathgetCurPath ()
 Returns the path accumulated during traversal, i.e., the chain of nodes from the root of the traversed graph to the current node being traversed.
 
SoStategetState () const
 Gets the state from the action.
 
void setPipeId (int id)
 Sets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration.
 
int getPipeId () const
 Gets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration.
 
bool isBeingApplied ()
 Returns TRUE if this action is currently being applied.
 
- Public Member Functions inherited from SoTypedObject
SbBool isOfType (const SoType &type) const
 Returns TRUE if this object is of the type specified in type or is derived from that type.
 
template<typename TypedObjectClass >
SbBool isOfType () const
 Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class.
 

Static Public Member Functions

static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static void initClass ()
 
static void exitClass ()
 
- Static Public Member Functions inherited from SoHighlightRenderAction
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
- Static Public Member Functions inherited from SoGLRenderAction
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static uint32_t generateCacheContext ()
 Generates and returns a new cache context id.
 
static bool isUsedCacheContext (uint32_t context)
 Returns TRUE if the specified cache context id is currently used by any SoGLRenderAction.
 
static SbBool isSortedLayersSupported (SoState *state=NULL)
 Indicates if SORTED_PIXEL transparency is supported by your graphics board on the current context.
 
- Static Public Member Functions inherited from SoAction
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static void nullAction (SoAction *, SoNode *)
 Null action method that can be stored in lookup table when desired.
 
- Static Public Member Functions inherited from SoTypedObject
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 

Additional Inherited Members

- Public Types inherited from SoGLRenderAction
enum  TransparencyType {
  NO_TRANSPARENCY ,
  NO_SORT ,
  OPAQUE_FIRST ,
  SORTED_OBJECT ,
  SORTED_PIXEL
}
 Transparency rendering algorithm. More...
 
enum  FastEditSavePolicy {
  DISABLE ,
  EACH_FRAME ,
  WHEN_NEEDED
}
 Fast edit traversal types. More...
 
enum  AbortCode {
  CONTINUE ,
  ABORT ,
  PRUNE ,
  DELAY
}
 Possible return codes from a render abort callback. More...
 
enum  InvalidateCacheMode {
  OFF ,
  ONCE ,
  ALWAYS
}
 Invalidate cache mode. More...
 
enum  AutoCacheMode {
  DO_AUTO_CACHE = 1 ,
  DONT_AUTO_CACHE = 2
}
 Two bits are stored. More...
 
typedef AbortCode SoGLRenderAbortCB(void *userData)
 Callback functions for render abort should be of this type.
 
- Public Types inherited from SoAction
enum  DistribMode {
  LOCAL_ONLY ,
  CLUSTER_ONLY ,
  ALL
}
 This is used to define the way an action is distributed across a cluster. More...
 
enum  AppliedCode {
  NODE ,
  PATH ,
  PATH_LIST
}
 This enum is used to determine what the action is being applied to. More...
 
enum  PathCode {
  NO_PATH ,
  IN_PATH ,
  BELOW_PATH ,
  OFF_PATH
}
 This enum may be used during traversal of nodes to indicate where the node is with respect to the path being traversed. More...
 

Detailed Description

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

  • The rendering of the halo uses the depth buffer of the selected shapes as its boundary.
  • Increasing the halo width value decreases performance.
  • When multiple objects are selected, they are highlighted as one unique shape, i.e. the halo is done on the union of their depth buffer. This is illustrated on the following image:
    2 selected objects are highlighted as one

EXAMPLE

SEE ALSO

SoLineHighlightRenderAction, SoColorHighlightRenderAction, SoBoxHighlightRenderAction, SoHighlightRenderAction, SoGLRenderAction, SoSelection, SoWinRenderArea

Definition at line 147 of file SoHaloHighlightRenderAction.h.

Constructor & Destructor Documentation

◆ SoHaloHighlightRenderAction() [1/2]

SoHaloHighlightRenderAction::SoHaloHighlightRenderAction ( )

◆ SoHaloHighlightRenderAction() [2/2]

SoHaloHighlightRenderAction::SoHaloHighlightRenderAction ( const SbViewportRegion viewportRegion)

◆ ~SoHaloHighlightRenderAction()

virtual SoHaloHighlightRenderAction::~SoHaloHighlightRenderAction ( )
virtual

Member Function Documentation

◆ exitClass()

static void SoHaloHighlightRenderAction::exitClass ( )
static

◆ getClassTypeId()

static SoType SoHaloHighlightRenderAction::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getHaloColor()

const SbColor & SoHaloHighlightRenderAction::getHaloColor ( ) const

◆ getHaloSmoothFactor()

float SoHaloHighlightRenderAction::getHaloSmoothFactor ( ) const

◆ getHaloWidth()

int SoHaloHighlightRenderAction::getHaloWidth ( ) const

◆ getTypeId()

virtual SoType SoHaloHighlightRenderAction::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Reimplemented from SoHighlightRenderAction.

◆ initClass()

static void SoHaloHighlightRenderAction::initClass ( )
static

◆ isHaloAlwaysVisible()

bool SoHaloHighlightRenderAction::isHaloAlwaysVisible ( ) const

◆ setHaloAlwaysVisible()

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

◆ setHaloColor()

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

◆ setHaloSmoothFactor()

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

◆ setHaloWidth()

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


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