Class SoLineHighlightRenderAction
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.actions.SoAction
-
- com.openinventor.inventor.actions.SoGLRenderAction
-
- com.openinventor.inventor.actions.SoHighlightRenderAction
-
- com.openinventor.inventor.actions.SoLineHighlightRenderAction
-
public class SoLineHighlightRenderAction extends SoHighlightRenderAction
A wireframe highlight style.SoLineHighlightRenderAction
is a render action which renders the specified scene graph, then renders each selected object again in wireframe. If there is no renderable geometry in a selected object, no highlight is rendered for that object.Selected objects are specified by the first selection node (
SoSelection
orSoExtSelection
) 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 theSoSceneManager
class using the setGLRenderAction() method. The viewer classes provide a convenience setGLRenderAction() method that callsSoSceneManager
(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.
Other highlight effects are available including "halo" highlighting.
EXAMPLE Here is an example of how a line highlight can be specified for a particular selection node and render area.
// Viewer ViewerExaminer viewer = new ViewerExaminer(); // Set the highlight render action final RenderArea area = viewer.getRenderArea(); area.setGLRenderAction( new SoLineHighlightRenderAction() ); // Scene graph SoSelection selectionNode = new SoSelection(); // Request automatic redraw when selection changes selectionNode.addChangeCallback(new SoSelectionClassCB() { public void invoke(SoSelection s) { area.scheduleRedraw(); } }); . . . viewer.setSceneGraph( selectionNode ); - See Also:
SoBoxHighlightRenderAction
,SoColorHighlightRenderAction
,SoHaloHighlightRenderAction
,SoHighlightRenderAction
,SoGLRenderAction
,SoSelection
,SoWinRenderArea
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.actions.SoGLRenderAction
SoGLRenderAction.AbortCodes, SoGLRenderAction.AutoCacheModes, SoGLRenderAction.FastEditSavePolicies, SoGLRenderAction.InvalidateCacheModes, SoGLRenderAction.TransparencyTypes
-
Nested classes/interfaces inherited from class com.openinventor.inventor.actions.SoAction
SoAction.AppliedCodes, SoAction.DistribModes, SoAction.PathCodes, SoAction.PathIndices
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoLineHighlightRenderAction()
Constructor.SoLineHighlightRenderAction(SbViewportRegion viewportRegion)
Constructor which takes the normalSoGLRenderAction
parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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.float
getPointSize()
Gets the point size of the highlight.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
setPointSize(float size)
Sets the size of points (diameter in pixels) rendered by the highlight.-
Methods inherited from class com.openinventor.inventor.actions.SoHighlightRenderAction
isVisible, setVisible
-
Methods inherited from class com.openinventor.inventor.actions.SoGLRenderAction
abortNow, enableDepthPeeling3D, generateCacheContext, getCache, getCacheContext, getCurPass, getDecimationPercentage, getDecimationType, getDelayedObjDepthWrite, getDepthPeelingPass, getFastEditSavePolicy, getFrameCounter, getInvalidateCacheMode, getLogicalViewportRegion, getNumPasses, getRenderingIsRemote, getSortedLayersNumPasses, getTransparencyType, getUpdateArea, getViewportRegion, handleTransparency, handleTransparency, handleTransparency, isAlphaTest, isDoingDepthPeeling, isPassUpdate, isSmoothing, isSortedLayersSupported, isSortedLayersSupported, isUsedCacheContext, resetFrameCounter, resetFrameCounter, setAlphaTest, setCache, setCacheContext, setDecimationValue, setDecimationValue, setDelayedObjDepthWrite, setFastEditSavePolicy, setFastEditSavePolicy, setInvalidateCacheMode, setLogicalViewportRegion, setNumPasses, setPassCallback, setPassCallback, setPassUpdate, setRenderingIsRemote, setSmoothing, setSortedLayersNumPasses, setTransparencyType, setUpdateArea, setViewportRegion, shouldAutoCache
-
Methods inherited from class com.openinventor.inventor.actions.SoAction
apply, apply, clearApplyResult, forwardTraversal, forwardTraversal, getContinueActionInBranchFlag, getCurPath, getDistribMode, getNodeAppliedTo, getOriginalPathListAppliedTo, getPathAppliedTo, getPathCode, getPathListAppliedTo, getPipeId, getSceneManager, getState, getWhatAppliedTo, hasTerminated, invalidateState, isBeingApplied, isLastPathListAppliedTo, isUsingAlternateRep, nullAction, postDelayedTraversal, preDelayedTraversal, resetContinueActionInBranchFlag, setPipeId, setSceneManager, setUpState, stopActionInBranch, traverse, useAlternateRep
-
Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
-
-
-
Constructor Detail
-
SoLineHighlightRenderAction
public SoLineHighlightRenderAction(SbViewportRegion viewportRegion)
Constructor which takes the normalSoGLRenderAction
parameters.
-
SoLineHighlightRenderAction
public SoLineHighlightRenderAction()
Constructor.
-
-
Method Detail
-
getLineWidth
public float getLineWidth()
Gets the line width of the highlight.
-
getLinePattern
public short getLinePattern()
Gets the line pattern of the highlight.
-
getPointSize
public float getPointSize()
Gets the point size of the highlight.
-
setLineWidth
public void setLineWidth(float width)
Sets the line width of the highlight. Default is 3. The application is responsible for forcing a redraw of the scene to see the effects of this change.
-
setPointSize
public void setPointSize(float size)
Sets the size of points (diameter in pixels) rendered by the highlight. Default is 1. Value must be greater than zero. Only applies to point primitives, e.g.SoPointSet
.
-
enableElement
public static void enableElement(java.lang.Class<? extends Inventor> t, int stkIndex)
-
setColor
public void setColor(SbColor c)
Sets the color of the highlight. Default is red (1,0,0). The application is responsible for forcing a redraw of the scene to see the effects of this change.
-
setLinePattern
public void setLinePattern(short pattern)
Sets the line pattern of the highlight. Default is solid, 0xffff. The pattern of bits in the passed variable specifies the pattern of the line. SeeSoDrawStyle
for more information. The application is responsible for forcing a redraw of the scene to see the effects of this change.
-
getColor
public SbColor getColor()
Gets the color of the highlight.
-
-