.TH "SoSphere" 3 "Thu May 29 2014" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoSphere \- .PP The \fBSoSphere\fP class is for rendering sphere shapes\&. .PP Renders a sphere with the size given by the \fBSoSphere::radius\fP field\&. The sphere is rendered with the current material, texture and drawstyle settings (if any, otherwise the default settings are used)\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoShape\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 "\fBSoSphere\fP (void)" .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 \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 "\fBSoSFFloat\fP \fBradius\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~SoSphere\fP ()" .br .ti -1c .RI "virtual void \fBgeneratePrimitives\fP (\fBSoAction\fP *action)" .br .ti -1c .RI "virtual void \fBcomputeBBox\fP (\fBSoAction\fP *action, \fBSbBox3f\fP &box, \fBSbVec3f\fP ¢er)" .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 \fBSoSphere\fP class is for rendering sphere shapes\&. .PP Renders a sphere with the size given by the \fBSoSphere::radius\fP field\&. The sphere is rendered with the current material, texture and drawstyle settings (if any, otherwise the default settings are used)\&. The \fBSoSphere\fP node class is provided as a convenient abstraction for the application programmer to use 'complex' shapes of this type without having to do the tessellation to polygons and other low-level programming herself\&. .PP A good trick for rendering ellipsoidal 3D shapes is to use an \fBSoSphere\fP prefixed with an \fBSoScale\fP transformation to 'flatten' it along one or more of the principal axes\&. (Ie use for instance an \fBSoScale\fP node with \fBSoScale::scaleFactor\fP equal to [1, 1, 0\&.1] to flatten it along the Z direction\&.) .PP A sphere is visualized by the underlying rendering system by first tessellating the conceptual sphere into a set of polygons\&. To control the trade-off between an as much as possible correct visual appearance of the sphere versus fast rendering, use an \fBSoComplexity\fP node to influence the number of polygons generated from the tessellation process\&. (The higher the complexity value, the more polygons will be generated, the more \fIrounded\fP the sphere will look\&.) Set the \fBSoComplexity::value\fP field to what you believe would be a good trade-off between correctness and speed for your particular application\&. .PP \fBFILE FORMAT/DEFAULTS:\fP .PP .nf Sphere { radius 1 } .fi .PP .PP \fBSee also:\fP .RS 4 \fBSoCone\fP, \fBSoCylinder\fP, \fBSoCube\fP .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "SoSphere::SoSphere (void)" Constructor\&. .SS "SoSphere::~SoSphere ()\fC [protected]\fP, \fC [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoSphere::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 \fBSoShape\fP\&. .SS "const \fBSoFieldData\fP * SoSphere::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 \fBSoShape\fP\&. .SS "void SoSphere::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 \fBSoShape\fP\&. .SS "void SoSphere::rayPick (\fBSoRayPickAction\fP *action)\fC [virtual]\fP" Calculates picked point based on primitives generated by subclasses\&. .PP Reimplemented from \fBSoShape\fP\&. .SS "void SoSphere::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 \fBSoShape\fP\&. .SS "void SoSphere::generatePrimitives (\fBSoAction\fP *action)\fC [protected]\fP, \fC [virtual]\fP" The method implements action behavior for shape nodes for \fBSoCallbackAction\fP\&. It is invoked from \fBSoShape::callback()\fP\&. (Subclasses should \fInot\fP override \fBSoNode::callback()\fP\&.) .PP The subclass implementations uses the convenience methods \fBSoShape::beginShape()\fP, \fBSoShape::shapeVertex()\fP, and \fBSoShape::endShape()\fP, with \fBSoDetail\fP instances, to pass the primitives making up the shape back to the caller\&. .PP Implements \fBSoShape\fP\&. .SS "void SoSphere::computeBBox (\fBSoAction\fP *action, \fBSbBox3f\fP &box, \fBSbVec3f\fP ¢er)\fC [protected]\fP, \fC [virtual]\fP" Implemented by \fBSoShape\fP subclasses to let the \fBSoShape\fP superclass know the exact size and weighted center point of the shape's bounding box\&. .PP The bounding box and center point should be calculated and returned in the local coordinate system\&. .PP The method implements action behavior for shape nodes for \fBSoGetBoundingBoxAction\fP\&. It is invoked from \fBSoShape::getBoundingBox()\fP\&. (Subclasses should \fInot\fP override \fBSoNode::getBoundingBox()\fP\&.) .PP The \fIbox\fP parameter sent in is guaranteed to be an empty box, while \fIcenter\fP is undefined upon function entry\&. .PP Implements \fBSoShape\fP\&. .SH "Member Data Documentation" .PP .SS "\fBSoSFFloat\fP SoSphere::radius" Radius of sphere\&. Default value is 1\&.0\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.