Open Inventor Reference
SoSceneManager Class Reference

Manages scene graph rendering and event handling. More...

#include <Inventor/SoSceneManager.h>

Public Member Functions

 SoSceneManager ()
 Constructor and destructor.
 
virtual ~SoSceneManager ()
 Constructor and destructor.
 
virtual void render (bool clearWindow=TRUE, bool clearZbuffer=TRUE)
 Apply an SoGLRenderAction to the scene graph managed here.
 
virtual bool processEvent (const SoEvent *event)
 Process the passed event by applying an SoHandleEventAction to the scene graph managed here.
 
void reinitialize ()
 Reinitialize graphics.
 
void scheduleRedraw ()
 Schedule a redraw for some time in the near future.
 
virtual void setSceneGraph (SoNode *newScene)
 Set the scene graph which is managed here.
 
virtual SoNodegetSceneGraph () const
 Get the scene graph which is managed here.
 
void setWindowSize (const SbVec2s &newSize)
 Set the size of the window in which the scene manager should render.
 
const SbVec2sgetWindowSize () const
 Get the size of the window in which the scene manager should render.
 
void setSize (const SbVec2s &newSize)
 Set the size of the viewport within the window.
 
const SbVec2sgetSize () const
 Get the size and origin of the viewport within the window.
 
void setOrigin (const SbVec2s &newOrigin)
 Set the origin of the viewport within the window.
 
const SbVec2sgetOrigin () const
 Get the origin of the viewport within the window.
 
void setViewportRegion (const SbViewportRegion &newRegion)
 Sets current viewport region to use for rendering.
 
const SbViewportRegiongetViewportRegion () const
 Gets current viewport region to use for rendering.
 
void setBackgroundColor (const SbColor &c)
 Set the window background color when in RGB mode.
 
const SbColorgetBackgroundColor () const
 Get the window background color when in RGB mode.
 
virtual void activate ()
 Activate the scene manager.
 
virtual void deactivate ()
 Deactivate the scene manager.
 
void setRenderCallback (SoSceneManagerRenderCB *f, void *userData=NULL)
 The render callback provides a mechanism for automatically redrawing the scene in response to changes in the scene graph.
 
bool isAutoRedraw () const
 Returns TRUE if there is currently a render callback registered.
 
void setRedrawPriority (uint32_t priority)
 Set the priority of the redraw sensor.
 
uint32_t getRedrawPriority () const
 Get the priority of the redraw sensor.
 
void setAntialiasing (bool smoothing, int numPasses)
 Set the antialiasing for rendering.
 
void getAntialiasing (bool &smoothing, int &numPasses) const
 Get the antialiasing for rendering.
 
void setGLRenderAction (SoGLRenderAction *ra)
 User supplied render action.
 
SoGLRenderActiongetGLRenderAction () const
 
void setHandleEventAction (SoHandleEventAction *hea)
 User supplied handle event action.
 
SoHandleEventActiongetHandleEventAction () const
 

Static Public Member Functions

static uint32_t getDefaultRedrawPriority ()
 Get the default priority of the redraw sensor.
 
static void enableRealTimeUpdate (bool flag)
 Enable/Disable the realTime global field update which normally happen right after a redraw.
 
static bool isRealTimeUpdateEnabled ()
 Enable/Disable the realTime global field update which normally happen right after a redraw.
 

Protected Member Functions

bool isActive () const
 
void redraw ()
 This tells the app it is time to redraw by invoking the renderCB.
 

Protected Attributes

SoSceneManagerRenderCBrenderCB
 
void * renderCBData
 

Detailed Description

SoSceneManager provides Inventor rendering and event handling inside a window provided by the caller. The scene manager is able to render in only a portion of a window if desired. The SoQtRenderArea class employs a SoSceneManager, and handles most all the details for setting up a window, converting X events to Inventor events, automatically redrawing the scene when necessary, and so on. It is simplest to use a render area when rendering in an entire window. The SoSceneManager class is available for programmers not working with the SoQt library.

See Also
SoXtRenderArea, SoGLRenderAction, SoHandleEventAction

Definition at line 97 of file SoSceneManager.h.

Constructor & Destructor Documentation

◆ SoSceneManager()

SoSceneManager::SoSceneManager ( )

◆ ~SoSceneManager()

virtual SoSceneManager::~SoSceneManager ( )
virtual

Member Function Documentation

◆ activate()

virtual void SoSceneManager::activate ( )
virtual

The scene manager will only employ sensors for automatic redraw while it is active. Typically, the scene manager should be activated whenever its window is visible on the screen, and deactivated when its window is closed or iconified.

◆ deactivate()

virtual void SoSceneManager::deactivate ( )
virtual

◆ enableRealTimeUpdate()

static void SoSceneManager::enableRealTimeUpdate ( bool  flag)
static

◆ getAntialiasing()

void SoSceneManager::getAntialiasing ( bool &  smoothing,
int &  numPasses 
) const

◆ getBackgroundColor()

const SbColor & SoSceneManager::getBackgroundColor ( ) const
inline

Definition at line 164 of file SoSceneManager.h.

◆ getDefaultRedrawPriority()

static uint32_t SoSceneManager::getDefaultRedrawPriority ( )
inlinestatic

Definition at line 199 of file SoSceneManager.h.

◆ getGLRenderAction()

SoGLRenderAction * SoSceneManager::getGLRenderAction ( ) const
inline

Definition at line 228 of file SoSceneManager.h.

◆ getHandleEventAction()

SoHandleEventAction * SoSceneManager::getHandleEventAction ( ) const
inline

Definition at line 235 of file SoSceneManager.h.

◆ getOrigin()

const SbVec2s & SoSceneManager::getOrigin ( ) const

◆ getRedrawPriority()

uint32_t SoSceneManager::getRedrawPriority ( ) const

◆ getSceneGraph()

virtual SoNode * SoSceneManager::getSceneGraph ( ) const
virtual

◆ getSize()

const SbVec2s & SoSceneManager::getSize ( ) const

◆ getViewportRegion()

const SbViewportRegion & SoSceneManager::getViewportRegion ( ) const

◆ getWindowSize()

const SbVec2s & SoSceneManager::getWindowSize ( ) const

◆ isActive()

bool SoSceneManager::isActive ( ) const
inlineprotected

Definition at line 240 of file SoSceneManager.h.

◆ isAutoRedraw()

bool SoSceneManager::isAutoRedraw ( ) const
inline

Definition at line 188 of file SoSceneManager.h.

◆ isRealTimeUpdateEnabled()

static bool SoSceneManager::isRealTimeUpdateEnabled ( )
inlinestatic

Definition at line 206 of file SoSceneManager.h.

◆ processEvent()

virtual bool SoSceneManager::processEvent ( const SoEvent event)
virtual

Returns TRUE if the event was handled by a node.

◆ redraw()

void SoSceneManager::redraw ( )
protected

◆ reinitialize()

void SoSceneManager::reinitialize ( )

This should be called, for instance, when there is a new window.

◆ render()

virtual void SoSceneManager::render ( bool  clearWindow = TRUE,
bool  clearZbuffer = TRUE 
)
virtual

The caller is responsible for setting up a window to render into. If clearWindow is TRUE, this clears the graphics window before rendering. If clearZbuffer is TRUE, the z buffer will be cleared before rendering.

◆ scheduleRedraw()

void SoSceneManager::scheduleRedraw ( )

If there is no render callback set, or this is not active, no redraw will be scheduled.

◆ setAntialiasing()

void SoSceneManager::setAntialiasing ( bool  smoothing,
int  numPasses 
)

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.

◆ setBackgroundColor()

void SoSceneManager::setBackgroundColor ( const SbColor c)

This is the color the scene manager viewport is cleared to when render() is called with clearWindow set to TRUE. Default is black (0,0,0).

◆ setGLRenderAction()

void SoSceneManager::setGLRenderAction ( SoGLRenderAction ra)

Highlights fall into this category. SceneManager will never delete a render action passed to this method.

◆ setHandleEventAction()

void SoSceneManager::setHandleEventAction ( SoHandleEventAction hea)

This should not be done in the middle of event handling. Passing NULL turns event handling off. SceneManager will never delete a handle event action passed to this method.

◆ setOrigin()

void SoSceneManager::setOrigin ( const SbVec2s newOrigin)

Default is to render the entire window region. The origin (0,0) is the lower left corner of the window.

◆ setRedrawPriority()

void SoSceneManager::setRedrawPriority ( uint32_t  priority)

Sensors are processed based on priority, with priority values of 0 processed immediately. The default priority for the scene manager redraw sensor is 10000.

◆ setRenderCallback()

void SoSceneManager::setRenderCallback ( SoSceneManagerRenderCB f,
void *  userData = NULL 
)

The scene manager employs a sensor to monitor scene graph changes. When the sensor is triggered, the render callback registered here is invoked. The callback should set up its graphics window, then call the scene manager render() method. If the callback is set to NULL (the default), auto-redraw is turned off.

◆ setSceneGraph()

virtual void SoSceneManager::setSceneGraph ( SoNode newScene)
virtual

This is the Inventor scene which will be traversed for rendering and event processing.

◆ setSize()

void SoSceneManager::setSize ( const SbVec2s newSize)

Default is to render the entire window region.

◆ setViewportRegion()

void SoSceneManager::setViewportRegion ( const SbViewportRegion newRegion)

This can be used instead of setting the size and origin separately.

◆ setWindowSize()

void SoSceneManager::setWindowSize ( const SbVec2s newSize)

This size must be set before render() and processEvent() are called.

Member Data Documentation

◆ renderCB

SoSceneManagerRenderCB* SoSceneManager::renderCB
protected

Definition at line 238 of file SoSceneManager.h.

◆ renderCBData

void* SoSceneManager::renderCBData
protected

Definition at line 239 of file SoSceneManager.h.


The documentation for this class was generated from the following file: