GClasses
GClasses::GNurbs Class Reference

Detailed Description

NURBS = Non Uniform Rational B-Spline Periodic = closed loop.

#include <GBezier.h>

Public Member Functions

 GNurbs (int nControlPoints, int nDegree, bool periodic)
 
 GNurbs (GNurbs *pThat)
 
 ~GNurbs ()
 
GBezierbezier (int nInterval)
 Create a Bezier curve that exactly fits a portion of this curve. todo: what are acceptable values for nInterval? More...
 
void controlPoint (G3DVector *pOutPoint, double *pOutWeight, int n)
 Returns a control point and the associated weight. More...
 
int controlPointCount ()
 Returns the number of control points. More...
 
void insertKnotPeriodic (int nInterval, double dRatio)
 0 <= dRatio <= 1, (for example, .5 means to insert the knot in the center of the interval) More...
 
double knotInterval (int n)
 
void setControlPoint (int n, G3DVector *pPoint, double weight)
 Set a control point location and its weight. More...
 
void setKnotInterval (int n, double dInterval)
 

Protected Member Functions

void calculateBezierControlPoint (struct GBezierPoint *pOutPoint, int nInterval, int nControlPoint)
 
double knotValue (int n)
 
void newKnotPeriodic (struct GBezierPoint *pA, struct GBezierPoint *pB, int n, int nControlPoint, double dRatio)
 
void pointCircular (struct GBezierPoint *pOutPoint, int n)
 

Protected Attributes

bool m_bPeriodic
 
int m_nControlPoints
 
int m_nDegree
 
struct GNurbsPoint * m_pPoints
 

Constructor & Destructor Documentation

GClasses::GNurbs::GNurbs ( int  nControlPoints,
int  nDegree,
bool  periodic 
)
GClasses::GNurbs::GNurbs ( GNurbs pThat)
GClasses::GNurbs::~GNurbs ( )

Member Function Documentation

GBezier* GClasses::GNurbs::bezier ( int  nInterval)

Create a Bezier curve that exactly fits a portion of this curve. todo: what are acceptable values for nInterval?

void GClasses::GNurbs::calculateBezierControlPoint ( struct GBezierPoint *  pOutPoint,
int  nInterval,
int  nControlPoint 
)
protected
void GClasses::GNurbs::controlPoint ( G3DVector pOutPoint,
double *  pOutWeight,
int  n 
)

Returns a control point and the associated weight.

int GClasses::GNurbs::controlPointCount ( )
inline

Returns the number of control points.

void GClasses::GNurbs::insertKnotPeriodic ( int  nInterval,
double  dRatio 
)

0 <= dRatio <= 1, (for example, .5 means to insert the knot in the center of the interval)

double GClasses::GNurbs::knotInterval ( int  n)
double GClasses::GNurbs::knotValue ( int  n)
protected
void GClasses::GNurbs::newKnotPeriodic ( struct GBezierPoint *  pA,
struct GBezierPoint *  pB,
int  n,
int  nControlPoint,
double  dRatio 
)
protected
void GClasses::GNurbs::pointCircular ( struct GBezierPoint *  pOutPoint,
int  n 
)
protected
void GClasses::GNurbs::setControlPoint ( int  n,
G3DVector pPoint,
double  weight 
)

Set a control point location and its weight.

void GClasses::GNurbs::setKnotInterval ( int  n,
double  dInterval 
)

Member Data Documentation

bool GClasses::GNurbs::m_bPeriodic
protected
int GClasses::GNurbs::m_nControlPoints
protected
int GClasses::GNurbs::m_nDegree
protected
struct GNurbsPoint* GClasses::GNurbs::m_pPoints
protected