Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

sglBezierCurveSet Class Reference

#include <sglBezierCurveSet.hpp>

Inheritance diagram for sglBezierCurveSet::

sglGeoSet sglDrawable sglObject List of all members.

Public Methods

 sglBezierCurveSet ()
virtual ~sglBezierCurveSet ()
void setTexCoordBind (BindEnum bind)
BindEnum getTexCoordBind () const
void setCoordOrder (GLint order=4)
void setTexCoordOrder (GLint order=4)
void setNormalOrder (GLint order=4)
void setColorOrder (GLint order=4)
GLint getCoordOrder ()
GLint getTexCoordOrder ()
GLint getNormalOrder ()
GLint getColorOrder ()
void setRange (float min=0, float max=1.0f)
void getRange (float &min, float &max)
void setNumSegments (unsigned int num)
unsigned int getNumSegments ()
virtual void drawGeometry (const vector< sglTexCoords > &tex_coords) const
sglStats::PrimEnum getPrimType () const
GLenum getGLPrimType () const
unsigned int getPrimSize () const
AAEnum getAAType () const

Protected Methods

virtual bool computeBounds ()
virtual void updateDrawFunc ()

Protected Attributes

GLint m_vorder
GLint m_norder
GLint m_corder
GLint m_torder
float m_min
float m_max
unsigned int m_segments

Static Protected Attributes

Map1Func s_vfunc_table [24]
Map1Func s_nfunc_table [8]
Map1Func s_cfunc_table [16]
Map1Func s_tfunc_table [32]

Detailed Description

This class encapsulates OpenGL's interface to the bezier curve mechanism. I need Tom to document this one.

Note: The BindEnum's for BezierCurves have different meanings than for other sglGeoSets. \begin{description} \item[sglGeoSet::ePER_VERTEX] A different set of control points are applied to each primitive. This requires order*num_prim control points. \item[sglGeoSet::ePER_PRIM] The same set of control points is applied to each primitive. The range applied is also the same (min-max). This will create the effect of repeating the values on each primitive. This requires order control points. \item[sglGeoSet::eOVERALL] The same set of control points is applied to each primitive. The range is streched, and applied linearly across the primitives. This will have the effect of streching the values across all of the primitives. This requires order control points. \end{description}

{\bf Example:}

\begin{verbatim} sglBezierCurveSet *gset = new sglBezierCurveSet();

sglVec3f *vertex = new sglVec3f[4]; vertex[0].set(-10.0f, 0.0f, -10.0f); vertex[1].set(-08.0f, 7.0f, 10.0f); vertex[2].set( 08.0f, 0.0f, -10.0f); vertex[3].set( 10.0f, 0.0f, 10.0f);

gset->setCoordList(vertex); gset->setCoordOrder(4);

sglVec4f *color = new sglVec4f(1.0f, 0, 0, 1.0f); gset->setColorList(sglGeoSet::eOVERALL, color); gset->setColorOrder(1);

gset->setNumPrims(1); gset->setNumSegments(10); \end{verbatim}

Definition at line 77 of file sglBezierCurveSet.hpp.


Constructor & Destructor Documentation

sglBezierCurveSet::sglBezierCurveSet ( )
 

default constructor.

sglBezierCurveSet::~sglBezierCurveSet ( ) [virtual]
 

virtual destructor.


Member Function Documentation

void sglBezierCurveSet::setCoordOrder ( GLint order = 4 )
 

order is the degree of the curve plus one (should == the number of control points/prim)

void sglBezierCurveSet::setRange ( float min = 0,
float max = 1.0f )
 

get/set the range of the parametric value.

void sglBezierCurveSet::setNumSegments ( unsigned int num )
 

get/set the number of segments to be drawn for each curve.

void sglBezierCurveSet::drawGeometry ( const vector< sglTexCoords > & tex_coords ) const [virtual]
 

draw the geometry of the bezier curve.

sglStats::PrimEnum sglBezierCurveSet::getPrimType ( ) const [inline, virtual]
 

retrieve the primitive type.

Reimplemented from sglGeoSet.

Definition at line 124 of file sglBezierCurveSet.hpp.

virtual bool sglBezierCurveSet::computeBounds ( ) [protected, virtual]
 

Compute the bounding box for this geometry and fill in the member variable, m_bbox, in this class.

Returns:
true if successful (all information is available for computing a bounding box), otherwise false.

Reimplemented from sglGeoSet.


The documentation for this class was generated from the following file:
Generated at Mon Jul 1 18:00:06 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001