pfNurbSurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
NAME
pfGetNurbSurfaceClassType, pfNewNurbSurface, pfNurbSurfaceControlHull,
pfNurbSurfaceControlHull4, pfNurbSurfaceWeight, pfNurbSurfaceUknot,
pfNurbSurfaceVknot, pfNurbSurfaceControlHullUSize,
pfNurbSurfaceControlHullVSize, pfGetNurbSurfaceControlHull,
pfGetNurbSurfaceControlHullUSize, pfGetNurbSurfaceControlHullVSize,
pfGetNurbSurfaceWeight, pfGetNurbSurfaceUknot, pfGetNurbSurfaceVknot,
pfGetNurbSurfaceUknotCount, pfGetNurbSurfaceVknotCount,
pfGetNurbSurfaceUorder, pfGetNurbSurfaceVorder,
pfRemoveControlHullElmNurbSurface, pfRemoveUknotNurbSurface,
pfRemoveVknotNurbSurface, pfFlipUVNurbSurface - NURB surface
FUNCTION SPECIFICATION
#include <Performer/pf.h>
pfType * pfGetNurbSurfaceClassType(void);
pfNurbSurface* pfNewNurbSurface(void *arena);
void pfNurbSurfaceControlHull(pfNurbSurface* ns, int iu,
int iv, const pfVec3 &p);
void pfNurbSurfaceControlHull4(pfNurbSurface* ns, int iu,
int iv, const pfVec4 &p);
void pfNurbSurfaceWeight(pfNurbSurface* ns, int iu, int iv,
pfReal w);
void pfNurbSurfaceUknot(pfNurbSurface* ns, int iu, pfReal u);
void pfNurbSurfaceVknot(pfNurbSurface* ns, int iv, pfReal v);
void pfNurbSurfaceControlHullUSize(pfNurbSurface* ns, int s);
void pfNurbSurfaceControlHullVSize(pfNurbSurface* ns, int s);
const pfVec3* pfGetNurbSurfaceControlHull(pfNurbSurface* ns, int iu,
int iv);
int pfGetNurbSurfaceControlHullUSize(pfNurbSurface* ns);
int pfGetNurbSurfaceControlHullVSize(pfNurbSurface* ns);
pfReal pfGetNurbSurfaceWeight(pfNurbSurface* ns, int iu,
int iv);
pfReal pfGetNurbSurfaceUknot(pfNurbSurface* ns, int iu);
pfReal pfGetNurbSurfaceVknot(pfNurbSurface* ns, int iv);
Page 1
pfNurbSurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
int pfGetNurbSurfaceUknotCount(pfNurbSurface* ns);
int pfGetNurbSurfaceVknotCount(pfNurbSurface* ns);
int pfGetNurbSurfaceUorder(pfNurbSurface* ns);
int pfGetNurbSurfaceVorder(pfNurbSurface* ns);
void pfRemoveControlHullElmNurbSurface(pfNurbSurface* ns,
int iu, int iv);
void pfRemoveUknotNurbSurface(pfNurbSurface* ns, int iu);
void pfRemoveVknotNurbSurface(pfNurbSurface* ns, int iv);
void pfFlipUVNurbSurface(pfNurbSurface* ns);
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfNurbSurfaceSurface is derived from the
parent class pfParaSurface, so each of these member functions of class
pfParaSurface are also directly usable with objects of class
pfNurbSurfaceSurface. Casting an object of class pfNurbSurfaceSurface to
an object of class pfParaSurface is taken care of automatically. This is
also true for casts to objects of ancestor classes of class
pfParaSurface.
void pfParaSurfaceBeginU(pfParaSurface* surf, pfReal u);
void pfParaSurfaceEndU(pfParaSurface* surf, pfReal u);
void pfParaSurfaceBeginV(pfParaSurface* surf, pfReal v);
void pfParaSurfaceEndV(pfParaSurface* surf, pfReal v);
void pfParaSurfaceSolidId(pfParaSurface* surf, int solidId);
void pfParaSurfaceTopoId(pfParaSurface* surf, int topoId);
void pfParaSurfaceSurfaceId(pfParaSurface* surf, int surfaceId);
pfReal pfGetParaSurfaceBeginU(pfParaSurface* surf);
pfReal pfGetParaSurfaceEndU(pfParaSurface* surf);
pfReal pfGetParaSurfaceBeginV(pfParaSurface* surf);
pfReal pfGetParaSurfaceEndV(pfParaSurface* surf);
int pfGetParaSurfaceTrimLoopCount(pfParaSurface* surf);
pfLoop pfGetParaSurfaceTrimLoopClosed(pfParaSurface* surf,
int loopNum);
int pfGetParaSurfaceTrimCurveCount(pfParaSurface* surf,
int loopNum);
pfEdge* pfGetParaSurfaceTrimCurve(pfParaSurface* surf, int loopNum,
int curveNum);
pfTopo* pfGetParaSurfaceTopo(pfParaSurface* surf);
int pfGetParaSurfaceTopoId(pfParaSurface* surf);
int pfGetParaSurfaceSolidId(pfParaSurface* surf);
int pfGetParaSurfaceSurfaceId(pfParaSurface* surf);
void pfParaSurfaceHandednessHint(pfParaSurface* surf,
pfBool _clockWise);
Page 2
pfNurbSurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
pfBool pfGetParaSurfaceHandednessHint(pfParaSurface* surf);
void pfParaSurfaceInsertTrimCurve(pfParaSurface* surf,
int loopNum, pfCurve2d *c, pfDisCurve2d *d);
void pfParaSurfaceAddTrimCurve(pfParaSurface* surf, int loopNum,
pfCurve2d *c, pfDisCurve2d *d);
void pfParaSurfaceTrimLoopClosed(pfParaSurface* surf,
int loopNum, pfLoop closed);
void pfParaSurfaceEvalPt(pfParaSurface* surf, pfReal u,
pfReal v, pfVec3 pnt);
void pfParaSurfaceEvalDu(pfParaSurface* surf, pfReal u,
pfReal v, pfVec3 Du);
void pfParaSurfaceEvalDv(pfParaSurface* surf, pfReal u,
pfReal v, pfVec3 Dv);
void pfParaSurfaceEvalDuu(pfParaSurface* surf, pfReal u,
pfReal v, pfVec3 Duu);
void pfParaSurfaceEvalDvv(pfParaSurface* surf, pfReal u,
pfReal v, pfVec3 Dvv);
void pfParaSurfaceEvalDuv(pfParaSurface* surf, pfReal u,
pfReal v, pfVec3 Duv);
void pfParaSurfaceEvalNorm(pfParaSurface* surf, pfReal u,
pfReal v, pfVec3 norm);
void pfParaSurfaceEvalD(pfParaSurface* surf, pfReal u, pfReal v,
pfReal theta, pfVec3 D);
void pfParaSurfaceEvalDD(pfParaSurface* surf, pfReal u,
pfReal v, pfReal theta, pfVec3 DD);
int pfParaSurfaceGState(pfParaSurface* surf,
pfGeoState *gState);
pfGeoState* pfGetParaSurfaceGState(pfParaSurface* surf);
void pfParaSurfaceClearTessellation(pfParaSurface* surf);
Since the class pfParaSurface is itself derived from the parent class
pfGeode, objects of class pfNurbSurfaceSurface can also be used with
these functions designed for objects of class pfGeode.
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 pfGeode is itself derived from the parent class pfGeode,
objects of class pfNurbSurfaceSurface 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);
Page 3
pfNurbSurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
int pfGetNumGSets(const pfGeode* geode);
Since the class pfGeode is itself derived from the parent class pfNode,
objects of class pfNurbSurfaceSurface 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);
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 pfNurbSurfaceSurface 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);
Page 4
pfNurbSurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
Since the class pfObject is itself derived from the parent class
pfMemory, objects of class pfNurbSurfaceSurface 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);
void pfPrint(const void *ptr, uint which, uint verbose,
FILE *file);
void * pfGetArena(void *ptr);
DESCRIPTION
Defines a Non-Uniform Rational BSpline surface. The control hull points
of a Nurb surface are arranged in a 2-dimensional array. To figure out
the ordering of these control points, notice that the point evaluation
formula can be expressed as
P(u,v) = sum_{iu,iv} B_iu(u)B_iv(v) C[iu][iv] / sum_{iu,iv} B_iu(u)B_iv(v) W[iu][iv]
where B_iu(u) are basis functions u along the u-axis, and B_iv(v) are
basis functions along v-axis, C is the control hull, and W is the
weights.
Both the control hull and the weight are two-dimensional arrays: The
number of control points along u-axis is equal to number_of_u_knots -
uorder, and the number of control points along v-axis is equal to
number_of_v_knots - vorder.
pfGetNurbSurfaceSurfaceClassType returns the pfType* for the class
pfNurbSurfaceSurface. The pfType* returned by
pfGetNurbSurfaceSurfaceClassType is the same as the pfType* returned by
invoking pfGetType on any instance of class pfNurbSurfaceSurface.
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.
pfNewNurbSurface creates an instance of pfNurbSurfaceSurface but sets no
valid data.
Page 5
pfNurbSurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
pfNurbSurfaceControlHull Sets the (iu,iv)'th point of the control hull to
be p. This control point corresponds to basis pair B_iu(u) and B_iv(v).
The weight is set to 1.0 if it has't been set yet.
pfNurbSurfaceControlHull4 Sets the (iu,iv)'th point of the control hull
to p[0..2], and the weight to p[3]. This control point and weight
correspond to basis pair B_iu(u) and B_iv(v).
PfNurbSurfaceWeight Sets the (iu,iv)'th weight to be w. This weight
corresponds to basis pair B_iu(u) and B_iv(v).
pfNurbSurfaceUknot Sets the iu'th u-knot value to be u.
pfNurbSurfaceVknot Sets the iv'th vknot value to be v.
pfNurbSurfaceControlHullUSize A hint on the number of control points
along the u-direction. It is used only as a hint for dynamically
allocating space for the arrays control hull and the weight. The
correctness of this number is not critical.
pfNurbSurfaceControlHullVSize A hint on the number of control points
along the v-direction. It is used only as a hint for dynamically
allocating space for the arrays control hull and the weight. The
correctness of this number is not critical.
pfGetNurbSurfaceControlHull Returns the (iu,iv)'th control point that
corresponds to basis B_iu(u) and B_iv(v).
pfGetNurbSurfaceControlHullUSize Returns the number of control points
along each u direction (v=constant).
pfGetNurbSurfaceControlHullVSize Returns the number of control points
along each v direction (u=constant).
pfGetNurbSurfaceWeight Returns the (iu,iv)'th weight value which
corresponds to basis B_iu(u) and B_iv(v).
pfGetNurbSurfaceUknot Returns the iu'th u-knot value.
pfGetNurbSurfaceVknot Returns the iv'th v-knot value.
pfGetNurbSurfaceUknotCount Returns the number of u-knot values.
pfGetNurbSurfaceVknotCount Returns the number of v-knot values.
pfGetNurbSurfaceUorder Returns the order of basis functions along u-
direction.
pfGetNurbSurfaceVorder Returns the order of basis functions along v-
Page 6
pfNurbSurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
direction.
pfRemoveControlHullElmNurbSurface Removes the control hull element (iu,
iv), and the weight (iu, iv). If iu is the last u-element of the iv row
then the iv row is removed. Weights are treated similarly. The length
of the control hull and the weights are changed accordingly, but the
space allocated for control hull and weights is not modified.
pfRemoveUknotNurbSurface Removes the iu_th u-knot. The u-knot length
decreases by one, but the total space allocated for u-knots remains the
same.
pfRemoveVknotNurbSurface Removes the iv_th v-knot. The v-knot length
decreases by one, but the total space allocated for v-knots remains the
same.
LcpfFlipUVNurbSurface Transposes the U and V coordinate system, control
points and trim curves appropriately.
SEE ALSO
pfRep, pfGeode, pfParaSurface
Page 7