.TH "SoVRMLLOD" 3 "Thu May 29 2014" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoVRMLLOD \- .PP The \fBSoVRMLLOD\fP class is used to represent various levels of detail based on distance\&. .PP \fBThe detailed class documentation is taken verbatim from the VRML97 standard (ISO/IEC 14772-1:1997)\&. It is copyright The Web3D Consortium, and is used by permission of the Consortium:\fP .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 "\fBSoVRMLLOD\fP (void)" .br .ti -1c .RI "\fBSoVRMLLOD\fP (int levels)" .br .ti -1c .RI "virtual SbBool \fBaffectsState\fP (void) const " .br .ti -1c .RI "void \fBaddLevel\fP (\fBSoNode\fP *\fBlevel\fP)" .br .ti -1c .RI "void \fBinsertLevel\fP (\fBSoNode\fP *\fBlevel\fP, int idx)" .br .ti -1c .RI "\fBSoNode\fP * \fBgetLevel\fP (int idx) const " .br .ti -1c .RI "int \fBfindLevel\fP (const \fBSoNode\fP *\fBlevel\fP) const " .br .ti -1c .RI "int \fBgetNumLevels\fP (void) const " .br .ti -1c .RI "void \fBremoveLevel\fP (int idx)" .br .ti -1c .RI "void \fBremoveLevel\fP (\fBSoNode\fP *\fBlevel\fP)" .br .ti -1c .RI "void \fBremoveAllLevels\fP (void)" .br .ti -1c .RI "void \fBreplaceLevel\fP (int idx, \fBSoNode\fP *\fBlevel\fP)" .br .ti -1c .RI "void \fBreplaceLevel\fP (\fBSoNode\fP *old, \fBSoNode\fP *\fBlevel\fP)" .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 \fBrayPick\fP (\fBSoRayPickAction\fP *action)" .br .ti -1c .RI "virtual void \fBgetBoundingBox\fP (\fBSoGetBoundingBoxAction\fP *action)" .br .ti -1c .RI "virtual void \fBsearch\fP (\fBSoSearchAction\fP *action)" .br .ti -1c .RI "virtual void \fBwrite\fP (\fBSoWriteAction\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 \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 "void \fBaddChild\fP (\fBSoNode\fP *child)" .br .ti -1c .RI "void \fBinsertChild\fP (\fBSoNode\fP *child, int idx)" .br .ti -1c .RI "\fBSoNode\fP * \fBgetChild\fP (int idx) const " .br .ti -1c .RI "int \fBfindChild\fP (const \fBSoNode\fP *child) const " .br .ti -1c .RI "int \fBgetNumChildren\fP (void) const " .br .ti -1c .RI "void \fBremoveChild\fP (int idx)" .br .ti -1c .RI "void \fBremoveChild\fP (\fBSoNode\fP *child)" .br .ti -1c .RI "void \fBremoveAllChildren\fP (void)" .br .ti -1c .RI "void \fBreplaceChild\fP (int idx, \fBSoNode\fP *child)" .br .ti -1c .RI "void \fBreplaceChild\fP (\fBSoNode\fP *old, \fBSoNode\fP *child)" .br .ti -1c .RI "virtual \fBSoChildList\fP * \fBgetChildren\fP (void) const " .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 .ti -1c .RI "\fBSoMFNode\fP \fBlevel\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~SoVRMLLOD\fP ()" .br .ti -1c .RI "virtual void \fBnotify\fP (\fBSoNotList\fP *list)" .br .ti -1c .RI "virtual SbBool \fBreadInstance\fP (\fBSoInput\fP *in, unsigned short flags)" .br .ti -1c .RI "virtual void \fBcopyContents\fP (const \fBSoFieldContainer\fP *from, SbBool copyConn)" .br .ti -1c .RI "virtual int \fBwhichToTraverse\fP (\fBSoAction\fP *action)" .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 \fBSoVRMLLOD\fP class is used to represent various levels of detail based on distance\&. .PP \fBThe detailed class documentation is taken verbatim from the VRML97 standard (ISO/IEC 14772-1:1997)\&. It is copyright The Web3D Consortium, and is used by permission of the Consortium:\fP .PP .nf LOD { exposedField MFNode level [] field SFVec3f center 0 0 0 # (-,) field MFFloat range [] # (0,) } .fi .PP .PP The LOD node specifies various levels of detail or complexity for a given object, and provides hints allowing browsers to automatically choose the appropriate version of the object based on the distance from the user\&. The level field contains a list of nodes that represent the same object or objects at varying levels of detail, ordered from highest level of detail to the lowest level of detail\&. The range field specifies the ideal distances at which to switch between the levels\&. Subclause 4\&.6\&.5, Grouping and children nodes (http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-VRML97/part1/concepts.html#4.6.5), contains details on the types of nodes that are legal values for level\&. .PP The center field is a translation offset in the local coordinate system that specifies the centre of the LOD node for distance calculations\&. .PP The number of nodes in the level field shall exceed the number of values in the range field by one (i\&.e\&., N+1 level values for N range values)\&. The range field contains monotonic increasing values that shall be greater than zero\&. In order to calculate which level to display, first the distance is calculated from the viewer's location, transformed into the local coordinate system of the LOD node (including any scaling transformations), to the center point of the LOD node\&. Then, the LOD node evaluates the step function L(d) to choose a level for a given value of d (where d is the distance from the viewer position to the centre of the LOD node)\&. Let n ranges, R0, R1, R2, \&.\&.\&., Rn-1, partition the domain (0, +infinity) into n+1 subintervals given by (0, R0), [R0, R1)\&.\&.\&. , [Rn-1, +infinity)\&. Also, let n levels L0, L1, L2, \&.\&.\&., Ln-1 be the values of the step function function L(d)\&. The level node, L(d), for a given distance d is defined as follows: .PP .PP .nf L(d) = L0, if d < R0, = Li+1, if Ri <= d < Ri+1, for -1 < i < n-1, = Ln-1, if d >= Rn-1. .fi .PP .PP Specifying too few levels will result in the last level being used repeatedly for the lowest levels of detail\&. If more levels than ranges are specified, the extra levels are ignored\&. An empty range field is an exception to this rule\&. This case is a hint to the browser that it may choose a level automatically to maintain a constant display rate\&. Each value in the range field shall be greater than the previous value\&. .PP LOD nodes are evaluated top-down in the scene graph\&. Only the descendants of the currently selected level are rendered\&. All nodes under an LOD node continue to receive and send events regardless of which LOD node's level is active\&. For example, if an active TimeSensor node is contained within an inactive level of an LOD node, the TimeSensor node sends events regardless of the LOD node's state\&. .SH "Constructor & Destructor Documentation" .PP .SS "SoVRMLLOD::SoVRMLLOD (void)" Constructor\&. .SS "SoVRMLLOD::SoVRMLLOD (intlevels)" Constructor\&. \fIlevels\fP is the expected number of levels\&. .SS "SoVRMLLOD::~SoVRMLLOD ()\fC [protected]\fP, \fC [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoVRMLLOD::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 * SoVRMLLOD::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 "SbBool SoVRMLLOD::affectsState (void) const\fC [virtual]\fP" Returns \fCTRUE\fP if the node could have any effect on the state during traversal\&. .PP If it returns \fCFALSE\fP, no data in the traversal-state will change from the pre-traversal state to the post-traversal state\&. The \fBSoSeparator\fP node will for instance return \fCFALSE\fP, as it pushes and pops the state before and after traversal of its children\&. All \fBSoShape\fP nodes will also return \fCFALSE\fP, as just pushing out geometry data to the rendering engine won't affect the actual rendering state\&. .PP The default method returns \fCTRUE\fP, on a 'better safe than sorry' philosophy\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "void SoVRMLLOD::addLevel (\fBSoNode\fP *levelptr)" Adds a new level\&. .SS "void SoVRMLLOD::insertLevel (\fBSoNode\fP *levelptr, intidx)" Inserts a new level\&. .SS "\fBSoNode\fP * SoVRMLLOD::getLevel (intidx) const" Returns a level\&. .SS "int SoVRMLLOD::findLevel (const \fBSoNode\fP *node) const" Find \fInode\fP, and return the level index or -1 if not found\&. .SS "int SoVRMLLOD::getNumLevels (void) const" Return the number of levels\&. .SS "void SoVRMLLOD::removeLevel (intidx)" Removes the level at index \fIidx\fP\&. .SS "void SoVRMLLOD::removeLevel (\fBSoNode\fP *levelptr)" Find \fIlevel\fP, and remove it if found\&. .SS "void SoVRMLLOD::removeAllLevels (void)" Remove all levels\&. .SS "void SoVRMLLOD::replaceLevel (intidx, \fBSoNode\fP *node)" Replace the level at \fIidx\fP with \fInode\fP\&. .SS "void SoVRMLLOD::replaceLevel (\fBSoNode\fP *oldnode, \fBSoNode\fP *newnode)" Find \fIoldnode\fP, and replace it with \fInewnode\fP\&. .SS "void SoVRMLLOD::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 SoVRMLLOD::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 SoVRMLLOD::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 SoVRMLLOD::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 SoVRMLLOD::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 SoVRMLLOD::search (\fBSoSearchAction\fP *action)\fC [virtual]\fP" Action method for \fBSoSearchAction\fP\&. .PP Compares the search criteria from the \fIaction\fP to see if this node is a match\&. Searching is done by matching up \fIall\fP criteria set up in the \fBSoSearchAction\fP -- if \fIany\fP of the requested criteria is a miss, the search is not deemed successful for the node\&. .PP \fBSee also:\fP .RS 4 \fBSoSearchAction\fP .RE .PP .PP Reimplemented from \fBSoGroup\fP\&. .SS "void SoVRMLLOD::write (\fBSoWriteAction\fP *action)\fC [virtual]\fP" Action method for \fBSoWriteAction\fP\&. .PP Writes out a node object, and any connected nodes, engines etc, if necessary\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "void SoVRMLLOD::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 SoVRMLLOD::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 SoVRMLLOD::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 SoVRMLLOD::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 SoVRMLLOD::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 SoVRMLLOD::addChild (\fBSoNode\fP *node)\fC [virtual]\fP" Append a child \fInode\fP to the list of children nodes this group node is managing\&. .PP Please note that this method is not virtual in the original SGI Inventor API\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "void SoVRMLLOD::insertChild (\fBSoNode\fP *child, intnewchildindex)\fC [virtual]\fP" Insert a \fIchild\fP node at position \fInewchildindex\fP\&. .PP \fInewchildindex\fP must be <= this->\fBgetNumChildren()\fP .PP Please note that this method is not virtual in the original SGI Inventor API\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "\fBSoNode\fP * SoVRMLLOD::getChild (intindex) const\fC [virtual]\fP" Returns pointer to child node at \fIindex\fP\&. .PP Please note that this method is not virtual in the original SGI Inventor API\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "int SoVRMLLOD::findChild (const \fBSoNode\fP *node) const\fC [virtual]\fP" Returns index in our list of children for child \fInode\fP, or -1 if \fInode\fP is not a child of this group node\&. .PP Please note that this method is not virtual in the original SGI Inventor API\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "int SoVRMLLOD::getNumChildren (void) const\fC [virtual]\fP" Returns number of child nodes managed by this group\&. .PP Please note that this method is not virtual in the original SGI Inventor API\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "void SoVRMLLOD::removeChild (intchildindex)\fC [virtual]\fP" Remove node at \fIchildindex\fP in our list of children\&. .PP Please note that this method is not virtual in the original SGI Inventor API\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "void SoVRMLLOD::removeChild (\fBSoNode\fP *child)\fC [virtual]\fP" Remove \fIchild\fP from the set of children managed by this group node\&. Will decrease the reference count of \fIchild\fP by 1\&. .PP This is a convenience method\&. It will simply call \fBfindChild()\fP with \fIchild\fP as argument, and then call \fBremoveChild(int)\fP if the child is found\&. .PP Please note that this method is not virtual in the original SGI Inventor API\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "void SoVRMLLOD::removeAllChildren (void)\fC [virtual]\fP" Do not manage the children anymore\&. Will dereference all children by 1 as they are removed\&. .PP Please note that this method is not virtual in the original SGI Inventor API\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "void SoVRMLLOD::replaceChild (intindex, \fBSoNode\fP *newchild)\fC [virtual]\fP" Replace child at \fIindex\fP with \fInewChild\fP\&. .PP Dereferences the child previously at \fIindex\fP, and increases the reference count of \fInewChild\fP by 1\&. .PP \fIindex\fP must be < this->\fBgetNumChildren()\fP .PP Please note that this method is not virtual in the original SGI Inventor API\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "void SoVRMLLOD::replaceChild (\fBSoNode\fP *oldchild, \fBSoNode\fP *newchild)\fC [virtual]\fP" Replace \fIoldchild\fP with \fInewchild\fP\&. .PP Dereferences \fIoldchild\fP by 1, and increases the reference count of \fInewchild\fP by 1\&. .PP This is a convenience method\&. It will simply call \fBfindChild()\fP with \fIoldchild\fP as argument, and call \fBreplaceChild(int, SoNode*)\fP if the child is found\&. .PP Please note that this method is not virtual in the original SGI Inventor API\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "\fBSoChildList\fP * SoVRMLLOD::getChildren (void) const\fC [virtual]\fP" Returns list of children\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "void SoVRMLLOD::notify (\fBSoNotList\fP *l)\fC [protected]\fP, \fC [virtual]\fP" Notifies all auditors for this instance when changes are made\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "SbBool SoVRMLLOD::readInstance (\fBSoInput\fP *in, unsigned shortflags)\fC [protected]\fP, \fC [virtual]\fP" This method is mainly intended for internal use during file import operations\&. .PP It reads a definition of an instance from the input stream \fIin\fP\&. The input stream state points to the start of a serialized / persistant representation of an instance of this class type\&. .PP \fCTRUE\fP or \fCFALSE\fP is returned, depending on if the instantiation and configuration of the new object of this class type went ok or not\&. The import process should be robust and handle corrupted input streams by returning \fCFALSE\fP\&. .PP \fIflags\fP is used internally during binary import when reading user extension nodes, group nodes or engines\&. .PP Reimplemented from \fBSoGroup\fP\&. .SS "void SoVRMLLOD::copyContents (const \fBSoFieldContainer\fP *from, SbBoolcopyconnections)\fC [protected]\fP, \fC [virtual]\fP" Makes a deep copy of all data of \fIfrom\fP into this instance, \fIexcept\fP external scenegraph references if \fIcopyconnections\fP is \fCFALSE\fP\&. .PP This is the method that should be overridden by extension node / engine / dragger / whatever subclasses which needs to account for internal data that are not handled automatically\&. .PP For copying nodes from application code, you should not invoke this function directly, but rather call the \fBSoNode::copy()\fP function: .PP .PP .nf SoNode * mynewnode = templatenode->copy(); .fi .PP .PP The same also goes for engines\&. .PP Make sure that when you override the \fBcopyContents()\fP method in your extension class that you also make it call upwards to it's parent superclass in the inheritance hierarchy, as \fBcopyContents()\fP in for instance \fBSoNode\fP and \fBSoFieldContainer\fP does important work\&. It should go something like this: .PP .PP .nf void MyCoinExtensionNode::copyContents(const SoFieldContainer * from, SbBool copyconnections) { // let parent superclasses do their thing (copy fields, copy // instance name, etc etc) SoNode::copyContents(from, copyconnections); // [\&.\&.then copy internal data\&.\&.] } .fi .PP .PP Reimplemented from \fBSoGroup\fP\&. .SS "int SoVRMLLOD::whichToTraverse (\fBSoAction\fP *action)\fC [protected]\fP, \fC [virtual]\fP" Returns the child to traverse based on distance to current viewpoint\&. .SH "Member Data Documentation" .PP .SS "\fBSoMFFloat\fP SoVRMLLOD::range" The range for each level\&. .SS "\fBSoSFVec3f\fP SoVRMLLOD::center" The center used when calculating distance\&. .SS "\fBSoMFNode\fP SoVRMLLOD::level" The different levels\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.