#include <SoKnot.h>
Public Member Functions | |
SoKnot (void) | |
void | setKnot (Tube< Vector3 > *t, const float Tol) |
void | updateMesh (const float Tol) |
Tube< Vector3 > * | getKnot () |
void | reset () |
virtual void | GLRender (SoGLRenderAction *action) |
virtual void | getPrimitiveCount (SoGetPrimitiveCountAction *action) |
Static Public Member Functions | |
static void | initClass (void) |
Public Attributes | |
SoSFFloat | radius |
SoSFInt32 | nodes |
SoSFInt32 | segments |
Protected Member Functions | |
virtual | ~SoKnot () |
virtual void | generatePrimitives (SoAction *action) |
virtual void | computeBBox (SoAction *action, SbBox3f &box, SbVec3f ¢er) |
For details about the Coin3D API and some more precise explanations about the structure of Coin see
The SoKnot class is a ready made node for a Coin3D/OpenInventor program that generates a tubular shape and can then be inserted in a scenegraph. The shape is rendered with the current material. The paramters for rendering a knot are the radius, the number of nodes on the centerline and the number of segments on the cross-section.
put example how to use this ...
SoKnot::~SoKnot | ( | ) | [protected, virtual] |
Destructor.
void SoKnot::initClass | ( | void | ) | [static] |
Static function that initializes the SoKnot class in Coin.
Initializes the SoKnot instance, given a Tube object t and a tolerance Tol for the mesh generation routine.
The original Tube t will not be changed in any way. Every time an action on the Tube object is necessary, the work is carried out on a copy, internally of the SoKnot instance.
References Tube< Vector >::makeMesh(), Curve< Vector >::nodes(), Tube< Vector >::radius(), and Tube< Vector >::segments().
void SoKnot::updateMesh | ( | const float | Tol | ) |
Recreates the mesh using the params currently stored in knot. Used for example by refine to update the internal mesh and number of nodes.
References Tube< Vector >::makeMesh(), nodes, Curve< Vector >::nodes(), radius, Tube< Vector >::radius(), segments, and Tube< Vector >::segments().
void SoKnot::reset | ( | ) |
Reset current knot to original.
void SoKnot::GLRender | ( | SoGLRenderAction * | action | ) | [virtual] |
Action method for the SoGLRenderAction. This is called during rendering traversals. Reimplemented from SoShape.
Note : This comes from the Coin documentation
References Curve< Vector >::isClosed(), nodes, Curve< Vector >::nodes(), radius, segments, and Tube< Vector >::segments().
void SoKnot::getPrimitiveCount | ( | SoGetPrimitiveCountAction * | action | ) | [virtual] |
Action method for the SoGetPrimitiveCountAction.
Calculates the number of triangle, line segment and point primitives for the node and adds these to the counters of the action.
Nodes influencing how geometry nodes calculates their primitive count also overrides this method to change the relevant state variables.
Reimplemented from SoShape.
void SoKnot::generatePrimitives | ( | SoAction * | action | ) | [protected, virtual] |
The method implements action behavior for shape nodes for SoCallbackAction. It is invoked from SoShape::callback(). (Subclasses should not override SoNode::callback().)
The subclass implementations uses the convenience methods SoShape::beginShape(), SoShape::shapeVertex(), and SoShape::endShape(), with SoDetail instances, to pass the primitives making up the shape back to the caller.
Implements SoShape.
References Curve< Vector >::isClosed(), Tube< Vector >::meshNormal(), Tube< Vector >::meshPoint(), nodes, and segments.
void SoKnot::computeBBox | ( | SoAction * | action, | |
SbBox3f & | box, | |||
SbVec3f & | center | |||
) | [protected, virtual] |
Implemented by SoShape subclasses to let the SoShape superclass know the exact size and weighted center point of the shape's bounding box.
The bounding box and center point should be calculated and returned in the local coordinate system.
The method implements action behavior for shape nodes for SoGetBoundingBoxAction. It is invoked from SoShape::getBoundingBox(). (Subclasses should not override SoNode::getBoundingBox().)
The box parameter sent in is guaranteed to be an empty box, while center is undefined upon function entry.
Implements SoShape.
References Tube< Vector >::getBoundingBox(), and Tube< Vector >::getCenter().
SoSFFloat SoKnot::radius |
Tube radius of the SoKnot instance.
Referenced by GLRender(), SoKnot(), and updateMesh().
SoSFInt32 SoKnot::nodes |
Number of nodes (number of data points) along the curve.
Referenced by generatePrimitives(), getPrimitiveCount(), GLRender(), SoKnot(), and updateMesh().
SoSFInt32 SoKnot::segments |
Number of segments on the circular cross section of the tube.
Referenced by generatePrimitives(), getPrimitiveCount(), GLRender(), SoKnot(), and updateMesh().