pfNurbCurve3d(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
NAME
pfGetpfNurbCurve3dClassType, pfNewNurbCurve3d, pfGetNurbCurve3dClassType,
pfNurbCurve3dControlHull, pfNurbCurve3dWeight, pfNurbCurve3dKnot,
pfNurbCurve3dControlHullSize, pfGetNurbCurve3dControlHull,
pfGetNurbCurve3dWeight, pfGetNurbCurve3dControlHullSize,
pfGetNurbCurve3dKnotCount, pfGetNurbCurve3dKnot, pfGetNurbCurve3dOrder,
pfNurbCurve3dRemoveControlHullPnt, pfNurbCurve3dRemoveKnot,
pfNurbCurve3dReverse - Non-Uniform Rational BSpline curves in 3D
FUNCTION SPECIFICATION
#include <Performer/pf.h>
pfType * pfGetpfNurbCurve3dClassType(void);
pfNurbCurve3d* pfNewNurbCurve3d(void *arena);
pfType* pfGetNurbCurve3dClassType(void);
void pfNurbCurve3dControlHull(pfNurbCurve3d* nc, int i,
const pfVec4 &p);
void pfNurbCurve3dWeight(pfNurbCurve3d* nc, int i, pfReal w);
void pfNurbCurve3dKnot(pfNurbCurve3d* nc, int i, pfReal t);
void pfNurbCurve3dControlHullSize(pfNurbCurve3d* nc, int s);
pfVec3* pfGetNurbCurve3dControlHull(pfNurbCurve3d* nc, int i);
pfReal pfGetNurbCurve3dWeight(pfNurbCurve3d* nc, int i);
int pfGetNurbCurve3dControlHullSize(pfNurbCurve3d* nc);
int pfGetNurbCurve3dKnotCount(pfNurbCurve3d* nc);
pfReal pfGetNurbCurve3dKnot(pfNurbCurve3d* nc, int i);
int pfGetNurbCurve3dOrder(pfNurbCurve3d* nc);
void pfNurbCurve3dRemoveControlHullPnt(pfNurbCurve3d* nc,
int i);
void pfNurbCurve3dRemoveKnot(pfNurbCurve3d* nc, int i);
void pfNurbCurve3dReverse(pfNurbCurve3d* nc);
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfNurbCurve3d is derived from the parent class
pfCurve3d, so each of these member functions of class pfCurve3d are also
directly usable with objects of class pfNurbCurve3d. Casting an object
of class pfNurbCurve3d to an object of class pfCurve3d is taken care of
automatically. This is also true for casts to objects of ancestor
Page 1
pfNurbCurve3d(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
classes of class pfCurve3d.
pfReal pfGetCurve3dBeginT(pfCurve3d *curve);
pfReal pfGetCurve3dEndT(pfCurve3d *curve);
void pfCurve3dSetClosed(pfCurve3d *curve, int loopVal);
int pfGetCurve3dClosed(pfCurve3d *curve);
void pfCurve3dClosedTol(pfCurve3d *curve, pfReal tol);
pfReal pfGetCurve3dClosedTol(pfCurve3d *curve);
void pfCurve3dEvalPt(pfCurve3d *curve, pfReal t, pfVec3 &pt);
void pfCurve3dEvalTan(pfCurve3d *curve, pfReal t, pfVec3 &pt);
void pfCurve3dEvalNorm(pfCurve3d *curve, pfReal t, pfVec3 &pt);
Since the class pfCurve3d is itself derived from the parent class pfRep,
objects of class pfNurbCurve3d 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 pfNurbCurve3d 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 pfNurbCurve3d can also be used with these functions
designed for objects of class pfNode.
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);
Page 2
pfNurbCurve3d(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
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 pfNurbCurve3d 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 pfNurbCurve3d 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);
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);
Page 3
pfNurbCurve3d(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
void pfPrint(const void *ptr, uint which, uint verbose,
FILE *file);
void * pfGetArena(void *ptr);
DESCRIPTION
pfNurbCurve3d defines a Non-Uniform Rational BSpline curve in three
dimensional space. A 3D Nurb curve is defined by an array of knot
values, an array of 3D 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.
pfGetpfNurbCurve3dClassType returns the pfType* for the class
pfNurbCurve3d. The pfType* returned by pfGetpfNurbCurve3dClassType is
the same as the pfType* returned by invoking pfGetType on any instance of
class pfNurbCurve3d. 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.
pfNewpfNurbCurve3d creates an instance of an pfNurbCurve3d. By default
the parametric domain is defined as [0..1].
pfNurbCurve3dControlHull 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.
pfNurbCurve3dWeight sets the i'th component of weight to be w.
pfNurbCurve3dKnot sets the <arg i>'th knot to be t. Updates order,
beginT, and endT accordingly (See pfNurbCurve3dControlHull).
pfNurbCurve3dControlHullSize sets the extension of the two arrays
controlHull and weight to be s.
pfGetNurbCurve3dControlHull returns the address of the i'th control point
(not including the weight).
pfGetNurbCurve3dWeight returns the value of the i'th weight.
pfGetNurbCurve3dControlHullSize Returns the length of array controlHull.
pfGetNurbCurve3dKnotCount returns the number of knots.
pfGetNurbCurve3dKnot returns the i'th knot value.
Page 4
pfNurbCurve3d(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
pfGetNurbCurve3dOrder returns the order of the BSpline.
pfNurbCurve3dRemoveControlHullPnt 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.
pfNurbCurve3dRemoveKnot removes the i_th knot. The knot length decreases
by one, but the total space allocated for knots remains the same.
pfNurbCurve3dReverse 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
pfCurve3d, pfRep, pfGeode
Page 5