Open Inventor Reference
SoComplexity Class Reference

Shape complexity node. More...

#include <Inventor/nodes/SoComplexity.h>

Inheritance diagram for SoComplexity:
SoNode SoFieldContainer SoBase

List of all members.

Public Types

enum  Type { OBJECT_SPACE = SoComplexityTypeElement::OBJECT_SPACE, SCREEN_SPACE = SoComplexityTypeElement::SCREEN_SPACE, BOUNDING_BOX = SoComplexityTypeElement::BOUNDING_BOX }

Public Member Functions

 SoComplexity ()
 Creates a complexity node with default settings.
virtual void doAction (SoAction *action)
 This method performs the "typical" operation of a node for any action.
virtual void callback (SoCallbackAction *action)
virtual void getBoundingBox (SoGetBoundingBoxAction *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 pick (SoPickAction *action)

Static Public Member Functions

static void initClass ()
 Initializes base node class.

Public Attributes

Fields
SoSFEnum type
 How shape complexity is interpreted.
SoSFFloat value
 Complexity value.
SoSFFloat textureQuality
 Hint about texture quality.

Protected Member Functions

virtual ~SoComplexity ()

Detailed Description

This node sets the current shape complexity value. This is a heuristic value which provides a hint at what geometric complexity to render shape nodes. Values range from 0 to 1, where 0 means minimum complexity and 1 means maximum complexity. Each shape node interprets complexity in its own way.

Shape complexity always affects rendering and primitive generation for the SoCallbackAction. For some shapes, it also affects picking.

There are three ways to interpret shape complexity, depending on the type field. BOUNDING_BOX complexity ignores the value field and renders all shapes as bounding boxes, using the current material, drawing style, etc. The other two types use the value field to determine the tessellation of shapes into polygons. OBJECT_SPACE complexity uses value directly to determine the tessellation. SCREEN_SPACE complexity depends on value and the projected size of the shape on the screen; a value of 0 produces the minimum tessellation for a shape, and a value of 1 produces a tessellation that is fine enough that each edge of a polygon is about 1 or two pixels in length. Since the projected size depends on the camera position, objects may be tessellated differently every frame if the camera is moving; note that this may have adverse effects on render caching in SoSeparator nodes.

The SoComplexity node also sets a hint for the quality of textures applied to shapes, based on the value of the textureQuality field. The texture quality will take effect at the next Texture2 node; Texture2 nodes previously traversed will not be affected.

File Format/Default
Complexity {
  type OBJECT_SPACE
  value 0.5
  textureQuality 0.5
}
Action Behavior
SoGLRenderAction, SoCallbackAction, SoGetBoundingBoxAction, SoRayPickAction
Sets the current complexity in the state.
See Also
SoShape, SoShapeHints, SoTexture2

Definition at line 122 of file SoComplexity.h.


Member Enumeration Documentation

Enumerator:
OBJECT_SPACE 
SCREEN_SPACE 
BOUNDING_BOX 

Definition at line 127 of file SoComplexity.h.


Constructor & Destructor Documentation

SoComplexity::SoComplexity ( )
virtual SoComplexity::~SoComplexity ( ) [protected, virtual]

Member Function Documentation

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

Reimplemented from SoNode.

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

The default implementation does nothing.

Reimplemented from SoNode.

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

Reimplemented from SoNode.

virtual void SoComplexity::GLRender ( SoGLRenderAction action) [virtual]

Reimplemented from SoNode.

static void SoComplexity::initClass ( ) [static]

Reimplemented from SoNode.

virtual void SoComplexity::pick ( SoPickAction action) [virtual]

Reimplemented from SoNode.


Member Data Documentation

A value of 0 indicates that the fastest texturing should be used, while a value of 1 indicates that the best quality texturing should be used.

Definition at line 145 of file SoComplexity.h.

Definition at line 137 of file SoComplexity.h.

Definition at line 140 of file SoComplexity.h.


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