logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SoXtRenderArea — Xt Component for rendering Inventor scene graphs

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.

Inherits From

       SoXtComponent > SoXtGLWidget > SoXtRenderArea

Methods

SoXtRenderArea(Widgetparent=NULL,constchar*name=NULL,SbBoolbuildInsideParent=TRUE,SbBoolgetMouseInput=TRUE,SbBoolgetKeyboardInput=TRUE)~SoXtRenderArea()
          Constructor which is passed arguments which tell it whether to register the mouse and keyboard devices
          by default (SoXtMouse and SoXtKeyboard).

     virtualvoidsetSceneGraph(SoNode*newScene)virtualSoNode*getSceneGraph()
          Set/get the scene graph to be rendered in this component's window.

     voidsetOverlaySceneGraph(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.

     voidregisterDevice(SoXtDevice*)voidunregisterDevice(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.

     voidsetBackgroundColor(constSbColor&c)constSbColor&getBackgroundColor()const
          Set/get the background color for this window. Default is black (0,0,0).

     voidsetBackgroundIndex(intindex)intgetBackgroundIndex()const
          Sets/gets the window background color when in color index mode. (default to black (index 0)).

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

     voidsetColorMap(intstartIndex,intnum,constSbColor*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.

     voidsetOverlayColorMap(intstartIndex,intnum,constSbColor*colors)
          Sets the colors to use for overlay bit planes.This will load the color map with the  given  colors  at
          the starting index.

     voidsetViewportRegion(constSbViewportRegion&newRegion)constSbViewportRegion&getViewportRegion()const
          Sets/gets current viewport region to use for rendering

     voidsetTransparencyType(SoGLRenderAction::TransparencyTypetype)SoGLRenderAction::TransparencyTypegetTransparencyType()const
          Set/get  the  quality  level  for  rendering  transparent  objects.  See SoGLRenderAction for possible
          transparency types.

     voidsetAntialiasing(SbBoolsmoothing,intnumPasses)voidgetAntialiasing(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.

     voidsetClearBeforeRender(SbBooltrueOrFalse)SbBoolisClearBeforeRender()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).

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

     voidsetAutoRedraw(SbBooltrueOrFalse)SbBoolisAutoRedraw()const
          The render area will automatically redraw whenever something in the scene graph changes. Passing FALSE
          will disable this feature.

     voidsetRedrawPriority(uint32_tpriority)uint32_tgetRedrawPriority()conststaticuint32_tgetDefaultRedrawPriority()
          Sets/gets the priority of the redraw sensor and get the default priority number.

     voidrender()voidrenderOverlay()
          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).

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

     voidredrawOnSelectionChange(SoSelection*s)voidredrawOverlayOnSelectionChange(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.

     voidsetEventCallback(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.

     voidsetGLRenderAction(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.

     voidsetOverlayGLRenderAction(SoGLRenderAction*ra)SoGLRenderAction*getOverlayGLRenderAction()const
          Sets/gets the GL render action for the overlay window.

     voidsetSceneManager(SoSceneManager*sm)SoSceneManager*getSceneManager()constvoidsetOverlaySceneManager(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.

Name

       SoXtRenderArea — Xt Component for rendering Inventor scene graphs

Resources

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

See Also

SoXtGLWidget,SoXtComponent,SoXtViewer,SoSceneManager,SoBoxHighlightRenderAction,SoLineHighlightRenderActionSoXtRenderArea(3IV)()

Synopsis

#include<Inventor/Xt/SoXtRenderArea.h>typedefSbBoolSoXtRenderAreaEventCB(void*userData,XAnyEvent*anyevent)

          Methods from class SoXtRenderArea:

                               SoXtRenderArea(Widgetparent=NULL,constchar*name=NULL,SbBoolbuildInsideParent=TRUE,SbBoolgetMouseInput=TRUE,SbBoolgetKeyboardInput=TRUE)~SoXtRenderArea()virtualvoidsetSceneGraph(SoNode*newScene)virtualSoNode*getSceneGraph()voidsetOverlaySceneGraph(SoNode*newScene)SoNode*getOverlaySceneGraph()voidregisterDevice(SoXtDevice*)voidunregisterDevice(SoXtDevice*)voidsetBackgroundColor(constSbColor&c)constSbColor&getBackgroundColor()constvoidsetBackgroundIndex(intindex)intgetBackgroundIndex()constvoidsetOverlayBackgroundIndex(intindex)intgetOverlayBackgroundIndex()constvoidsetColorMap(intstartIndex,intnum,constSbColor*colors)voidsetOverlayColorMap(intstartIndex,intnum,constSbColor*colors)voidsetViewportRegion(constSbViewportRegion&newRegion)constSbViewportRegion&getViewportRegion()constvoidsetTransparencyType(SoGLRenderAction::TransparencyTypetype)SoGLRenderAction::TransparencyTypegetTransparencyType()constvoidsetAntialiasing(SbBoolsmoothing,intnumPasses)voidgetAntialiasing(SbBool&smoothing,int&numPasses)constvoidsetClearBeforeRender(SbBooltrueOrFalse)SbBoolisClearBeforeRender()constvoidsetClearBeforeOverlayRender(SbBooltrueOrFalse)SbBoolisClearBeforeOverlayRender()constvoidsetAutoRedraw(SbBooltrueOrFalse)SbBoolisAutoRedraw()constvoidsetRedrawPriority(uint32_tpriority)uint32_tgetRedrawPriority()conststaticuint32_tgetDefaultRedrawPriority()voidrender()voidrenderOverlay()voidscheduleRedraw()voidscheduleOverlayRedraw()voidredrawOnSelectionChange(SoSelection*s)voidredrawOverlayOnSelectionChange(SoSelection*s)voidsetEventCallback(SoXtRenderAreaEventCB*fcn,void*userData=NULL)voidsetGLRenderAction(SoGLRenderAction*ra)SoGLRenderAction*getGLRenderAction()constvoidsetOverlayGLRenderAction(SoGLRenderAction*ra)SoGLRenderAction*getOverlayGLRenderAction()constvoidsetSceneManager(SoSceneManager*sm)SoSceneManager*getSceneManager()constvoidsetOverlaySceneManager(SoSceneManager*sm)SoSceneManager*getOverlaySceneManager()const

          Methods from class SoXtGLWidget:

     voidsetBorder(SbBoolonOrOff)SbBoolisBorder()constvirtualvoidsetDoubleBuffer(SbBoolonOrOff)SbBoolisDoubleBuffer()WindowgetNormalWindow()WindowgetOverlayWindow()GLXContextgetNormalContext()GLXContextgetOverlayContext()WidgetgetNormalWidget()WidgetgetOverlayWidget()virtualvoidsetNormalVisual(XVisualInfo*vis)XVisualInfo*getNormalVisual()virtualvoidsetOverlayVisual(XVisualInfo*vis)XVisualInfo*getOverlayVisual()voidsetDrawToFrontBufferEnable(SbBoolenableFlag)SbBoolisDrawToFrontBufferEnable()const

          Methods from class SoXtComponent:

     virtualvoidshow()virtualvoidhide()SbBoolisVisible()WidgetgetWidget()constSbBoolisTopLevelShell()constWidgetgetShellWidget()constWidgetgetParentWidget()constvoidsetSize(constSbVec2s&size)SbVec2sgetSize()Display*getDisplay()voidsetTitle(constchar*newTitle)constchar*getTitle()constvoidsetIconTitle(constchar*newIconTitle)constchar*getIconTitle()constvoidsetWindowCloseCallback(SoXtComponentCB*func,void*data=NULL)staticSoXtComponent*getComponent(Widgetw)constchar*getWidgetName()constconstchar*getClassName()const

See Also