.TH "SoLOD" 3 "Thu May 29 2014" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoLOD \- .PP The \fBSoLOD\fP class is used to choose a child based distance between viewer and object\&. .PP The class documentation for the \fBSoLOD\fP node class would be similar enough to that of \fBSoLevelOfDetail\fP that we will refer you to look at that one first\&. It will explain the general principles of what a level-of-detail mechanism is, and why and how to use it\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoGroup\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual \fBSoType\fP \fBgetTypeId\fP (void) const " .br .RI "\fIReturns the type identification of an object derived from a class inheriting \fBSoBase\fP\&. This is used for run-time type checking and 'downward' casting\&. \fP" .ti -1c .RI "\fBSoLOD\fP (void)" .br .ti -1c .RI "\fBSoLOD\fP (int numchildren)" .br .ti -1c .RI "virtual void \fBdoAction\fP (\fBSoAction\fP *action)" .br .ti -1c .RI "virtual void \fBcallback\fP (\fBSoCallbackAction\fP *action)" .br .ti -1c .RI "virtual void \fBGLRender\fP (\fBSoGLRenderAction\fP *action)" .br .ti -1c .RI "virtual void \fBGLRenderBelowPath\fP (\fBSoGLRenderAction\fP *action)" .br .ti -1c .RI "virtual void \fBGLRenderInPath\fP (\fBSoGLRenderAction\fP *action)" .br .ti -1c .RI "virtual void \fBGLRenderOffPath\fP (\fBSoGLRenderAction\fP *action)" .br .ti -1c .RI "virtual void \fBrayPick\fP (\fBSoRayPickAction\fP *action)" .br .ti -1c .RI "virtual void \fBgetBoundingBox\fP (\fBSoGetBoundingBoxAction\fP *action)" .br .ti -1c .RI "virtual void \fBgetPrimitiveCount\fP (\fBSoGetPrimitiveCountAction\fP *action)" .br .ti -1c .RI "virtual void \fBaudioRender\fP (\fBSoAudioRenderAction\fP *action)" .br .ti -1c .RI "virtual void \fBnotify\fP (\fBSoNotList\fP *nl)" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .ti -1c .RI "static void \fBinitClass\fP (void)" .br .in -1c .SS "Public Attributes" .in +1c .ti -1c .RI "\fBSoMFFloat\fP \fBrange\fP" .br .ti -1c .RI "\fBSoSFVec3f\fP \fBcenter\fP" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual const \fBSoFieldData\fP * \fBgetFieldData\fP (void) const " .br .ti -1c .RI "virtual \fB~SoLOD\fP ()" .br .ti -1c .RI "virtual int \fBwhichToTraverse\fP (\fBSoAction\fP *)" .br .in -1c .SS "Static Protected Member Functions" .in +1c .ti -1c .RI "static const \fBSoFieldData\fP ** \fBgetFieldDataPtr\fP (void)" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP The \fBSoLOD\fP class is used to choose a child based distance between viewer and object\&. .PP The class documentation for the \fBSoLOD\fP node class would be similar enough to that of \fBSoLevelOfDetail\fP that we will refer you to look at that one first\&. It will explain the general principles of what a level-of-detail mechanism is, and why and how to use it\&. (The main difference between \fBSoLOD\fP and \fBSoLevelOfDetail\fP is that \fBSoLOD\fP uses the speedier 'distance-to-viewer' technique for implementing level-of-detail functionality, versus the more correct (but potentially slower) 'projected-bbox-area' technique used by \fBSoLevelOfDetail\fP\&.) .PP Here's a mockup example (in Inventor file format style, but easily converted to code) that shows how to use this node: .PP .PP .nf LOD { range [ 10, 20, 30, 40 ] Sphere { } Cylinder { } Cone { } Cube { } Info { } } .fi .PP .PP For the sub-scenegraph above, when the LOD-object is less than 10 units away from the viewpoint camera, an \fBSoSphere\fP will be shown\&. For distances 10 - 20 units away, this will be changed to the \fBSoCylinder\fP, and so on\&. For distances of \fImore\fP than 40 units from the camera, an \fBSoInfo\fP node will be traversed / rendered -- ie, nothing will be shown\&. (This is a common 'trick' used to optimize rendering when models get far enough away from the camera that we want to remove them completely)\&. .PP Note that when using an \fBSoOrthographicCamera\fP in the examiner viewers of the SoQt, SoWin and SoXt libraries, it will seem like the \fBSoLOD\fP node is not working when using the 'Zoom' functionality\&. What happens is that an \fBSoOrthographicCamera\fP is not actually moved, the 'zoom' effect is accomplished simply by changing its height-of-view setting (i\&.e\&. the value of the \fBSoOrthographicCamera::height\fP field), but its position remains constant\&. So the distance to the camera will not change, which means \fBSoLOD\fP will pick the same child, no matter how much one 'zooms'\&. .PP (The \fBSoLevelOfDetail\fP node uses the screen space area of the object to decide when to switch children, so that node will still work with \fBSoOrthographicCamera\fP\&.) .PP \fBFILE FORMAT/DEFAULTS:\fP .PP .nf LOD { center 0 0 0 range [ ] } .fi .PP .PP \fBSince:\fP .RS 4 Inventor 2\&.1 .RE .PP \fBSee also:\fP .RS 4 \fBSoLevelOfDetail\fP .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "SoLOD::SoLOD (void)" Default constructor\&. .SS "SoLOD::SoLOD (intnumchildren)" Constructor\&. .PP The argument should be the approximate number of children which is expected to be inserted below this node\&. The number need not be exact, as it is only used as a hint for better memory resource allocation\&. .SS "SoLOD::~SoLOD ()\fC [protected]\fP, \fC [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoLOD::getTypeId (void) const\fC [virtual]\fP" .PP Returns the type identification of an object derived from a class inheriting \fBSoBase\fP\&. This is used for run-time type checking and 'downward' casting\&. Usage example: .PP .PP .nf void foo(SoNode * node) { if (node->getTypeId() == SoFile::getClassTypeId()) { SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type } } .fi .PP .PP For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in \fIall\fP subclasses\&. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance \fBInventor/nodes/SoSubNode\&.h\fP (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine\&.h (for engine classes) and so on\&. .PP For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "const \fBSoFieldData\fP * SoLOD::getFieldData (void) const\fC [protected]\fP, \fC [virtual]\fP" Returns a pointer to the class-wide field data storage object for this instance\&. If no fields are present, returns \fCNULL\fP\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "void SoLOD::doAction (\fBSoAction\fP *action)\fC [virtual]\fP" This function performs the typical operation of a node for any action\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "void SoLOD::callback (\fBSoCallbackAction\fP *action)\fC [virtual]\fP" Action method for \fBSoCallbackAction\fP\&. .PP Simply updates the state according to how the node behaves for the render action, so the application programmer can use the \fBSoCallbackAction\fP for extracting information about the scene graph\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "void SoLOD::GLRender (\fBSoGLRenderAction\fP *action)\fC [virtual]\fP" Action method for the \fBSoGLRenderAction\fP\&. .PP This is called during rendering traversals\&. Nodes influencing the rendering state in any way or who wants to throw geometry primitives at OpenGL overrides this method\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "void SoLOD::GLRenderBelowPath (\fBSoGLRenderAction\fP *action)\fC [virtual]\fP" Implements the SoAction::BELOW_PATH traversal method for the rendering action\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "void SoLOD::GLRenderInPath (\fBSoGLRenderAction\fP *action)\fC [virtual]\fP" Implements the SoAction::IN_PATH traversal method for the rendering action\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "void SoLOD::GLRenderOffPath (\fBSoGLRenderAction\fP *action)\fC [virtual]\fP" Implements the SoAction::OFF_PATH traversal method for the rendering action\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "void SoLOD::rayPick (\fBSoRayPickAction\fP *action)\fC [virtual]\fP" Action method for \fBSoRayPickAction\fP\&. .PP Checks the ray specification of the \fIaction\fP and tests for intersection with the data of the node\&. .PP Nodes influencing relevant state variables for how picking is done also overrides this method\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "void SoLOD::getBoundingBox (\fBSoGetBoundingBoxAction\fP *action)\fC [virtual]\fP" Action method for the \fBSoGetBoundingBoxAction\fP\&. .PP Calculates bounding box and center coordinates for node and modifies the values of the \fIaction\fP to encompass the bounding box for this node and to shift the center point for the scene more towards the one for this node\&. .PP Nodes influencing how geometry nodes calculates their bounding box also overrides this method to change the relevant state variables\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "void SoLOD::getPrimitiveCount (\fBSoGetPrimitiveCountAction\fP *action)\fC [virtual]\fP" Action method for the \fBSoGetPrimitiveCountAction\fP\&. .PP Calculates the number of triangle, line segment and point primitives for the node and adds these to the counters of the \fIaction\fP\&. .PP Nodes influencing how geometry nodes calculates their primitive count also overrides this method to change the relevant state variables\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "void SoLOD::audioRender (\fBSoAudioRenderAction\fP *action)\fC [virtual]\fP" Action method for \fBSoAudioRenderAction\fP\&. .PP Does common processing for \fBSoAudioRenderAction\fP \fIaction\fP instances\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "void SoLOD::notify (\fBSoNotList\fP *l)\fC [virtual]\fP" Notifies all auditors for this instance when changes are made\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "int SoLOD::whichToTraverse (\fBSoAction\fP *action)\fC [protected]\fP, \fC [virtual]\fP" Returns the child to traverse based on the ranges in \fBSoLOD::range\fP\&. Will clamp to index to the number of children\&. This method will return -1 if no child should be traversed\&. This will only happen if the node has no children though\&. .SH "Member Data Documentation" .PP .SS "\fBSoMFFloat\fP SoLOD::range" The distance ranges which decides when to use each child for traversal / rendering\&. See usage example in main class documentation of \fBSoLOD\fP for an explanation of how this vector should be set up correctly\&. .PP By default this vector just contains a single value 0\&.0f\&. .SS "\fBSoSFVec3f\fP SoLOD::center" This vector represents an offset within the object from the geometric center point to the center point the application programmer would actually like the distance between the viewer and the object to be calculated from\&. .PP Default value is [0, 0, 0]\&. It is usually not necessary to change this field\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.