pfNurbCurve2d(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
NAMEpfNurbCurve2d - Non-Uniform Rational BSpline curves in 2D
FUNCTION SPECIFICATION
#include <Performer/pf/pfNurbCurve2d.h>
static pfType* pfNurbCurve2d::getClassType(void);
pfNurbCurve2d::pfNurbCurve2d();
pfNurbCurve2d::pfNurbCurve2d(pfReal beginT,
pfReal endT);
void pfNurbCurve2d::setControlHull(int i, const pfVec3 &p);
void pfNurbCurve2d::setControlHull(int i, const pfVec2 &p);
void pfNurbCurve2d::setWeight(int i, pfReal w);
void pfNurbCurve2d::setKnot(int i, pfReal t);
void pfNurbCurve2d::setControlHullSize(int s);
pfVec2* pfNurbCurve2d::getControlHull(int i);
pfReal pfNurbCurve2d::getWeight(int i);
int pfNurbCurve2d::getControlHullSize();
int pfNurbCurve2d::getKnotCount();
pfReal pfNurbCurve2d::getKnot(int i);
int pfNurbCurve2d::getOrder();
void pfNurbCurve2d::removeControlHullPnt(int i);
void pfNurbCurve2d::removeKnot(int i);
void pfNurbCurve2d::reverse();
virtual void pfNurbCurve2d::evalPt(pfReal t, pfVec2 &pnt);
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfNurbCurve2d is derived from the parent class
pfCurve2d, so each of these member functions of class pfCurve2d are also
directly usable with objects of class pfNurbCurve2d. This is also true
for ancestor classes of class pfCurve2d.
void pfCurve2d::setBeginT(const pfReal beginT);
Page 1
pfNurbCurve2d(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
void pfCurve2d::setEndT(const pfReal endT);
pfReal pfCurve2d::getBeginT() const;
pfReal pfCurve2d::getEndT() const;
pfVec2 pfCurve2d::getBeginPt();
pfVec2 pfCurve2d::getEndPt();
pfVec2 pfCurve2d::getBeginTan();
pfVec2 pfCurve2d::getEndTan();
void pfCurve2d::setClosed(const pfLoop loopVal);
pfLoop pfCurve2d::getClosed();
void pfCurve2d::setClosedTol(const pfReal tol);
pfReal pfCurve2d::getClosedTol() const;
virtual void pfCurve2d::evalPt(pfReal t, pfVec2& pnt) = 0;
virtual void pfCurve2d::evalTan(pfReal t, pfVec2& pnt);
virtual void pfCurve2d::evalNorm(pfReal t, pfVec2& pnt);
virtual void pfCurve2d::evalCurv(pfReal t, pfReal* curv);
void pfCurve2d::eval(pfReal t, pfVec2 &pnt, pfVec2 &tan,
pfReal* curv, pfVec2 &norm)
Since the class pfCurve2d is itself derived from the parent class pfRep,
objects of class pfNurbCurve2d can also be used with these functions
designed for objects of class pfRep.
void pfRep::setOrigin(const pfVec3 *origin);
void pfRep::setOrient(const pfMatrix *mat);
void pfRep::getOrigin(pfVec3& origin);
void pfRep::getOrient(pfMatrix& matrix);
Since the class pfRep is itself derived from the parent class pfGeode,
objects of class pfNurbCurve2d can also be used with these functions
designed for objects of class pfGeode.
int pfGeode::addGSet(pfGeoSet* gset);
int pfGeode::removeGSet(pfGeoSet* gset);
int pfGeode::insertGSet(int index, pfGeoSet* gset);
int pfGeode::replaceGSet(pfGeoSet* old, pfGeoSet* new);
pfGeoSet * pfGeode::getGSet(int index);
int pfGeode::getNumGSets(void);
Since the class pfGeode is itself derived from the parent class pfNode,
objects of class pfNurbCurve2d can also be used with these functions
designed for objects of class pfNode.
pfGroup * pfNode::getParent(int i);
int pfNode::getNumParents(void);
void pfNode::setBound(pfSphere *bsph, int mode);
int pfNode::getBound(pfSphere *bsph);
pfNode* pfNode::clone(int mode);
Page 2
pfNurbCurve2d(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
pfNode* pfNode::bufferClone(int mode, pfBuffer *buf);
int pfNode::flatten(int mode);
int pfNode::setName(const char *name);
const char * pfNode::getName(void);
pfNode* pfNode::find(const char *pathName, pfType *type);
pfNode* pfNode::lookup(const char *name, pfType* type);
int pfNode::isect(pfSegSet *segSet, pfHit **hits[]);
void pfNode::setTravMask(int which, uint mask, int setMode,
int bitOp);
uint pfNode::getTravMask(int which);
void pfNode::setTravFuncs(int which, pfNodeTravFuncType pre,
pfNodeTravFuncType post);
void pfNode::getTravFuncs(int which, pfNodeTravFuncType *pre,
pfNodeTravFuncType *post);
void pfNode::setTravData(int which, void *data);
void * pfNode::getTravData(int which);
void pfNode::setTravMode(int which, int mode, int val);
int pfNode::getTravMode(int which, int mode) const;
Since the class pfNode is itself derived from the parent class pfObject,
objects of class pfNurbCurve2d can also be used with these functions
designed for objects of class pfObject.
void* pfObject::operator new(size_t);
void* pfObject::operator new(size_t, pfFluxMemory *fmem);
void pfObject::setUserData(void *data);
void pfObject::setUserData(int slot, void *data);
void* pfObject::getUserData(pfObject *obj);
void* pfObject::getUserData(pfObject *obj, int slot);
int pfObject::getNumUserData();
Since the class pfObject is itself derived from the parent class
pfMemory, objects of class pfNurbCurve2d can also be used with these
functions designed for objects of class pfMemory.
void* pfMemory::getData(const void *ptr);
pfType * pfMemory::getType();
int pfMemory::isOfType(pfType *type);
int pfMemory::isExactType(pfType *type);
const char * pfMemory::getTypeName();
int pfMemory::copy(pfMemory *src);
int pfMemory::compare(const pfMemory *mem);
void pfMemory::print(uint which, uint verbose, char *prefix,
FILE *file);
int pfMemory::getArena(void *ptr);
void* pfMemory::getArena();
int pfMemory::ref();
int pfMemory::unref();
Page 3
pfNurbCurve2d(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
int pfMemory::unrefDelete();
int pfMemory::unrefGetRef();
int pfMemory::getRef();
int pfMemory::checkDelete();
int pfMemory::isFluxed();
void * pfMemory::getArena();
int pfMemory::getSize();
DESCRIPTIONpfNurbCurve2d defines a Non-Uniform Rational BSpline curve in two
dimensional space. A 2D Nurb curve is defined by an array of knot
values, an array of 2D control points, and an array of weights. The
order of the spline (degree+1) is equal to number_of_knot_values -
number_of_control_points. The knot multiplicity should be no bigger than
the order.
pfNurbCurve2d::getClassType returns the pfType* for the class
pfNurbCurve2d. The pfType* returned by pfNurbCurve2d::getClassType is
the same as the pfType* returned by invoking the virtual function getType
on any instance of class pfNurbCurve2d. Because OpenGL Performer allows
subclassing of built-in types, when decisions are made based on the type
of an object, it is usually better to use the member function isOfType
to test if an object is of a type derived from a Performer type rather
than to test for strict equality of the pfType*'s.
pfNurbCurve2d::pfNurbCurve2d() creates an instance of an pfNurbCurve2d.
By default the parametric domain is defined as [0..1].
pfNurbCurve2d::pfNurbCurve2d(pfReal beginT,pfReal endT) creates an
instance of a pfNurbCurve2d and sets the parametric domain to [beginT,
endT].
pfNurbCurve2d::setControlHull(int i,const pfVec2 &p) Sets the i'th
component of controlHull to be p. The i'th weight of weight is set to be
1.0 if this weight hasn't been set yet (checking the array length of
weight). The order is updated by knot.len - controlHull.len. The beginT
and endT are updated by knot(order-1) and knot(knot.len - order),
respectively. Obviously there are redundant computations for the order,
beginT and endT. The reason is that the application doesn't know when the
user is done setting data.
pfNurbCurve2d::setControlHull(int i,const pfVec3 &p) sets the i'th
component of controlHull to be p[0..1], and the i'th weight of weight to
be p[2]. The order is updated by knot.len - controlHull.len. The beginT
and endT are updated by knot(order-1) and knot(knot.len - order),
respectively. Obviously there are redundant computations for the order,
beginT and endT. The reason that the application doesn't know when the
user is done setting data.
pfNurbCurve2d::setWeight sets the i'th component of weight to be w.
pfNurbCurve2d::setKnot sets the <arg i>'th knot to be t. Updates order,
Page 4
pfNurbCurve2d(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
beginT, and endT accordingly (See ::setControlHull).
pfNurbCurve2d::setControlHullSize sets the extension of the two arrays
controlHull and weight to be s.
pfNurbCurve2d::getControlHull returns the address of the i'th control
point (not including the weight).
pfNurbCurve2d::getWeight returns the value of the i'th weight.
pfNurbCurve2d::getControlHullSize Returns the length of array
controlHull.
pfNurbCurve2d::getKnotCount returns the number of knots.
pfNurbCurve2d::getKnot returns the i'th knot value.
pfNurbCurve2d::getOrder returns the order of the BSpline.
pfNurbCurve2d::removeControlHullPnt removes the i_th control hull point
and the i_th weight. The length of the control hull and the weights are
changed accordingly, but the space allocated for control hull and weights
is not modified.
pfNurbCurve2d::removeKnot removes the i_th knot. The knot length
decreases by one, but the total space allocated for knots remains the
same.
pfNurbCurve2d::reverse reverse the sense of the a NURB curve by reversing
the knot sequence and swapping the x/y points in the control hull.
virtual void pfNurbCurve2d::evalPt evaluates the NURB curve at domain
point t. The result is stored in pnt.
SEE ALSO
pfCurve2d, pfRep, pfGeode
Page 5