Open Inventor Reference
SoCylinder Class Reference

Cylinder shape node. More...

#include <Inventor/nodes/SoCylinder.h>

Inheritance diagram for SoCylinder:
SoShape SoNode SoFieldContainer SoBase

List of all members.

Public Types

enum  Part { SIDES = 0x01, TOP = 0x02, BOTTOM = 0x04, ALL = 0x07 }
 Cylinder parts. More...

Public Member Functions

 SoCylinder ()
 Creates a cylinder node with default settings.
void addPart (SoCylinder::Part part)
 Turns on/off a part of the cylinder. (Convenience functions)
void removePart (SoCylinder::Part part)
SbBool hasPart (SoCylinder::Part part) const
 Returns whether a given part is on or off. (Convenience function)
virtual void GLRender (SoGLRenderAction *action)
 Implements actions.
virtual void rayPick (SoRayPickAction *action)
 Implements picking along a ray by intersecting the ray with each primitive generated by subclass.

Static Public Member Functions

static void initClass ()
 Initializes base node class.

Public Attributes

Fields
SoSFBitMask parts
 Visible parts of cylinder.
SoSFFloat radius
 Radius in x and z dimensions.
SoSFFloat height
 Size in y dimension.

Protected Member Functions

virtual void generatePrimitives (SoAction *action)
 Generates triangles representing a cylinder.
virtual void computeBBox (SoAction *action, SbBox3f &box, SbVec3f &center)
 Computes bounding box of cylinder.
virtual ~SoCylinder ()

Detailed Description

This node represents a simple capped cylinder centered around the y-axis. By default, the cylinder is centered at (0,0,0) and has a default size of -1 to +1 in all three dimensions. You can use the radius and height fields to create a cylinder with a different size.

The cylinder is transformed by the current cumulative transformation and is drawn with the current lighting model, drawing style, material, and geometric complexity.

If the current material binding is PER_PART or PER_PART_INDEXED, the first current material is used for the sides of the cylinder, the second is used for the top, and the third is used for the bottom. Otherwise, the first material is used for the entire cylinder.

When a texture is applied to a cylinder, it is applied differently to the sides, top, and bottom. On the sides, the texture wraps counterclockwise (from above) starting at the back of the cylinder. The texture has a vertical seam at the back, intersecting the yz-plane. For the top and bottom, a circle is cut out of the texture square and applied to the top or bottom circle. The top texture appears right side up when the top of the cylinder is tilted toward the camera, and the bottom texture appears right side up when the top of the cylinder is tilted away from the camera.

File Format/Default
Cylinder {
  parts ALL
  radius 1
  height 2
}
Action Behavior
SoGLRenderAction
Draws cylinder based on the current coordinates, materials, drawing style, and so on.
SoRayPickAction
Intersects the ray with the cylinder. The part of the cylinder that was picked is available from the SoCylinderDetail.
SoGetBoundingBoxAction
Computes the bounding box that encloses the cylinder.
SoCallbackAction
If any triangle callbacks are registered with the action, they will be invoked for each successive triangle that approximates the cylinder.
See Also
SoCone, SoCube, SoCylinderDetail, SoSphere

Definition at line 128 of file SoCylinder.h.


Member Enumeration Documentation

Enumerator:
SIDES 

The tubular part.

TOP 

The top circular face.

BOTTOM 

The bottom circular face.

ALL 

All parts.

Definition at line 135 of file SoCylinder.h.


Constructor & Destructor Documentation

SoCylinder::SoCylinder ( )
virtual SoCylinder::~SoCylinder ( ) [protected, virtual]

Member Function Documentation

void SoCylinder::addPart ( SoCylinder::Part  part)
virtual void SoCylinder::computeBBox ( SoAction action,
SbBox3f box,
SbVec3f center 
) [protected, virtual]

Implements SoShape.

virtual void SoCylinder::generatePrimitives ( SoAction action) [protected, virtual]

Implements SoShape.

virtual void SoCylinder::GLRender ( SoGLRenderAction action) [virtual]

Reimplemented from SoShape.

SbBool SoCylinder::hasPart ( SoCylinder::Part  part) const
static void SoCylinder::initClass ( ) [static]

Reimplemented from SoShape.

virtual void SoCylinder::rayPick ( SoRayPickAction action) [virtual]

May be overridden in subclass.

Reimplemented from SoShape.

void SoCylinder::removePart ( SoCylinder::Part  part)

Member Data Documentation

Definition at line 150 of file SoCylinder.h.

Definition at line 146 of file SoCylinder.h.

Definition at line 148 of file SoCylinder.h.


The documentation for this class was generated from the following file: