Open Inventor Reference
SoCone Class Reference

Cone shape node. More...

#include <Inventor/nodes/SoCone.h>

Inheritance diagram for SoCone:
SoShape SoNode SoFieldContainer SoBase

List of all members.

Public Types

enum  Part { SIDES = 0x01, BOTTOM = 0x02, ALL = 0x03 }
 Cone parts: More...

Public Member Functions

 SoCone ()
 Creates a cone node with default settings.
void addPart (SoCone::Part part)
 Turns on/off a part of the cone. (Convenience functions)
void removePart (SoCone::Part part)
SbBool hasPart (SoCone::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 cone.
SoSFFloat bottomRadius
 Radius of bottom circular face.
SoSFFloat height
 Size in y dimension.

Protected Member Functions

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

Detailed Description

This node represents a simple cone whose central axis is aligned with the y-axis. By default, the cone is centered at (0,0,0) and has a size of -1 to +1 in all three directions. The cone has a radius of 1 at the bottom and a height of 2, with its apex at 1. The cone has two parts: the sides and the bottom.

The cone 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 cone, and the second is used for the bottom. Otherwise, the first material is used for the entire cone.

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

File Format/Default
Action Behavior
SoGLRenderAction
Draws cone based on the current coordinates, materials, drawing style, and so on.
SoRayPickAction
Intersects the ray with the cone. The part of the cone that was picked is available from the SoConeDetail.
SoGetBoundingBoxAction
Computes the bounding box that encloses the cone.
SoCallbackAction
If any triangle callbacks are registered with the action, they will be invoked for each successive triangle that approximates the cone.
See Also
SoConeDetail, SoCube, SoCylinder, SoSphere

Definition at line 125 of file SoCone.h.


Member Enumeration Documentation

Enumerator:
SIDES 

The conical part.

BOTTOM 

The bottom circular face.

ALL 

All parts.

Definition at line 132 of file SoCone.h.


Constructor & Destructor Documentation

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

Member Function Documentation

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

Implements SoShape.

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

Implements SoShape.

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

Reimplemented from SoShape.

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

Reimplemented from SoShape.

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

May be overridden in subclass.

Reimplemented from SoShape.

void SoCone::removePart ( SoCone::Part  part)

Member Data Documentation

Definition at line 144 of file SoCone.h.

Definition at line 146 of file SoCone.h.

Definition at line 142 of file SoCone.h.


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