pfNurbCurve2d(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
NAME
pfGetpfNurbCurve2dClassType, pfNewNurbCurve2d, pfGetNurbCurve2dClassType,
pfNurbCurve2dControlHull, pfNurbCurve2dControlHull2, pfNurbCurve2dWeight,
pfNurbCurve2dKnot, pfNurbCurve2dControlHullSize,
pfGetNurbCurve2dControlHull, pfGetNurbCurve2dWeight,
pfGetNurbCurve2dControlHullSize, pfGetNurbCurve2dKnotCount,
pfGetNurbCurve2dKnot, pfGetNurbCurve2dOrder,
pfNurbCurve2dRemoveControlHullPnt, pfNurbCurve2dRemoveKnot,
pfNurbCurve2dReverse - Non-Uniform Rational BSpline curves in 2D
FUNCTION SPECIFICATION
#include <Performer/pf.h>
pfType * pfGetpfNurbCurve2dClassType(void);
pfNurbCurve2d* pfNewNurbCurve2d(void *arena);
pfType* pfGetNurbCurve2dClassType(void);
void pfNurbCurve2dControlHull(pfNurbCurve2d* nc, int i,
const pfVec3 &p);
void pfNurbCurve2dControlHull2(pfNurbCurve2d* nc, int i,
const pfVec2 &p);
void pfNurbCurve2dWeight(pfNurbCurve2d* nc, int i, pfReal w);
void pfNurbCurve2dKnot(pfNurbCurve2d* nc, int i, pfReal t);
void pfNurbCurve2dControlHullSize(pfNurbCurve2d* nc, int s);
pfVec2* pfGetNurbCurve2dControlHull(pfNurbCurve2d* nc, int i);
pfReal pfGetNurbCurve2dWeight(pfNurbCurve2d* nc, int i);
int pfGetNurbCurve2dControlHullSize(pfNurbCurve2d* nc);
int pfGetNurbCurve2dKnotCount(pfNurbCurve2d* nc);
pfReal pfGetNurbCurve2dKnot(pfNurbCurve2d* nc, int i);
int pfGetNurbCurve2dOrder(pfNurbCurve2d* nc);
void pfNurbCurve2dRemoveControlHullPnt(pfNurbCurve2d* nc,
int i);
void pfNurbCurve2dRemoveKnot(pfNurbCurve2d* nc, int i);
void pfNurbCurve2dReverse(pfNurbCurve2d* nc);
Page 1
pfNurbCurve2d(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
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. Casting an object
of class pfNurbCurve2d to an object of class pfCurve2d is taken care of
automatically. This is also true for casts to objects of ancestor
classes of class pfCurve2d.
void pfCurve2dBeginT(pfCurve2d *curve, pfReal t);
void pfCurve2dEndT(pfCurve2d *curve, pfReal t);
pfReal pfGetCurve2dBeginT(pfCurve2d *curve);
pfReal pfGetCurve2dEndT(pfCurve2d *curve);
void pfCurve2dSetClosed(pfCurve2d *curve, pfLoop loopVal);
pfLoop pfGetCurve2dClosed(pfCurve2d *curve);
void pfCurve2dClosedTol(pfCurve2d *curve, pfReal tol);
pfReal pfGetCurve2dClosedTol(pfCurve2d *curve);
void pfCurve2dEvalPt(pfCurve2d *curve, pfReal t, pfVec2 &pt);
void pfCurve2dEvalTan(pfCurve2d *curve, pfReal t, pfVec2 &pt);
void pfCurve2dEvalNorm(pfCurve2d *curve, pfReal t, pfVec2 &pt);
void pfCurve2dEvalCurv(pfCurve2d *curve, pfReal *curv);
void pfCurve2dEvalAll(pfCurve2d *curve, pfReal t, pfVec2 &pt,
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 pfRepOrigin(pfRep *rep, const pfVec3 origin);
void pfRepOrient(pfRep *rep, const pfMatrix mat);
void pfGetRepOrigin(pfRep *rep, pfVec3* origin);
void pfGetRepOrient(pfRep *rep, pfMatrix *mat);
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 pfAddGSet(pfGeode* geode, pfGeoSet* gset);
int pfRemoveGSet(pfGeode* geode, pfGeoSet* gset);
int pfInsertGSet(pfGeode* geode, int index, pfGeoSet* gset);
int pfReplaceGSet(pfGeode* geode, pfGeoSet* old, pfGeoSet* new);
pfGeoSet * pfGetGSet(const pfGeode* geode, int index);
int pfGetNumGSets(const pfGeode* geode);
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.
Page 2
pfNurbCurve2d(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
pfGroup * pfGetParent(const pfNode *node, int i);
int pfGetNumParents(const pfNode *node);
void pfNodeBSphere(pfNode *node, pfSphere *bsph, int mode);
int pfGetNodeBSphere(pfNode *node, pfSphere *bsph);
pfNode* pfClone(pfNode *node, int mode);
pfNode* pfBufferClone(pfNode *node, int mode, pfBuffer *buf);
int pfFlatten(pfNode *node, int mode);
int pfNodeName(pfNode *node, const char *name);
const char * pfGetNodeName(const pfNode *node);
pfNode* pfFindNode(pfNode *node, const char *pathName,
pfType *type);
pfNode* pfLookupNode(const char *name, pfType* type);
int pfNodeIsectSegs(pfNode *node, pfSegSet *segSet,
pfHit **hits[]);
void pfNodeTravMask(pfNode *node, int which, uint mask,
int setMode, int bitOp);
uint pfGetNodeTravMask(const pfNode *node, int which);
void pfNodeTravFuncs(pfNode* node, int which,
pfNodeTravFuncType pre, pfNodeTravFuncType post);
void pfGetNodeTravFuncs(const pfNode* node, int which,
pfNodeTravFuncType *pre, pfNodeTravFuncType *post);
void pfNodeTravData(pfNode *node, int which, void *data);
void * pfGetNodeTravData(const pfNode *node, int which);
void pfNodeTravMode(pfNode* node, int which, int mode,
int val);
int pfGetNodeTravMode(const pfNode* node, int which,
int mode);
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 pfUserDataSlot(pfObject *obj, int slot, void *data);
void pfUserData(pfObject *obj, void *data);
void* pfGetUserDataSlot(pfObject *obj, int slot);
void* pfGetUserData(pfObject *obj);
int pfGetNumUserData(pfObject *obj);
int pfGetNamedUserDataSlot(const char *name);
const char* pfGetUserDataSlotName(int slot);
int pfGetNumNamedUserDataSlots(void);
int pfDeleteGLHandle(pfObject *obj);
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.
pfType * pfGetType(const void *ptr);
int pfIsOfType(const void *ptr, pfType *type);
Page 3
pfNurbCurve2d(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
int pfIsExactType(const void *ptr, pfType *type);
const char * pfGetTypeName(const void *ptr);
int pfRef(void *ptr);
int pfUnref(void *ptr);
int pfUnrefDelete(void *ptr);
int pfUnrefGetRef(void *ptr);
int pfGetRef(const void *ptr);
int pfCopy(void *dst, void *src);
int pfDelete(void *ptr);
int pfIsFluxed(void *ptr);
int pfCompare(const void *ptr1, const void *ptr2);
void pfPrint(const void *ptr, uint which, uint verbose,
FILE *file);
void * pfGetArena(void *ptr);
DESCRIPTION
pfNurbCurve2d 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.
pfGetpfNurbCurve2dClassType returns the pfType* for the class
pfNurbCurve2d. The pfType* returned by pfGetpfNurbCurve2dClassType is
the same as the pfType* returned by invoking pfGetType 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 pfIsOfType 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.
pfNewpfNurbCurve2d creates an instance of an pfNurbCurve2d. By default
the parametric domain is defined as [0..1].
pfNurbCurve2dControlHull 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.
pfNurbCurve2dControlHull 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.
pfNurbCurve2dWeight sets the i'th component of weight to be w.
Page 4
pfNurbCurve2d(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
pfNurbCurve2dKnot sets the <arg i>'th knot to be t. Updates order,
beginT, and endT accordingly (See pfNurbCurve2dControlHull).
pfNurbCurve2dControlHullSize sets the extension of the two arrays
controlHull and weight to be s.
pfGetNurbCurve2dControlHull returns the address of the i'th control point
(not including the weight).
pfGetNurbCurve2dWeight returns the value of the i'th weight.
pfGetNurbCurve2dControlHullSize Returns the length of array controlHull.
pfGetNurbCurve2dKnotCount returns the number of knots.
pfGetNurbCurve2dKnot returns the i'th knot value.
pfGetNurbCurve2dOrder returns the order of the BSpline.
pfNurbCurve2dRemoveControlHullPnt 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.
pfNurbCurve2dRemoveKnot removes the i_th knot. The knot length decreases
by one, but the total space allocated for knots remains the same.
pfNurbCurve2dReverse reverse the sense of the a NURB curve by reversing
the knot sequence and swapping the x/y points in the control hull.
SEE ALSO
pfCurve2d, pfRep, pfGeode
Page 5