Scroll to navigation

SoXtRenderArea(3IV)() SoXtRenderArea(3IV)()

NAME

SoXtRenderArea — Xt Component for rendering Inventor scene graphs

INHERITS FROM

SoXtComponent > SoXtGLWidget > SoXtRenderArea

SYNOPSIS

#include <Inventor/Xt/SoXtRenderArea.h>


typedef SbBool SoXtRenderAreaEventCB(void *userData, XAnyEvent *anyevent)


Methods from class SoXtRenderArea:


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:


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:


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

This class provides Inventor rendering and event handling inside a GLX Motif widget. There is a routine to specify the scene to render. The scene is automatically rendered whenever anything under it changes (a data sensor is attached to the root of the scene), unless explicitly told not to do so (manual redraws). Users can also set Inventor rendering attributes such as the transparency type, antialiasing on or off, etc. This class employs an SoSceneManager to manage rendering and event handling.

X events that occur 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. When an event occurs, it is first passed to the application event callback function registered with the setEventCallback() method on SoXtRenderArea. If this function does not exist or returns FALSE, the X event is either used directly by the viewer or translated to an SoEvent for further scene graph processing. If the viewer does not handle the event, and an overlay scene graph exists, the SoEvent is sent to that scene graph by way of an SoHandleEventAction. If no node in the overlay scene graph handles the event (i.e., calls setHandled() on the SoHandleEventAction), the SoEvent is passed to the normal scene graph in the same manner.

METHODS


SoXtRenderArea(Widget parent = NULL, const char *name = NULL, SbBool buildInsideParent = TRUE, SbBool getMouseInput = TRUE, SbBool getKeyboardInput = TRUE)

~SoXtRenderArea()

Constructor which is passed arguments which tell it whether to register the mouse and keyboard devices by default (SoXtMouse and SoXtKeyboard).



virtual void setSceneGraph(SoNode *newScene)

virtual SoNode * getSceneGraph()

Set/get the scene graph to be rendered in this component's window.



void setOverlaySceneGraph(SoNode *newScene)

SoNode * getOverlaySceneGraph()

Sets/gets the scene graph to render in the overlay bit planes.

Note: since the overlay bit planes are in color index mode, single buffer with a limited number of colors, the user should limit rendering in the overlay planes to simple objects.

Typically rendering in color index mode is done using the SoColorIndex node with a SoLightModel set to BASE_COLOR.



void registerDevice(SoXtDevice *)

void unregisterDevice(SoXtDevice *)

Register/unregister interest in devices. When a device is registered, events from that device will be processed by the render area, and passed into the scene graph. Events from unregistered devices will be ignored.



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 in color index mode. (default to black (index 0)).



void setOverlayBackgroundIndex(int index)

int getOverlayBackgroundIndex() const

Sets/gets the overlay window background color index. (default to 0 (clear color)).



void setColorMap(int startIndex, int num, const SbColor *colors)

Sets the colors to use when displaying in color index mode. This will load the color map with the given colors at the starting index.



void setOverlayColorMap(int startIndex, int num, const SbColor *colors)

Sets the colors to use for overlay bit planes.This will load the color map with the given colors at the starting index.



void setViewportRegion(const SbViewportRegion &newRegion)

const SbViewportRegion & getViewportRegion() const

Sets/gets current viewport region to use for rendering



void setTransparencyType(SoGLRenderAction::TransparencyType type)

SoGLRenderAction::TransparencyType getTransparencyType() const

Set/get the quality level for rendering transparent objects. See SoGLRenderAction for 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 of antialiasing available: smoothing and multipass antialiasing. If smoothing is set to TRUE, smoothing is enabled. Smoothing uses OpenGL's line- and point-smoothing features to provide cheap antialiasing of lines and points. The value of numPasses controls multipass antialiasing. Each time a render action is applied, Inventor renders the scene numPasses times from slightly different camera positions, averaging the results. numPasses can be from one to 255, inclusive. Setting numPasses to one disables multipass antialiasing. You can use either, both, or neither of these antialiasing techniques. By default, both smoothing and multipass antialiasing are disabled.



void setClearBeforeRender(SbBool trueOrFalse)

SbBool isClearBeforeRender() const

Enable/prevent window clearing from happening before a rendering starts (default is clear TRUE). This can be useful to limit flickering when doing single buffering and geometry covers the entire window (used in the material editor).



void setClearBeforeOverlayRender(SbBool trueOrFalse)

SbBool isClearBeforeOverlayRender() const

Enable/prevent overlay window clearing from happening before a rendering starts (default is clear TRUE).



void setAutoRedraw(SbBool trueOrFalse)

SbBool isAutoRedraw() const

The render area will automatically redraw whenever something in the scene graph changes. Passing FALSE will disable this feature.



void setRedrawPriority(uint32_t priority)

uint32_t getRedrawPriority() const

static uint32_t getDefaultRedrawPriority()

Sets/gets the priority of the redraw sensor and get the default priority number.



void render()

void renderOverlay()

Calling this forces the render area to be redrawn now. It is not necessary to call this method if auto redraw is enabled (which is the default).



void scheduleRedraw()

void scheduleOverlayRedraw()

Schedule a redraw to happen sometime soon (as opposed to immediately). This can be used to compress multiple redraws.



void redrawOnSelectionChange(SoSelection *s)

void redrawOverlayOnSelectionChange(SoSelection *s)

Call this convenience method to have this render area redraw whenever the selection list changes in the passed node. This is useful if using a highlight render action like the SoBoxHighlightRenderAction to correctly render whenever the selection changes. Pass NULL to turn this off.



void setEventCallback(SoXtRenderAreaEventCB *fcn, void *userData = NULL)

X events which occur in the render area window are either directly handled by the viewer (when this is really a viewer) or automatically translated to SoEvents, then passed into the scene graph (via the SoHandleEventAction) so that live scene graph objects can handle the event (when viewers are not in viewing mode). This method allows the application to register a callback for handling events that occur in the window, instead of sending them to the viewers or down the graph. The callback is passed the X event, and should return TRUE if it handled the event. If the callback returns FALSE, then the event will be handled by the render area.



void setGLRenderAction(SoGLRenderAction *ra)

SoGLRenderAction * getGLRenderAction() const

Sets/gets the GL render action to use. This is used to set selection highlighting with the SoBoxHighlightRenderAction and SoLineHighlightRenderAction classes.



void setOverlayGLRenderAction(SoGLRenderAction *ra)

SoGLRenderAction * getOverlayGLRenderAction() const

Sets/gets the GL render action for the overlay window.



void setSceneManager(SoSceneManager *sm)

SoSceneManager * getSceneManager() const

void setOverlaySceneManager(SoSceneManager *sm)

SoSceneManager * getOverlaySceneManager() const

Sets/gets the normal and overlay plane scene managers.

Note: for convenience most of the SoSceneManager methods have already been added to this class.


RESOURCES


*SoXtRenderArea*BackgroundColor: black (color name or hex value)

SEE ALSO

SoXtGLWidget, SoXtComponent, SoXtViewer, SoSceneManager, SoBoxHighlightRenderAction, SoLineHighlightRenderAction