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

sglBezierSurfaceSet Class Reference

#include <sglBezierSurfaceSet.hpp>

Inheritance diagram for sglBezierSurfaceSet::

sglGeoSet sglDrawable sglObject List of all members.

Public Methods

 sglBezierSurfaceSet ()
virtual ~sglBezierSurfaceSet ()
void setTexCoordBind (BindEnum bind)
BindEnum getTexCoordBind () const
void setCoordOrder (GLint order_u=4, GLint order_v=4)
void setTexCoordOrder (GLint order_u=4, GLint order_v=4)
void setNormalOrder (GLint order_u=4, GLint order_v=4)
void setColorOrder (GLint order_u=4, GLint order_v=4)
void getCoordOrder (GLint &order_u, GLint &order_v)
void getTexCoordOrder (GLint &order_u, GLint &order_v)
void getNormalOrder (GLint &order_u, GLint &order_v)
void getColorOrder (GLint &order_u, GLint &order_v)
void setRange (float min_u=0, float max_u=1.0f, float min_v=0, float max_v=1.0f)
void getRange (float &min_u, float &max_u, float &min_v, float &max_v)
void setNumSegments (unsigned int num_u, unsigned int num_v)
void setNumSegments (unsigned int &num_u, unsigned int &num_v)
virtual void addStats (sglStats &stats) const
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_u
GLint m_vorder_v
GLint m_norder_u
GLint m_norder_v
GLint m_corder_u
GLint m_corder_v
GLint m_torder_u
GLint m_torder_v
float m_min_u
float m_min_v
float m_max_u
float m_max_v
unsigned int m_segments_u
unsigned int m_segments_v

Static Protected Attributes

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

Detailed Description

This class encapsulates OpenGL's interface to the bezier (nurbs) surface mechanism. I need Tom to document this one.

Note: The BindEnum's for BezierSurfaces 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_u*order_v*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_u*order_v control points.

\item[sglGeoSet::eOVERALL] The same set of control points is applied to each primitive. The range (along the u dimension) 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_u*order_v control points. \end{description}

{\bf Example:} \begin{verbatim} sglBezierSurfaceSet *gset = new sglBezierSurfaceSet();

sglVec3f *vertex = new sglVec3f[16]; vertex[ 0].set(-10.0f, 0.0f, -10.0f); vertex[ 1].set(-05.0f, 7.0f, -10.0f); vertex[ 2].set( 05.0f, -7.0f, -10.0f); vertex[ 3].set( 10.0f, 0.0f, -10.0f); vertex[ 4].set(-10.0f, 0.0f, -05.0f); vertex[ 5].set(-05.0f, 7.0f, -05.0f); vertex[ 6].set( 05.0f, -7.0f, -05.0f); vertex[ 7].set( 10.0f, 0.0f, -05.0f); vertex[ 8].set(-10.0f, 0.0f, 05.0f); vertex[ 9].set(-05.0f, 7.0f, 05.0f); vertex[10].set( 05.0f, -7.0f, 05.0f); vertex[11].set( 10.0f, 0.0f, 05.0f); vertex[12].set(-10.0f, 0.0f, 10.0f); vertex[13].set(-05.0f, 7.0f, 10.0f); vertex[14].set( 05.0f, -7.0f, 10.0f); vertex[15].set( 10.0f, 0.0f, 10.0f);

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

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

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

Definition at line 90 of file sglBezierSurfaceSet.hpp.


Constructor & Destructor Documentation

sglBezierSurfaceSet::sglBezierSurfaceSet ( )
 

default constructor.

sglBezierSurfaceSet::~sglBezierSurfaceSet ( ) [virtual]
 

virtual destructor.


Member Function Documentation

void sglBezierSurfaceSet::setCoordOrder ( GLint order_u = 4,
GLint order_v = 4 )
 

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

void sglBezierSurfaceSet::setRange ( float min_u = 0,
float max_u = 1.0f,
float min_v = 0,
float max_v = 1.0f )
 

get/set the range of the parametric value in the u and v dimensions.

void sglBezierSurfaceSet::setNumSegments ( unsigned int num_u,
unsigned int num_v )
 

get/set the number of segments to be drawn for each surface in the u and v dimensions.

void sglBezierSurfaceSet::addStats ( sglStats & stats ) const [virtual]
 

Add this drawable's stats to the given debug_stats.

Reimplemented from sglGeoSet.

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

draw the geometry of the bezier surface.

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

retrieve the primitive type.

Reimplemented from sglGeoSet.

Definition at line 148 of file sglBezierSurfaceSet.hpp.

virtual bool sglBezierSurfaceSet::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