Open Inventor Reference
SoSphere Class Reference

Sphere shape node. More...

#include <Inventor/nodes/SoSphere.h>

Inheritance diagram for SoSphere:
SoShape SoNode SoFieldContainer SoBase

List of all members.

Public Member Functions

 SoSphere ()
 Creates a sphere node with default settings.
virtual void GLRender (SoGLRenderAction *action)
 Implements rendering by rendering each primitive generated by subclass.
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
SoSFFloat radius
 Radius of sphere. This must be greater than 0.

Protected Member Functions

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

Detailed Description

This node represents a sphere. By default, the sphere is centered at the origin and has a radius of 1. The sphere is transformed by the current cumulative transformation and is drawn with the current lighting model, drawing style, material, and geometric complexity.

A sphere does not have faces or parts. Therefore, the sphere ignores material and normal bindings, using the first material for the entire sphere and using its own normals. When a texture is applied to a sphere, the texture covers the entire surface, wrapping counterclockwise from the back of the sphere. The texture has a seam at the back on the yz-plane.

File Format/Default
Sphere {
  radius 1
}
Action Behavior
SoGLRenderAction
Draws sphere based on the current coordinates, materials, drawing style, and so on.
SoRayPickAction
Intersects the ray with the sphere. No details are created for intersections.
SoGetBoundingBoxAction
Computes the bounding box that encloses the sphere.
SoCallbackAction
If any triangle callbacks are registered with the action, they will be invoked for each successive triangle that approximates the sphere.
See Also
SoCone, SoCube, SoCylinder

Definition at line 108 of file SoSphere.h.


Constructor & Destructor Documentation

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

Member Function Documentation

virtual void SoSphere::computeBBox ( SoAction action,
SbBox3f box,
SbVec3f center 
) [protected, virtual]

Implements SoShape.

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

Implements SoShape.

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

May be overridden in subclass.

Reimplemented from SoShape.

static void SoSphere::initClass ( ) [static]

Reimplemented from SoShape.

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

May be overridden in subclass.

Reimplemented from SoShape.


Member Data Documentation

Definition at line 117 of file SoSphere.h.


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