Class SoColorHighlightRenderAction


public class SoColorHighlightRenderAction extends SoHighlightRenderAction
A polygon selection highlight style. SoColorHighlightRenderAction is a render action which renders the scene graph and then renders again the polygons of selected objects in a highlight color.Selected objects are specified by the first SoSelection node in the scene to which this action is applied. A highlight render action can be passed to the setGLRenderAction() method of render area and viewer classes to have an effect on scene graphs. EXAMPLE

Here is an example of how a box highlight can be specified for a particular selection node and viewer:

 // Viewer
 ViewerExaminer viewer = new ViewerExaminer();
 // Set the highlight render action
 final RenderArea area = viewer.getRenderArea();
 area.setGLRenderAction( new SoColorHighlightRenderAction() );
 
 // 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:
  • Constructor Details

    • SoColorHighlightRenderAction

      public SoColorHighlightRenderAction()
    • SoColorHighlightRenderAction

      public SoColorHighlightRenderAction(SbViewportRegion viewportRegion)
  • Method Details

    • 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.
    • getColor

      public SbColor getColor()
      Gets the color of the highlight.
    • enableElement

      public static void enableElement(Class<? extends Inventor> t, int stkIndex)