SOLINEHIGHLIGHTRENDERACTION(3iv)

✨ SoLineHighlightRenderAction ✨

okay bestie, gather round, because today we're talking about SoLineHighlightRenderAction from the <3IV> manual set β€” it's the selection highlight style action and she is literally the moment πŸ’…


🌈 INHERITS FROM

SoAction > SoGLRenderAction > SoLineHighlightRenderAction

so yes, she's the great-grandbaby of the whole action family tree, and she inherited every single one of those genes. slay πŸ’–


✨ SYNOPSIS ✨

#include <Inventor/actions/SoLineHighlightRenderAction.h>

Methods from class SoLineHighlightRenderAction:

                     SoLineHighlightRenderAction()
 virtual void        apply(SoNode *node)
 void                setVisible(SbBool b)
 SbBool              isVisible() const
 void                setColor(const SbColor &c)
 SbColor &           getColor()
 void                setLinePattern(unsigned short pattern)
 unsigned short      getLinePattern()
 void                setLineWidth(float width)
 float               getLineWidth()

Methods from class SoGLRenderAction:

 void                      setViewportRegion(const SbViewportRegion
                                &newRegion)
 const SbViewportRegion &  getViewportRegion() const
 void                      setUpdateArea(const SbVec2f &origin, const
                                SbVec2f &size)
 void                      getUpdateArea(SbVec2f &origin, SbVec2f &size)
                                const
 void                      setAbortCallback(SoGLRenderAbortCB *func, void
                                *userData)
 void                      setTransparencyType(TransparencyType type)
 TransparencyType          getTransparencyType() const
 void                      setSmoothing(SbBool smooth)
 SbBool                    isSmoothing() const
 void                      setNumPasses(int num)
 int                       getNumPasses() const
 void                      setPassUpdate(SbBool flag)
 SbBool                    isPassUpdate() const
 void                      setPassCallback(SoGLRenderPassCB *func, void
                                *userData)
 void                      setCacheContext(uint32_t context)
 uint32_t                  getCacheContext() const

Methods from class SoAction:

 static SoType       getClassTypeId()
 virtual SoType      getTypeId()
 virtual SbBool      isOfType(SoType type)
 virtual void        invalidateState()

πŸ’– DESCRIPTION πŸ’–

so SoLineHighlightRenderAction is a render action β€” and here's the tea: she renders the scene graph you give her, and then she goes back and renders each selected object again, in wireframe. iconic behaviour, honestly. ✨

and who decides what's "selected"? the first SoSelection node in the scene that this action gets applied to. that's the one calling the shots, periodt πŸ‘‘

one lil' caveat tho β€” if a selected object has no renderable geometry in it, then no highlight gets rendered for that object. nothing to draw, nothing to glow up. πŸ™ˆ

also bestie, important: a highlight render action can be passed to the setGLRenderAction() method of SoXtRenderArea to have an affect on scene graphs. that's the hookup. that's how she gets into the group chat. 🫢


πŸŽ€ METHODS πŸŽ€

  • SoLineHighlightRenderAction() β€” the constructor, she's born. πŸ’«
  • virtual void apply(SoNode *node) β€” this renders the scene graph you pass in, and also renders each selected object in wireframe, exactly as specified by the first SoSelection node it finds in the scene graph. she does both. she's multitalented. πŸ’…
  • void setVisible(SbBool b) β€” a convenient mechansim for turning highlights off or back on. when FALSE is passed, subsequent calls to apply() render the scene graph without rendering highlights. the application is responsible for forcing a redraw of the scene after changing this state. default visibility is on. no cap.
  • SbBool isVisible() const β€” returns whether highlights will be rendered or not. simple. clean. we love a getter. ✨
  • void setColor(const SbColor &c) SbColor & getColor() β€” set and get 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 affects of this change. yes, again. it's a whole thing. πŸ“
  • void setLinePattern(unsigned short pattern) unsigned short getLinePattern() β€” set and get the line pattern of the highlight. default is solid, 0xffff. the pattern of bits in the passed variable specifies the pattern of the line. see SoDrawStyle for more information. and yes β€” the application is responsible for forcing a redraw of the scene to see the affects of this change. πŸ¦‹
  • void setLineWidth(float width) float getLineWidth() β€” set and get the line width of the highlight. default is 3. and guess what β€” the application is responsible for forcing a redraw of the scene to see the affects of this change. we've been over this bestie but it keeps coming up 😭

🌸 EXAMPLE 🌸

here's how a line highlight can be specified for a particular selection node and render area β€” look at her go:

SoXtRenderArea *myRenderArea;
SoSelection *mySelection;

// Set the highlight render action
myRenderArea->setGLRenderAction(
    new SoLineHighlightRenderAction());

// Automatic redraw on selection changes
myRenderArea->redrawOnSelectionChange(mySelection);

like. she's serving. automatic redraw on selection changes?? main character energy fr fr πŸ‘‘


πŸ’œ SEE ALSO πŸ’œ

SoBoxHighlightRenderAction, SoGLRenderAction, SoSelection, SoXtRenderArea, SoDrawStyle, SoInteraction


and that's the whole page bestie!! this one came from the SoLineHighlightRenderAction(3IV) manual, dated and versioned exactly as that footer says β€” SoLineHighlightRenderAction(3IV)() β€” so if you ever forget, just know she's out here rendering your selections in wireframe and looking absolutely stunning while doing it πŸ’–βœ¨πŸŽ€πŸ¦‹