.TH "SoComplexity" 3 "Thu May 29 2014" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoComplexity \- .PP The \fBSoComplexity\fP class is a node type which is used to set the tradeoff between quality and performance\&. .PP By inserting \fBSoComplexity\fP nodes in the scene graph, you can control the accuracy by which complex shapes are rendered and the quality of the texture mapping used for geometry in the scene\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoNode\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "enum \fBType\fP { \fBOBJECT_SPACE\fP = SoComplexityTypeElement::OBJECT_SPACE, \fBSCREEN_SPACE\fP = SoComplexityTypeElement::SCREEN_SPACE, \fBBOUNDING_BOX\fP = SoComplexityTypeElement::BOUNDING_BOX }" .br .in -1c .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 "\fBSoComplexity\fP (void)" .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 \fBgetBoundingBox\fP (\fBSoGetBoundingBoxAction\fP *action)" .br .ti -1c .RI "virtual void \fBGLRender\fP (\fBSoGLRenderAction\fP *action)" .br .ti -1c .RI "virtual void \fBpick\fP (\fBSoPickAction\fP *action)" .br .ti -1c .RI "virtual void \fBgetPrimitiveCount\fP (\fBSoGetPrimitiveCountAction\fP *action)" .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 "\fBSoSFEnum\fP \fBtype\fP" .br .ti -1c .RI "\fBSoSFFloat\fP \fBvalue\fP" .br .ti -1c .RI "\fBSoSFFloat\fP \fBtextureQuality\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~SoComplexity\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 \fBSoComplexity\fP class is a node type which is used to set the tradeoff between quality and performance\&. .PP By inserting \fBSoComplexity\fP nodes in the scene graph, you can control the accuracy by which complex shapes are rendered and the quality of the texture mapping used for geometry in the scene\&. Shape nodes like \fBSoCone\fP, \fBSoSphere\fP, \fBSoCylinder\fP and others, will render with fewer polygons and thereby improve performance, if the complexity value of the traversal state is set to a lower value\&. .PP By using the \fBSoComplexity::type\fP field, you may also choose to render the scene graph (or parts of it) just as wireframe bounding boxes\&. This will improve rendering performance \fIa\fP \fIlot\fP, and can sometimes be used in particular situations where responsiveness is more important than appearance\&. .PP Texture mapping can be done in an expensive but attractive looking manner, or in a quick way which doesn't look as appealing by modifying the value of the \fBSoComplexity::textureQuality\fP field\&. By setting the \fBSoComplexity::textureQuality\fP field to a value of 0\&.0, you can also turn texturemapping completely off\&. .PP \fBFILE FORMAT/DEFAULTS:\fP .PP .nf Complexity { type OBJECT_SPACE value 0\&.5 textureQuality 0\&.5 } .fi .PP .SH "Member Enumeration Documentation" .PP .SS "enum \fBSoComplexity::Type\fP" The available values for the \fBSoComplexity::type\fP field\&. .PP \fBEnumerator\fP .in +1c .TP \fB\fIOBJECT_SPACE \fP\fP Use the \fBSoComplexity::value\fP in calculations based on the geometry's size in world-space 3D\&. .TP \fB\fISCREEN_SPACE \fP\fP Use the \fBSoComplexity::value\fP in calculations based on the geometry's size when projected onto the rendering area\&. This is often a good way to make sure that objects are rendered with as low complexity as possible while still retaining their appearance for the user\&. .TP \fB\fIBOUNDING_BOX \fP\fP Render further geometry in the scene graph as bounding boxes only for superfast rendering\&. .SH "Constructor & Destructor Documentation" .PP .SS "SoComplexity::SoComplexity (void)" Constructor\&. .SS "SoComplexity::~SoComplexity ()\fC [protected]\fP, \fC [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoComplexity::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 Implements \fBSoBase\fP\&. .SS "const \fBSoFieldData\fP * SoComplexity::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 \fBSoFieldContainer\fP\&. .SS "void SoComplexity::doAction (\fBSoAction\fP *action)\fC [virtual]\fP" This function performs the typical operation of a node for any action\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "void SoComplexity::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 \fBSoNode\fP\&. .SS "void SoComplexity::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 \fBSoNode\fP\&. .SS "void SoComplexity::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 \fBSoNode\fP\&. .SS "void SoComplexity::pick (\fBSoPickAction\fP *action)\fC [virtual]\fP" Action method for \fBSoPickAction\fP\&. .PP Does common processing for \fBSoPickAction\fP \fIaction\fP instances\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "void SoComplexity::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 \fBSoNode\fP\&. .SH "Member Data Documentation" .PP .SS "\fBSoSFEnum\fP SoComplexity::type" Set rendering type\&. Default value is \fBSoComplexity::OBJECT_SPACE\fP\&. .SS "\fBSoSFFloat\fP SoComplexity::value" Complexity value, valid settings range from 0\&.0 (worst appearance, best performance) to 1\&.0 (optimal appearance, lowest rendering speed)\&. Default value for the field is 0\&.5\&. .PP Note that without any \fBSoComplexity\fP nodes in the scene graph, geometry will render as if there was a \fBSoComplexity\fP node present with \fBSoComplexity::value\fP set to 1\&.0\&. .SS "\fBSoSFFloat\fP SoComplexity::textureQuality" Sets the quality value for texturemapping\&. Valid range is from 0\&.0 (texturemapping off, rendering will be much faster for most platforms) to 1\&.0 (best quality, rendering might be slow)\&. .PP The same value for this field on different platforms can yield varying results, depending on the quality of the underlying rendering hardware\&. .PP Note that this field influences the behavior of the \fBSoTexture2\fP node, \fInot\fP the shape nodes\&. There is an important consequence of this that the application programmer need to know about: you need to insert your \fBSoComplexity\fP node(s) \fIbefore\fP the \fBSoTexture2\fP node(s) in the scenegraph for them to have any influence on the textured shapes\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.