NutsnBolts  0.1.0
An extension library for Coin
Loading...
Searching...
No Matches
NbSceneManager Class Reference

Extends the SoSceneManager class with more high-level viewer related functionality. More...

#include <NutsnBolts/NbSceneManager.h>

Inheritance diagram for NbSceneManager:
SoSceneManager

Public Types

enum  AutoClippingStrategy { NO_AUTO_CLIPPING , FIXED_NEAR_PLANE , VARIABLE_NEAR_PLANE }
 
enum  NavigationState { NO_NAVIGATION , JUST_NAVIGATION , MIXED_NAVIGATION }
 
enum  RenderMode {
  AS_IS , WIREFRAME , POINTS , WIREFRAME_OVERLAY ,
  HIDDEN_LINE , BOUNDING_BOX
}
 
enum  StereoMode {
  MONO , RED_CYAN , RED_BLUE , QUAD_BUFFER ,
  INTERLEAVED_ROWS , INTERLEAVED_COLUMNS
}
 

Public Member Functions

 NbSceneManager (void)
 
virtual ~NbSceneManager (void)
 
virtual void activate (void)
 
virtual void deactivate (void)
 
virtual AutoClippingStrategy getAutoClipping (void) const
 
SoCamera * getCamera (void) const
 
virtual NavigationState getNavigationState (void) const
 
virtual NbNavigationSystemgetNavigationSystem (void) const
 
virtual float getNearPlaneValue (void) const
 
RenderMode getRenderMode (void) const
 
virtual SoNodegetSceneGraph (void) const
 
StereoMode getStereoMode (void) const
 
float getStereoOffset (void) const
 
const SbColor & getWireframeOverlayColor (void) const
 
SbBool isTexturesEnabled (void) const
 
virtual SbBool processEvent (const SoEvent *const event)
 
virtual void render (const SbBool clearwindow=TRUE, const SbBool clearzbuffer=TRUE)
 
virtual void render (SoGLRenderAction *action, const SbBool initmatrices=TRUE, const SbBool clearwindow=TRUE, const SbBool clearzbuffer=TRUE)
 
virtual void setAutoClipping (AutoClippingStrategy strategy)
 
virtual void setCamera (SoCamera *camera)
 
virtual void setNavigationState (NavigationState state)
 
virtual void setNavigationSystem (NbNavigationSystem *system)
 
virtual void setNearPlaneValue (float value)
 
virtual void setRenderMode (RenderMode mode)
 
virtual void setSceneGraph (SoNode *const root)
 
virtual void setStereoMode (StereoMode mode)
 
virtual void setStereoOffset (float offset)
 
virtual void setTexturesEnabled (const SbBool onoff)
 
virtual void setWireframeOverlayColor (const SbColor &color)
 

Detailed Description

Extends the SoSceneManager class with more high-level viewer related functionality.

The NbSceneManager class extends the SoSceneManger class with functionality that relates to scene graphs and rendering on a higher level. By using a scene manager of this type instead of the standard SoSceneManager, you can easily get more advanced viewer functionality connected to a custom GL context you've created yourself instead of having to resort to one of SoQt/SoWin/SoXts viewer components.

Currently, the functionality this class adds to the SoSceneManager can be categorized into three groups:

One set of functions lets you control the rendering style. These are setRenderMode(), setTexturesEnabled(), and setWireframeOverlayColor().

Another set of functions implements support for various stereo rendering techniques. These are setStereoMode() and setStereoOffset().

The third group of functions is for incorporating a system for handling/intercepting SoEvent objects for doing user-interactive camera navigation. These are setNavigationState(), setNavigationSystem(), setAutoClipping(), and setNearPlaneValue(). The first two control how user events control camera navigation. The latter two control how camera movements / scene changes affect the clipping planes the camera uses. Moving the camera, you will often need the clipping planes to get updated...

You will also notice that all the other virtual functions in the SoSceneManager class are overridden. This is done because some of them are modified to implement the above mentioned functionality, and the rest of them might be necessary to override later when more functionality is added, and we would like to be able to do that without breaking binary compatibility and having to bump the major version of the library for the next release.

Member Enumeration Documentation

◆ AutoClippingStrategy

This enum defines the autoclipping strategies that the NbSceneManager can handle.

◆ NavigationState

This enum defines the available strategies for combining camera navigation and scene interaction when listening to SoEvent objects.

◆ RenderMode

This enum defines the various rendering styles that are supported by the NbSceneManager class.

◆ StereoMode

This enum defines the various stereo mode rendering strategies supported by the NbSceneManager class.

Constructor & Destructor Documentation

◆ NbSceneManager()

NbSceneManager::NbSceneManager ( void )

Constructor.

◆ ~NbSceneManager()

NbSceneManager::~NbSceneManager ( void )
virtual

Destructor

Member Function Documentation

◆ activate()

void NbSceneManager::activate ( void )
virtual

Overloaded in case of future developments.

See SoSceneManager::activate().

◆ deactivate()

void NbSceneManager::deactivate ( void )
virtual

Overloaded in case of future developments.

See SoSceneManager::deactivate().

◆ getAutoClipping()

NbSceneManager::AutoClippingStrategy NbSceneManager::getAutoClipping ( void ) const
virtual

This method returns the current autoclipping strategy.

See also
setAutoClipping

◆ getCamera()

SoCamera * NbSceneManager::getCamera ( void ) const

Returns the current camera.

See also
setCamera

◆ getNavigationState()

NbSceneManager::NavigationState NbSceneManager::getNavigationState ( void ) const
virtual

This method returns which state the camera navigation system is in.

See also
NbSceneManager::NavigationState, setNavigationState

◆ getNavigationSystem()

NbNavigationSystem * NbSceneManager::getNavigationSystem ( void ) const
virtual

This method returns the current navigation system in use. NULL means that no navigation system is in use.

See also
NbNavigationSystem, setNavigationSystem

◆ getNearPlaneValue()

float NbSceneManager::getNearPlaneValue ( void ) const
virtual

This method returns the near plane distance value that will be used when the NbSceneManager::FIXED_NEAR_PLANE autoclipping strategy is used.

Default value is 0.6.

See also
setAutoClipping, setNearPlaneValue, NbSceneManager::AutoClippingStrategy

◆ getRenderMode()

NbSceneManager::RenderMode NbSceneManager::getRenderMode ( void ) const

Returns the current render mode.

See also
NbSceneManager::RenderMode, setRenderMode

◆ getSceneGraph()

SoNode * NbSceneManager::getSceneGraph ( void ) const
virtual

Overloaded in case of future developments.

See SoSceneManager::getSceneGraph().

◆ getStereoMode()

NbSceneManager::StereoMode NbSceneManager::getStereoMode ( void ) const

Returns the current stereo mode.

See also
setStereoMode

◆ getStereoOffset()

float NbSceneManager::getStereoOffset ( void ) const

Returns the current stereo offset.

See also
setStereoOffset

◆ getWireframeOverlayColor()

const SbColor & NbSceneManager::getWireframeOverlayColor ( void ) const

Returns the WIREFRAME_OVERLAY line color.

See also
setWireframeOverlayColor

◆ isTexturesEnabled()

SbBool NbSceneManager::isTexturesEnabled ( void ) const

Returns whether textures are enabled or not.

See also
setTexturesEnabled

◆ processEvent()

SbBool NbSceneManager::processEvent ( const SoEvent *const event)
virtual

Overloaded from SoSceneManager to handle viewer navigation.

◆ setAutoClipping()

void NbSceneManager::setAutoClipping ( AutoClippingStrategy strategy)
virtual

This method sets the scene manager's autoclipping strategy.

Default setting is NbSceneManager::VARIABLE_NEAR_PLANE.

See also
NbSceneManager::AutoClippingStrategy, getAutoClipping, setNearPlaneValue, getNearPlaneValue

◆ setCamera()

void NbSceneManager::setCamera ( SoCamera * camera)
virtual

Sets the camera to be used. If you do not set a camera, the scene manager will search for one by itself.

See also
getCamera

◆ setNavigationState()

void NbSceneManager::setNavigationState ( NavigationState state)
virtual

This method sets the navigation mode of the scene manager. The navigation mode determines the system the user uses to navigate the 3D model.

NbSceneManager::NO_NAVIGATION is the default setting.

See also
NbSceneManager::NavigationState, getNavigationState

◆ setNavigationSystem()

void NbSceneManager::setNavigationSystem ( NbNavigationSystem * system)
virtual

This method sets the navigation system to use.

See also
NbNavigationSystem, getNavigationSystem

◆ setNearPlaneValue()

void NbSceneManager::setNearPlaneValue ( float value)
virtual

When the NbSceneManager::FIXED_NEAR_PLANE autoclipping strategy is used, you set the value of the near plane distance with this method.

See also
setAutoClipping, getNearPlaneValue, NbSceneManager::AutoClippingStrategy

◆ setRenderMode()

void NbSceneManager::setRenderMode ( RenderMode mode)
virtual

Sets the render mode. Defaults to AS_IS.

See also
NbSceneManager::RenderMode, getRenderMode

◆ setSceneGraph()

void NbSceneManager::setSceneGraph ( SoNode *const root)
virtual

Overloaded in case of future developments.

See SoSceneManager::setSceneGraph().

◆ setStereoMode()

void NbSceneManager::setStereoMode ( StereoMode mode)
virtual

Sets the stereo rendering mode. Defaults to MONO.

See also
getStereoMode

◆ setStereoOffset()

void NbSceneManager::setStereoOffset ( float offset)
virtual

Sets the stereo offset - the distance between the viewpoint each eye uses - used when doing stereo rendering. Defaults to 0.1.

See also
getStereoOffset

◆ setTexturesEnabled()

void NbSceneManager::setTexturesEnabled ( const SbBool onoff)
virtual

Enable/disable textures when rendering. Defaults to TRUE.

See also
isTexturesEnabled

◆ setWireframeOverlayColor()

void NbSceneManager::setWireframeOverlayColor ( const SbColor & color)
virtual

Sets the color of the lines in WIREFRAME_OVERLAY rendering mode. Defaults to red [1.0 0.0 0.0].

See also
getWireframeOverlayColor

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