public class SoBoxHighlightRenderAction extends SoGLRenderAction
SoBoxHighlightRenderAction
is a render action which renders the specified scene graph, then renders wireframe boxes surrounding each selected object. Selected objects are specified by the first SoSelection
node in the scene to which this action is applied. If an SoGetBoundingBoxAction
applied to a selected object produces an empty bounding box, no highlight is rendered for that object. A highlight render action can be passed to the setGLRenderAction() method of render area and viewer classes to have an effect on scene graphs.
Here is an example of how a box highlight can be specified for a particular selection node and viewer:
// Scene graph SoSelection selectionNode = new SoSelection(); . . . // Viewer SwSimpleViewer viewer = new SwSimpleViewer(); viewer.setSceneGraph( selectionNode ); // Set the highlight render action SwRenderArea area = viewer.getArea(); area.setGLRenderAction( new SoBoxHighlightRenderAction() ); // Request automatic redraw when selection changes area.redrawOnSelectionChange( selectionNode );
See also:
SoLineHighlightRenderAction
, SoGLRenderAction
, SoSelection
, SoWinRenderArea, SoDrawStyle
, SoInteraction
SoGLRenderAction.AbortCodes, SoGLRenderAction.AutoCacheModes, SoGLRenderAction.FastEditSavePolicies, SoGLRenderAction.InvalidateCacheModes, SoGLRenderAction.TransparencyTypes
SoAction.AppliedCodes, SoAction.DistribModes, SoAction.PathCodes, SoAction.PathIndices
Inventor.ConstructorCommand
ABORT, ADD, ALWAYS, BLEND, CONTINUE, DELAY, DELAYED_ADD, DELAYED_BLEND, DELAYED_SORTED_LAYERS_BLEND, DELAYED_SORTED_PIXELS_BLEND, DISABLE, DO_AUTO_CACHE, DONT_AUTO_CACHE, EACH_FRAME, NO_TRANSPARENCY, OFF, ONCE, PRUNE, SCREEN_DOOR, SORTED_LAYERS_BLEND, SORTED_OBJECT_ADD, SORTED_OBJECT_BLEND, SORTED_OBJECT_TRIANGLES_ADD, SORTED_OBJECT_TRIANGLES_BLEND, SORTED_PIXELS_BLEND, SORTED_TRIANGLES_ADD, SORTED_TRIANGLES_BLEND, WHEN_NEEDED
ALL, BELOW_PATH, CLUSTER_ONLY, IN_PATH, LOCAL_ONLY, NO_PATH, NODE, OFF_PATH, PATH, PATH_LIST
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoBoxHighlightRenderAction()
Constructor.
|
SoBoxHighlightRenderAction(SbViewportRegion viewportRegion)
Constructor which takes the normal
SoGLRenderAction parameters. |
Modifier and Type | Method and Description |
---|---|
static void |
enableElement(java.lang.Class<? extends Inventor> t,
int stkIndex) |
SbColor |
getColor()
Gets the color of the highlight.
|
short |
getLinePattern()
Gets the line pattern of the highlight.
|
float |
getLineWidth()
Gets the line width of the highlight.
|
boolean |
isVisible()
Returns whether highlights will be rendered or not.
|
void |
setColor(SbColor c)
Sets the color of the highlight.
|
void |
setLinePattern(short pattern)
Sets the line pattern of the highlight.
|
void |
setLineWidth(float width)
Sets the line width of the highlight.
|
void |
setVisible(boolean b)
This provides a convenient mechanism for turning highlights off or on.
|
abortNow, enableDepthPeeling3D, generateCacheContext, getCacheContext, getCurPass, getDecimationPercentage, getDecimationType, getDelayedObjDepthWrite, getDepthPeelingPass, getFastEditSavePolicy, getFrameCounter, getInvalidateCacheMode, getLogicalViewportRegion, getNumPasses, getRenderingIsRemote, getSortedLayersNumPasses, getSortedTrianglesNumCaches, getSortedTrianglesSortFrequency, getSynchronizer, getTransparencyType, getUpdateArea, getViewportRegion, handleTransparency, handleTransparency, handleTransparency, howToRenderScene, isAlphaTest, isDoingDepthPeeling, isPassUpdate, isSmoothing, isSortedLayersSupported, isSortedLayersSupported, isUsedCacheContext, postDelayedTraversal, preDelayedTraversal, resetFrameCounter, resetFrameCounter, setAlphaTest, setCacheContext, setDecimationValue, setDecimationValue, setDelayedObjDepthWrite, setFastEditSavePolicy, setFastEditSavePolicy, setInvalidateCacheMode, setLogicalViewportRegion, setNumPasses, setPassCallback, setPassCallback, setPassUpdate, setRenderingIsRemote, setSmoothing, setSortedLayersNumPasses, setSortedTrianglesNumCaches, setSortedTrianglesSortFrequency, setTransparencyType, setUpdateArea, setUpState, setViewportRegion, shouldAutoCache, updateTranspList
apply, apply, clearApplyResult, forwardTraversal, getContinueActionInBranchFlag, getCurPath, getNodeAppliedTo, getOriginalPathListAppliedTo, getPathAppliedTo, getPathCode, getPathListAppliedTo, getPipeId, getSceneManager, getState, getWhatAppliedTo, hasTerminated, invalidateState, isBeingApplied, isLastPathListAppliedTo, isUsingAlternateRep, nullAction, resetContinueActionInBranchFlag, setPipeId, setSceneManager, stopActionInBranch, traverse, useAlternateRep
dispose, getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
public SoBoxHighlightRenderAction(SbViewportRegion viewportRegion)
SoGLRenderAction
parameters.public SoBoxHighlightRenderAction()
public void setLineWidth(float width)
public void setColor(SbColor c)
public float getLineWidth()
public void setLinePattern(short pattern)
SoDrawStyle
for a description. Application is responsible for forcing a redraw of the scene to see the effects of this change.public SbColor getColor()
public void setVisible(boolean b)
public short getLinePattern()
public boolean isVisible()
public static void enableElement(java.lang.Class<? extends Inventor> t, int stkIndex)
Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com