.TH "SoCylinder" 3 "Thu May 29 2014" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoCylinder \- .PP The \fBSoCylinder\fP class is for rendering cylinder shapes\&. .PP Insert a cylinder shape into the scenegraph\&. The cylinder 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 Types" .in +1c .ti -1c .RI "enum \fBPart\fP { \fBSIDES\fP = 0x1, \fBTOP\fP = 0x2, \fBBOTTOM\fP = 0x4, \fBALL\fP = SIDES|TOP|BOTTOM }" .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 "\fBSoCylinder\fP (void)" .br .ti -1c .RI "void \fBaddPart\fP (\fBSoCylinder::Part\fP part)" .br .ti -1c .RI "void \fBremovePart\fP (\fBSoCylinder::Part\fP part)" .br .ti -1c .RI "SbBool \fBhasPart\fP (\fBSoCylinder::Part\fP part) const " .br .ti -1c .RI "virtual void \fBrayPick\fP (\fBSoRayPickAction\fP *action)" .br .ti -1c .RI "virtual void \fBgetPrimitiveCount\fP (\fBSoGetPrimitiveCountAction\fP *action)" .br .ti -1c .RI "virtual void \fBGLRender\fP (\fBSoGLRenderAction\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 .ti -1c .RI "\fBSoSFFloat\fP \fBheight\fP" .br .ti -1c .RI "\fBSoSFBitMask\fP \fBparts\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~SoCylinder\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 \fBSoCylinder\fP class is for rendering cylinder shapes\&. .PP Insert a cylinder shape into the scenegraph\&. The cylinder is rendered with the current material, texture and drawstyle settings (if any, otherwise the default settings are used)\&. The \fBSoCylinder\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 cylinder is visualized by the underlying rendering system by first tessellating the conceptual cylinder into a set of polygons\&. To control the trade-off between an as much as possible correct visual appearance of the cylinder 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 sides of the cylinder 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 A nice trick for rendering a disc is to render an \fBSoCylinder\fP with \fBSoCylinder::height\fP set to zero: .PP .PP .nf #Inventor V2\&.1 ascii ShapeHints { # to get two-sided lighting on the disc vertexOrdering COUNTERCLOCKWISE shapeType UNKNOWN_SHAPE_TYPE } Cylinder { height 0 parts TOP } .fi .PP .PP \fBFILE FORMAT/DEFAULTS:\fP .PP .nf Cylinder { radius 1 height 2 parts (SIDES | TOP | BOTTOM) } .fi .PP .PP \fBSee also:\fP .RS 4 \fBSoCone\fP, \fBSoSphere\fP, \fBSoCube\fP .RE .PP .SH "Member Enumeration Documentation" .PP .SS "enum \fBSoCylinder::Part\fP" The parts of a cylinder shape\&. .SH "Constructor & Destructor Documentation" .PP .SS "SoCylinder::SoCylinder (void)" Constructor\&. .SS "SoCylinder::~SoCylinder ()\fC [protected]\fP, \fC [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoCylinder::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 * SoCylinder::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 SoCylinder::addPart (\fBSoCylinder::Part\fPpart)" Add a \fIpart\fP to the cylinder\&. .PP \fBSee also:\fP .RS 4 \fBremovePart()\fP, \fBhasPart()\fP .RE .PP .SS "void SoCylinder::removePart (\fBSoCylinder::Part\fPpart)" Remove a \fIpart\fP from the cylinder\&. .PP \fBSee also:\fP .RS 4 \fBaddPart()\fP, \fBhasPart()\fP .RE .PP .SS "SbBool SoCylinder::hasPart (\fBSoCylinder::Part\fPpart) const" Returns \fCTRUE\fP if rendering of the given \fIpart\fP is currently turned on\&. .PP \fBSee also:\fP .RS 4 \fBaddPart()\fP, \fBremovePart()\fP .RE .PP .SS "void SoCylinder::rayPick (\fBSoRayPickAction\fP *action)\fC [virtual]\fP" Calculates picked point based on primitives generated by subclasses\&. .PP Reimplemented from \fBSoShape\fP\&. .SS "void SoCylinder::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 SoCylinder::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 SoCylinder::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 SoCylinder::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 SoCylinder::radius" Radius of cylinder\&. Default value 1\&.0\&. .SS "\fBSoSFFloat\fP SoCylinder::height" Height of cylinder\&. Default is 2\&.0\&. .SS "\fBSoSFBitMask\fP SoCylinder::parts" Which parts to use for rendering, picking, etc\&. Defaults to SoCylinder::ALL\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.