Open Inventor Reference
|
Distance-based level-of-detail switching group node. More...
#include <Inventor/nodes/SoLOD.h>
Public Member Functions | |
SoLOD () | |
Creates a distance-based level-of-detail node with default settings. | |
SoLOD (int nChildren) | |
Creates a distance-based level-of-detail node with default settings. | |
virtual void | doAction (SoAction *action) |
Implement actions: | |
virtual void | callback (SoCallbackAction *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 | rayPick (SoRayPickAction *action) |
virtual void | getBoundingBox (SoGetBoundingBoxAction *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) |
Static Public Member Functions | |
static void | initClass () |
Initializes base node class. | |
Public Attributes | |
Fields | |
SoMFFloat | range |
World-space distances to use as switching criteria. | |
SoSFVec3f | center |
Object-space center of the model. | |
Protected Member Functions | |
virtual | ~SoLOD () |
virtual int | whichToTraverse (SoAction *) |
This group node is used to allow applications to switch between various representations of objects automatically. The children of this node typically represent the same object or objects at varying levels of detail, from highest detail to lowest. The distance from the world-space eye point to the transformed center of the LOD is computed, and one child is drawn, based on the values in the ranges field.
More precisely, if the distance from the world-space eyepoint to the transformed center is D and the ranges array contains LAST_RANGE+1 values (numbered 0...LAST_RANGE), then:
if D < ranges[0] : Child 0 is drawn else if ranges[i-1] < D < ranges[i] : Child i is drawn else if D > ranges[LAST_RANGE] : Child LAST_RANGE+1 is drawn
Thus, N ranges and N+1 children should be specified. If you specify too few children, the last child will be used for the extra ranges. If you specify too few ranges, the extra children will never be used.
It is often useful to define the lowest detail child to be an SoInfo node. This causes the object to completely disappear if it is far enough away from the eyepoint. Defining the highest detail child to be an SoInfo node can also be useful if you want the object to disappear if it gets too close to the eyepoint.
SoLOD::SoLOD | ( | ) |
SoLOD::SoLOD | ( | int | nChildren | ) |
virtual SoLOD::~SoLOD | ( | ) | [protected, virtual] |
virtual void SoLOD::callback | ( | SoCallbackAction * | action | ) | [virtual] |
Reimplemented from SoGroup.
virtual void SoLOD::getBoundingBox | ( | SoGetBoundingBoxAction * | action | ) | [virtual] |
Reimplemented from SoGroup.
virtual void SoLOD::GLRender | ( | SoGLRenderAction * | action | ) | [virtual] |
Reimplemented from SoGroup.
virtual void SoLOD::GLRenderBelowPath | ( | SoGLRenderAction * | action | ) | [virtual] |
Reimplemented from SoNode.
virtual void SoLOD::GLRenderInPath | ( | SoGLRenderAction * | action | ) | [virtual] |
Reimplemented from SoNode.
virtual void SoLOD::GLRenderOffPath | ( | SoGLRenderAction * | action | ) | [virtual] |
Reimplemented from SoNode.
static void SoLOD::initClass | ( | ) | [static] |
Reimplemented from SoGroup.
virtual void SoLOD::rayPick | ( | SoRayPickAction * | action | ) | [virtual] |
Reimplemented from SoNode.
virtual int SoLOD::whichToTraverse | ( | SoAction * | ) | [protected, virtual] |