NutsnBolts
0.1.0
An extension library for Coin
|
Extends the SoSceneManager class with more high-level viewer related functionality. More...
#include <NutsnBolts/NbSceneManager.h>
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 NbNavigationSystem * | getNavigationSystem (void) const |
virtual float | getNearPlaneValue (void) const |
RenderMode | getRenderMode (void) const |
virtual SoNode * | getSceneGraph (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) |
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.
This enum defines the autoclipping strategies that the NbSceneManager can handle.
This enum defines the available strategies for combining camera navigation and scene interaction when listening to SoEvent objects.
This enum defines the various rendering styles that are supported by the NbSceneManager class.
This enum defines the various stereo mode rendering strategies supported by the NbSceneManager class.
NbSceneManager::NbSceneManager | ( | void | ) |
Constructor.
|
virtual |
Destructor
|
virtual |
Overloaded in case of future developments.
See SoSceneManager::activate().
|
virtual |
Overloaded in case of future developments.
See SoSceneManager::deactivate().
|
virtual |
This method returns the current autoclipping strategy.
SoCamera * NbSceneManager::getCamera | ( | void | ) | const |
Returns the current camera.
|
virtual |
This method returns which state the camera navigation system is in.
|
virtual |
This method returns the current navigation system in use. NULL means that no navigation system is in use.
|
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.
NbSceneManager::RenderMode NbSceneManager::getRenderMode | ( | void | ) | const |
Returns the current render mode.
|
virtual |
Overloaded in case of future developments.
See SoSceneManager::getSceneGraph().
NbSceneManager::StereoMode NbSceneManager::getStereoMode | ( | void | ) | const |
Returns the current stereo mode.
float NbSceneManager::getStereoOffset | ( | void | ) | const |
Returns the current stereo offset.
const SbColor & NbSceneManager::getWireframeOverlayColor | ( | void | ) | const |
Returns the WIREFRAME_OVERLAY line color.
SbBool NbSceneManager::isTexturesEnabled | ( | void | ) | const |
Returns whether textures are enabled or not.
|
virtual |
Overloaded from SoSceneManager to handle viewer navigation.
|
virtual |
This method sets the scene manager's autoclipping strategy.
Default setting is NbSceneManager::VARIABLE_NEAR_PLANE.
|
virtual |
Sets the camera to be used. If you do not set a camera, the scene manager will search for one by itself.
|
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.
|
virtual |
This method sets the navigation system to use.
|
virtual |
When the NbSceneManager::FIXED_NEAR_PLANE autoclipping strategy is used, you set the value of the near plane distance with this method.
|
virtual |
Sets the render mode. Defaults to AS_IS.
|
virtual |
Overloaded in case of future developments.
See SoSceneManager::setSceneGraph().
|
virtual |
Sets the stereo rendering mode. Defaults to MONO.
|
virtual |
Sets the stereo offset - the distance between the viewpoint each eye uses - used when doing stereo rendering. Defaults to 0.1.
|
virtual |
Enable/disable textures when rendering. Defaults to TRUE.
|
virtual |
Sets the color of the lines in WIREFRAME_OVERLAY rendering mode. Defaults to red [1.0 0.0 0.0].