man SoXtRenderArea () - Xt Component for rendering Inventor scene graphs

NAME

SoXtRenderArea - Xt Component for rendering Inventor scene graphs

INHERITS FROM

SoXtComponent > SoXtGLWidget > SoXtRenderArea

SYNOPSIS

#include <Inventor/Xt/SoXtRenderArea.h> c } c } SoXtRenderAreaEventCB(void *userData, XAnyEvent *anyevent) Methods from class SoXtRenderArea: c } c } SoXtRenderArea(Widget parent = NULL, const char *name = NULL, SbBool buildInsideParent = TRUE, SbBool getMouseInput = TRUE, SbBool getKeyboardInput = TRUE)

c } c } ~SoXtRenderArea()

c } c } setSceneGraph(SoNode *newScene)

c } c } getSceneGraph()

c } c } setOverlaySceneGraph(SoNode *newScene)

c } c } getOverlaySceneGraph()

c } c } registerDevice(SoXtDevice *)

c } c } unregisterDevice(SoXtDevice *)

c } c } setBackgroundColor(const SbColor &c)

c } c } getBackgroundColor() const

c } c } setBackgroundIndex(int index)

c } c } getBackgroundIndex() const

c } c } setOverlayBackgroundIndex(int index)

c } c } getOverlayBackgroundIndex() const

c } c } setColorMap(int startIndex, int num, const SbColor *colors)

c } c } setOverlayColorMap(int startIndex, int num, const SbColor *colors)

c } c } setViewportRegion(const SbViewportRegion &newRegion)

c } c } getViewportRegion() const

c } c } setTransparencyType(SoGLRenderAction::TransparencyType type)

c } c } getTransparencyType() const

c } c } setAntialiasing(SbBool smoothing, int numPasses)

c } c } getAntialiasing(SbBool &smoothing, int &numPasses) const

c } c } setClearBeforeRender(SbBool trueOrFalse)

c } c } isClearBeforeRender() const

c } c } setClearBeforeOverlayRender(SbBool trueOrFalse)

c } c } isClearBeforeOverlayRender() const

c } c } setAutoRedraw(SbBool trueOrFalse)

c } c } isAutoRedraw() const

c } c } setRedrawPriority(uint32_t priority)

c } c } getRedrawPriority() const

c } c } getDefaultRedrawPriority()

c } c } render()

c } c } renderOverlay()

c } c } scheduleRedraw()

c } c } scheduleOverlayRedraw()

c } c } redrawOnSelectionChange(SoSelection *s)

c } c } redrawOverlayOnSelectionChange(SoSelection *s)

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

c } c } setGLRenderAction(SoGLRenderAction *ra)

c } c } getGLRenderAction() const

c } c } setOverlayGLRenderAction(SoGLRenderAction *ra)

c } c } getOverlayGLRenderAction() const

c } c } setSceneManager(SoSceneManager *sm)

c } c } getSceneManager() const

c } c } setOverlaySceneManager(SoSceneManager *sm)

c } c } getOverlaySceneManager() const Methods from class SoXtGLWidget: c } c } setBorder(SbBool onOrOff)

c } c } isBorder() const

c } c } setDoubleBuffer(SbBool onOrOff)

c } c } isDoubleBuffer()

c } c } getNormalWindow()

c } c } getOverlayWindow()

c } c } getNormalContext()

c } c } getOverlayContext()

c } c } getNormalWidget()

c } c } getOverlayWidget()

c } c } setNormalVisual(XVisualInfo *vis)

c } c } getNormalVisual()

c } c } setOverlayVisual(XVisualInfo *vis)

c } c } getOverlayVisual()

c } c } setDrawToFrontBufferEnable(SbBool enableFlag)

c } c } isDrawToFrontBufferEnable() const Methods from class SoXtComponent: c } c } show()

c } c } hide()

c } c } isVisible()

c } c } getWidget() const

c } c } isTopLevelShell() const

c } c } getShellWidget() const

c } c } getParentWidget() const

c } c } setSize(const SbVec2s &size)

c } c } getSize()

c } c } getDisplay()

c } c } setTitle(const char *newTitle)

c } c } getTitle() const

c } c } setIconTitle(const char *newIconTitle)

c } c } getIconTitle() const

c } c } setWindowCloseCallback(SoXtComponentCB *func, void *data = NULL)

c } c } getComponent(Widget w)

c } c } getWidgetName() const

c } c } 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

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

c } c } ~SoXtRenderArea()

Constructor which is passed arguments which tell it whether to register the mouse and keyboard devices by default (SoXtMouse and SoXtKeyboard). c } c } setSceneGraph(SoNode *newScene)

c } c } getSceneGraph()

Set/get the scene graph to be rendered in this component's window. c } c } setOverlaySceneGraph(SoNode *newScene)

c } c } 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. c } c } registerDevice(SoXtDevice *)

c } c } 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. c } c } setBackgroundColor(const SbColor &c)

c } c } getBackgroundColor() const

Set/get the background color for this window. Default is black (0,0,0). c } c } setBackgroundIndex(int index)

c } c } getBackgroundIndex() const

Sets/gets the window background color when in color index mode. (default to black (index 0)). c } c } setOverlayBackgroundIndex(int index)

c } c } getOverlayBackgroundIndex() const

Sets/gets the overlay window background color index. (default to 0 (clear color)). c } c } 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. c } c } 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. c } c } setViewportRegion(const SbViewportRegion &newRegion)

c } c } getViewportRegion() const

Sets/gets current viewport region to use for rendering c } c } setTransparencyType(SoGLRenderAction::TransparencyType type)

c } c } getTransparencyType() const

Set/get the quality level for rendering transparent objects. See SoGLRenderAction for possible transparency types. c } c } setAntialiasing(SbBool smoothing, int numPasses)

c } c } 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. c } c } setClearBeforeRender(SbBool trueOrFalse)

c } c } 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). c } c } setClearBeforeOverlayRender(SbBool trueOrFalse)

c } c } isClearBeforeOverlayRender() const

Enable/prevent overlay window clearing from happening before a rendering starts (default is clear TRUE). c } c } setAutoRedraw(SbBool trueOrFalse)

c } c } isAutoRedraw() const

The render area will automatically redraw whenever something in the scene graph changes. Passing FALSE will disable this feature. c } c } setRedrawPriority(uint32_t priority)

c } c } getRedrawPriority() const

c } c } getDefaultRedrawPriority()

Sets/gets the priority of the redraw sensor and get the default priority number. c } c } render()

c } c } 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). c } c } scheduleRedraw()

c } c } scheduleOverlayRedraw()

Schedule a redraw to happen sometime soon (as opposed to immediately). This can be used to compress multiple redraws. c } c } redrawOnSelectionChange(SoSelection *s)

c } c } 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. c } c } 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. c } c } setGLRenderAction(SoGLRenderAction *ra)

c } c } getGLRenderAction() const

Sets/gets the GL render action to use. This is used to set selection highlighting with the SoBoxHighlightRenderAction and SoLineHighlightRenderAction classes. c } c } setOverlayGLRenderAction(SoGLRenderAction *ra)

c } c } getOverlayGLRenderAction() const

Sets/gets the GL render action for the overlay window. c } c } setSceneManager(SoSceneManager *sm)

c } c } getSceneManager() const

c } c } setOverlaySceneManager(SoSceneManager *sm)

c } c } 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