SOXTRENDERAREA(3iv)
π SoXtRenderArea π
okay bestie, welcome to SoXtRenderArea(3IV) β the section 3 manual page for the Xt Component that renders Inventor scene graphs. grab a boba, this one's a whole journey π§β¨
πΈ NAME πΈ
SoXtRenderArea β the Xt Component for rendering Inventor scene graphs, and she is booked and busy π
π¦ INHERITS FROM π¦
SoXtComponent > SoXtGLWidget > SoXtRenderArea
so like, she comes from a whole distinguished bloodline, iykyk π
β¨ SYNOPSIS β¨
first things first, include her:
#include <Inventor/Xt/SoXtRenderArea.h>
and here's the callback type she rolls with:
typedef SbBool SoXtRenderAreaEventCB(void *userData, XAnyEvent *anyevent)
π Methods from class SoXtRenderArea
these are HER methods, her own little icon era:
SoXtRenderArea(Widget parent = NULL, const char *name = NULL, SbBool buildInsideParent = TRUE, SbBool getMouseInput = TRUE, SbBool getKeyboardInput = TRUE)
~SoXtRenderArea()
virtual void setSceneGraph(SoNode *newScene)
virtual SoNode * getSceneGraph()
void setOverlaySceneGraph(SoNode *newScene)
SoNode * getOverlaySceneGraph()
void registerDevice(SoXtDevice *)
void unregisterDevice(SoXtDevice *)
void setBackgroundColor(const SbColor &c)
const SbColor & getBackgroundColor() const
void setBackgroundIndex(int index)
int getBackgroundIndex() const
void setOverlayBackgroundIndex(int index)
int getOverlayBackgroundIndex() const
void setColorMap(int startIndex, int num, const SbColor *colors)
void setOverlayColorMap(int startIndex, int num, const SbColor *colors)
void setViewportRegion(const SbViewportRegion &newRegion)
const SbViewportRegion & getViewportRegion() const
void setTransparencyType(SoGLRenderAction::TransparencyType type)
SoGLRenderAction::TransparencyType getTransparencyType() const
void setAntialiasing(SbBool smoothing, int numPasses)
void getAntialiasing(SbBool &smoothing, int &numPasses) const
void setClearBeforeRender(SbBool trueOrFalse)
SbBool isClearBeforeRender() const
void setClearBeforeOverlayRender(SbBool trueOrFalse)
SbBool isClearBeforeOverlayRender() const
void setAutoRedraw(SbBool trueOrFalse)
SbBool isAutoRedraw() const
void setRedrawPriority(uint32_t priority)
uint32_t getRedrawPriority() const
static uint32_t getDefaultRedrawPriority()
void render()
void renderOverlay()
void scheduleRedraw()
void scheduleOverlayRedraw()
void redrawOnSelectionChange(SoSelection *s)
void redrawOverlayOnSelectionChange(SoSelection *s)
void setEventCallback(SoXtRenderAreaEventCB *fcn, void *userData = NULL)
void setGLRenderAction(SoGLRenderAction *ra)
SoGLRenderAction * getGLRenderAction() const
void setOverlayGLRenderAction(SoGLRenderAction *ra)
SoGLRenderAction * getOverlayGLRenderAction() const
void setSceneManager(SoSceneManager *sm)
SoSceneManager * getSceneManager() const
void setOverlaySceneManager(SoSceneManager *sm)
SoSceneManager * getOverlaySceneManager() const
π«Ά Methods from class SoXtGLWidget
the inherited ones, still iconic:
void setBorder(SbBool onOrOff)
SbBool isBorder() const
virtual void setDoubleBuffer(SbBool onOrOff)
SbBool isDoubleBuffer()
Window getNormalWindow()
Window getOverlayWindow()
GLXContext getNormalContext()
GLXContext getOverlayContext()
Widget getNormalWidget()
Widget getOverlayWidget()
virtual void setNormalVisual(XVisualInfo *vis)
XVisualInfo * getNormalVisual()
virtual void setOverlayVisual(XVisualInfo *vis)
XVisualInfo * getOverlayVisual()
void setDrawToFrontBufferEnable(SbBool enableFlag)
SbBool isDrawToFrontBufferEnable() const
π Methods from class SoXtComponent
and the grandma-of-the-house methods, slaying since forever:
virtual void show()
virtual void hide()
SbBool isVisible()
Widget getWidget() const
SbBool isTopLevelShell() const
Widget getShellWidget() const
Widget getParentWidget() const
void setSize(const SbVec2s &size)
SbVec2s getSize()
Display * getDisplay()
void setTitle(const char *newTitle)
const char * getTitle() const
void setIconTitle(const char *newIconTitle)
const char * getIconTitle() const
void setWindowCloseCallback(SoXtComponentCB *func, void *data = NULL)
static SoXtComponent * getComponent(Widget w)
const char * getWidgetName() const
const char * getClassName() const
π DESCRIPTION π
okay so here's the whole vibe. This class gives you Inventor rendering and event handling living inside a GLX Motif widget. There's a routine to specify the scene to render β cute, simple, we love her. And the scene gets rendered automatically whenever anything under it changes, because a data sensor is attached to the root of the scene. That's the default, periodt. The only exception? If you explicitly tell her not to do that, i.e. manual redraws. Then she minds her business and waits for you π
You can also set Inventor rendering attributes β stuff like the transparency type, antialiasing on or off, etc. And under the hood, this class employs an SoSceneManager to manage rendering and event handling, because she's organized like that π
π« how events get handled, bestie (this part matters)
X events that happen in the render area can be handled by the application, by the viewer (if this is really a viewer), or by the nodes in the scene graph. Three candidates, one event. Here's the order of operations, no skipping:
- When an event occurs, it is first passed to the application event callback function registered with the
setEventCallback()method onSoXtRenderArea. - If this function does not exist, or it returns
FALSE, the X event is either used directly by the viewer or translated to anSoEventfor further scene graph processing. - If the viewer does not handle the event, and an overlay scene graph exists, the
SoEventis sent to that scene graph by way of anSoHandleEventAction. - If no node in the overlay scene graph handles the event β meaning nobody calls
setHandled()on theSoHandleEventActionβ theSoEventis passed to the normal scene graph in the same manner.
so basically: app first, then viewer, then overlay graph, then normal graph. the event is on a whole relay race and somebody better catch it πββοΈπ₯
that's part 1, my love β there's more coming so don't you dare close the tab π«Άβ¨
β¨ METHODS β¨
Okay bestie, this is the part where we meet the whole friend group π every single method this class has. Buckle up, there's a lot of them, and they're all lowkey iconic.
SoXtRenderArea(Widget parent = NULL, const char *name = NULL,
SbBool buildInsideParent = TRUE,
SbBool getMouseInput = TRUE,
SbBool getKeyboardInput = TRUE)
~SoXtRenderArea()
- The constructor π it takes the args that tell it whether to register the mouse and keyboard devices by default β those would be
SoXtMouseandSoXtKeyboard. So you're basically saying "hey, do you want to auto-subscribe to mouse and keyboard or not" right at birth.
virtual void setSceneGraph(SoNode *newScene)virtual SoNode * getSceneGraph()β set/get the scene graph that gets rendered in this component's window. That's the whole point of the thing, fr fr.void setOverlaySceneGraph(SoNode *newScene)SoNode * getOverlaySceneGraph()β sets/gets the scene graph you want rendered in the overlay bit planes. Fancy β¨
Heads up: the overlay bit planes are in color index mode, single buffer, with a limited number of colors, so the user should keep overlay rendering to simple objects only. No cap. Typically, rendering in color index mode is done using theSoColorIndexnode with aSoLightModelset toBASE_COLOR.
void registerDevice(SoXtDevice *)void unregisterDevice(SoXtDevice *)β register/unregister your interest in devices π«Ά. Once a device is registered, events from it get processed by the render area and passed into the scene graph. Events from unregistered devices? Ignored. Not even looked at. πvoid setBackgroundColor(const SbColor &c)const SbColor & getBackgroundColor() constβ set/get the background color for this window. Default is black,(0,0,0).void setBackgroundIndex(int index)int getBackgroundIndex() constβ sets/gets the window background color when you're in color index mode. Defaults to black, which is index0.void setOverlayBackgroundIndex(int index)int getOverlayBackgroundIndex() constβ sets/gets the overlay window background color index. Defaults to0, the clear color.void setColorMap(int startIndex, int num, const SbColor *colors)β sets the colors to use when displaying in color index mode. This loads the color map with the given colors, starting at the index you pass. πvoid setOverlayColorMap(int startIndex, int num, const SbColor *colors)β same energy but for the overlay bit planes. Loads the color map with the given colors at the starting index.void setViewportRegion(const SbViewportRegion &newRegion)const SbViewportRegion & getViewportRegion() constβ sets/gets the current viewport region used for rendering.void setTransparencyType(SoGLRenderAction::TransparencyType type)SoGLRenderAction::TransparencyType getTransparencyType() constβ set/get the quality level for rendering transparent objects. PeepSoGLRenderActionfor the possible transparency types πvoid setAntialiasing(SbBool smoothing, int numPasses)void getAntialiasing(SbBool &smoothing, int &numPasses) constβ set/get the antialiasing for rendering. There are two kinds available: smoothing and multipass antialiasing.- If
smoothingis set toTRUE, smoothing is on. Smoothing uses OpenGL's line- and point-smoothing features to give you cheap antialiasing of lines and points. - The value of
numPassescontrols multipass antialiasing. Every time a render action is applied, Inventor renders the scenenumPassestimes from slightly different camera positions and averages the results πnumPassescan be from one to255, inclusive. SettingnumPassesto one disables multipass antialiasing. - You can use either, both, or neither of these techniques. By default, both smoothing and multipass antialiasing are disabled.
- If
void setClearBeforeRender(SbBool trueOrFalse)SbBool isClearBeforeRender() constβ enable/prevent the window from being cleared before a rendering starts. Default is clearTRUE. This is genuinely useful for limiting flickering when you're doing single buffering and the geometry covers the entire window β it's used in the material editor, iykyk.void setClearBeforeOverlayRender(SbBool trueOrFalse)SbBool isClearBeforeOverlayRender() constβ enable/prevent the overlay window from being cleared before a rendering starts. Default is clearTRUE.void setAutoRedraw(SbBool trueOrFalse)SbBool isAutoRedraw() constβ the render area automatically redraws whenever something in the scene graph changes. PassingFALSEdisables that feature. Main character energy only when you want it β¨void setRedrawPriority(uint32_t priority)uint32_t getRedrawPriority() conststatic uint32_t getDefaultRedrawPriority()β sets/gets the priority of the redraw sensor, and grabs the default priority number. π¦void render()void renderOverlay()β calling this forces the render area to be redrawn right now. You don't need to call it if auto redraw is enabled (and it's enabled by default), so bestie, usually you can just chill.void scheduleRedraw()void scheduleOverlayRedraw()β schedule a redraw to happen sometime soon instead of immediately. This is the move when you want to compress multiple redraws into one, chef's kiss πvoid redrawOnSelectionChange(SoSelection *s)void redrawOverlayOnSelectionChange(SoSelection *s)β a convenience method: call it and this render area redraws whenever the selection list changes in the node you passed. Super useful if you're using a highlight render action likeSoBoxHighlightRenderAction, so it correctly renders every time the selection changes. PassNULLto turn this off.void setEventCallback(SoXtRenderAreaEventCB *fcn, void *userData = NULL)β X events that happen in the render area window are either handled directly by the viewer (when this is really a viewer) or automatically translated intoSoEvents and passed into the scene graph via theSoHandleEventAction, so live scene graph objects can handle them (when viewers are not in viewing mode). This method lets the application register a callback for handling events in the window instead of sending them to the viewers or down the graph. The callback gets passed the X event, and should returnTRUEif it handled it. If the callback returnsFALSE, then the render area handles the event itself. Teamwork πvoid setGLRenderAction(SoGLRenderAction *ra)SoGLRenderAction * getGLRenderAction() constβ sets/gets the GL render action to use. This is how you set selection highlighting with theSoBoxHighlightRenderActionandSoLineHighlightRenderActionclasses π₯void setOverlayGLRenderAction(SoGLRenderAction *ra)SoGLRenderAction * getOverlayGLRenderAction() constβ sets/gets the GL render action for the overlay window.void setSceneManager(SoSceneManager *sm)SoSceneManager * getSceneManager() constvoid setOverlaySceneManager(SoSceneManager *sm)SoSceneManager * getOverlaySceneManager() constβ sets/gets the normal and overlay plane scene managers.
Little note bestie: for convenience, most of the SoSceneManager methods have already been added to this class. So they're kind of just... here now. You're welcome π
πΈ RESOURCES πΈ
One singular X resource and she's doing her best:
*SoXtRenderArea*BackgroundColor: black (color name or hex value)β yep, it takes a color name or a hex value. Versatile queen.
π SEE ALSO π
Go check out the rest of the fam:
SoXtGLWidgetSoXtComponentSoXtViewerSoSceneManagerSoBoxHighlightRenderActionSoLineHighlightRenderAction
And that's the whole page, bestie π«Ά this is SoXtRenderArea(3IV) β that's the source and version tag β and the date slot down there is just... blank. Mysterious. Enigmatic. We stan a timeless queen β¨π
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms