Open Inventor Reference
SoSeparator Class Reference

Group node that saves and restores traversal state. More...

#include <Inventor/nodes/SoSeparator.h>

Inheritance diagram for SoSeparator:
SoGroup SoNode SoFieldContainer SoBase SoAnnotation SoLocateHighlight SoSelection SoWWWAnchor

List of all members.

Public Types

enum  CacheEnabled { OFF, ON, AUTO }
 Possible values for caching. More...

Public Member Functions

 SoSeparator ()
 Creates a separator node with default settings.
 SoSeparator (int nChildren)
 Constructor that takes approximate number of children.
virtual SbBool affectsState () const
 Overrides default method on SoNode.
virtual void doAction (SoAction *action)
 Implement actions.
virtual void callback (SoCallbackAction *action)
virtual void getBoundingBox (SoGetBoundingBoxAction *action)
virtual void getMatrix (SoGetMatrixAction *action)
virtual void GLRender (SoGLRenderAction *action)
 These virtual functions implement all of the actions for nodes, Most of the default implementations do nothing.
virtual void handleEvent (SoHandleEventAction *action)
virtual void rayPick (SoRayPickAction *action)
virtual void search (SoSearchAction *action)
virtual void GLRenderBelowPath (SoGLRenderAction *action)
 These methods make render traversal faster by implementing different rendering paths corresponding to different action path codes.
virtual void GLRenderInPath (SoGLRenderAction *action)
virtual void GLRenderOffPath (SoGLRenderAction *action)
virtual void notify (SoNotList *list)
 Propagates modification notification through an instance.

Static Public Member Functions

static void setNumRenderCaches (int howMany)
 By default, each separator node maintains 2 render caches.
static int getNumRenderCaches ()
 Returns the current number of render caches.
static void initClass ()
 Initializes base node class.

Public Attributes

Fields
SoSFEnum renderCaching
 Whether to cache during rendering traversal.
SoSFEnum boundingBoxCaching
 Whether to cache during bounding box traversal.
SoSFEnum renderCulling
 Whether to cull during rendering traversal.
SoSFEnum pickCulling
 Whether to cull during picking traversal.

Protected Member Functions

virtual SbBool cullTest (SoGLRenderAction *action, int &cullResults)
 Returns TRUE if this separator can be culled because it is outside the cull volume.
virtual SbBool readInstance (SoInput *in, unsigned short flags)
 Reads stuff into instance of SoGroup. Returns FALSE on error.
virtual ~SoSeparator ()

Detailed Description

This group node performs a push (save) of the traversal state before traversing its children and a pop (restore) after traversing them. This isolates the separator's children from the rest of the scene graph. A separator can include lights, cameras, coordinates, normals, bindings, and all other properties. Separators are relatively inexpensive, so they can be used freely within scenes.

The SoSeparator node provides caching of state during rendering and bounding box computation. This feature can be enabled by setting the renderCaching and boundingBoxCaching fields. By default, these are set to AUTO, which means that Inventor decides whether to build a cache based on internal heuristics.

Separators can also perform culling during rendering and picking. Culling skips over traversal of the separator's children if they are not going to be rendered or picked, based on the comparison of the separator's bounding box with the current view volume. Culling is controlled by the renderCulling and pickCulling fields. These are also set to AUTO by default; however, render culling can be expensive (and can interfere with render caching), so the AUTO heuristics leave it disabled unless specified otherwise.

File Format/Default
Action Behavior
SoGLRenderAction, SoCallbackAction, SoGetBoundingBoxAction, SoGetMatrixAction, SoHandleEventAction, SoRayPickAction, SoSearchAction
Saves the current traversal state, traverses all children, and restores the previous traversal state.
See Also
SoSelection, SoTransformSeparator

Definition at line 118 of file SoSeparator.h.


Member Enumeration Documentation

Enumerator:
OFF 

Never build or use a cache.

ON 

Always try to build a cache.

AUTO 

Decide based on some heuristic.

Definition at line 125 of file SoSeparator.h.


Constructor & Destructor Documentation

SoSeparator::SoSeparator ( )
SoSeparator::SoSeparator ( int  nChildren)
virtual SoSeparator::~SoSeparator ( ) [protected, virtual]

Member Function Documentation

virtual SbBool SoSeparator::affectsState ( ) const [virtual]

Reimplemented from SoNode.

virtual void SoSeparator::callback ( SoCallbackAction action) [virtual]

Reimplemented from SoGroup.

virtual SbBool SoSeparator::cullTest ( SoGLRenderAction action,
int &  cullResults 
) [protected, virtual]

The cullResults flags come from the GLRenderAction->getCullTestResults() method, and track the results of previous cull tests to save work when we know we're completely inside the view volume.

virtual void SoSeparator::doAction ( SoAction action) [virtual]

Reimplemented from SoGroup.

virtual void SoSeparator::getBoundingBox ( SoGetBoundingBoxAction action) [virtual]

Reimplemented from SoGroup.

virtual void SoSeparator::getMatrix ( SoGetMatrixAction action) [virtual]

Reimplemented from SoGroup.

static int SoSeparator::getNumRenderCaches ( ) [static]
virtual void SoSeparator::GLRender ( SoGLRenderAction action) [virtual]

Reimplemented from SoGroup.

virtual void SoSeparator::GLRenderBelowPath ( SoGLRenderAction action) [virtual]

Reimplemented from SoNode.

Reimplemented in SoAnnotation, and SoLocateHighlight.

virtual void SoSeparator::GLRenderInPath ( SoGLRenderAction action) [virtual]

Reimplemented from SoNode.

Reimplemented in SoAnnotation, and SoLocateHighlight.

virtual void SoSeparator::GLRenderOffPath ( SoGLRenderAction action) [virtual]

Reimplemented from SoNode.

virtual void SoSeparator::handleEvent ( SoHandleEventAction action) [virtual]

Reimplemented from SoGroup.

Reimplemented in SoLocateHighlight, SoWWWAnchor, and SoSelection.

static void SoSeparator::initClass ( ) [static]

Reimplemented from SoGroup.

Reimplemented in SoAnnotation, SoLocateHighlight, SoWWWAnchor, and SoSelection.

virtual void SoSeparator::notify ( SoNotList list) [virtual]

Reimplemented from SoNode.

virtual void SoSeparator::rayPick ( SoRayPickAction action) [virtual]

Reimplemented from SoNode.

virtual SbBool SoSeparator::readInstance ( SoInput in,
unsigned short  flags 
) [protected, virtual]

Reimplemented from SoGroup.

virtual void SoSeparator::search ( SoSearchAction action) [virtual]

Reimplemented from SoGroup.

static void SoSeparator::setNumRenderCaches ( int  howMany) [static]

(This is to allow two different representations, such as filled and wire-frame, to both be cached.) The setNumRenderCaches() method sets the number of render caches each separator will have. Each render cache uses memory, so increasing this number may increase the memory requirements of the application. This method affects only separators that are created after it is called, not separators that were created before. Setting the number of caches to 0 turns off render caching globally from then on.


Member Data Documentation

Definition at line 144 of file SoSeparator.h.


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