pfPieceWisePolySurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
NAME
pfGetPieceWisePolySurfaceClassType, pfNewPieceWisePolySurface,
pfPieceWisePolySurfaceControlHull,
pfGetPieceWisePolySurfaceSurfaceControlHull,
pfGetPieceWisePolySurfaceSurfaceUpatchCount,
pfGetPieceWisePolySurfaceSurfaceVpatchCount,
pfGetPieceWisePolySurfaceSurfaceUorder,
pfGetPieceWisePolySurfaceSurfaceVorder - A piecewise polynomial surface
FUNCTION SPECIFICATION
#include <Performer/pf.h>
pfType * pfGetPieceWisePolySurfaceClassType(void);
pfPieceWisePolySurface* pfNewPieceWisePolySurface(void *arena);
void -
pfPieceWisePolySurfaceControlHull(pfPieceWisePolySurfaceControlHull *s,
int patchu, int patchv, int iu, int iv,
const pfVec3 *p);
pfVec3 * -
pfGetPieceWisePolySurfaceSurfaceControlHull(pfPieceWisePolySurfaceControlHull *s,
int patchu, int patchv, int iu, int iv);
int -
pfGetPieceWisePolySurfaceSurfaceUpatchCount(pfPieceWisePolySurface *s);
int -
pfGetPieceWisePolySurfaceSurfaceVpatchCount(pfPieceWisePolySurface *s);
int -
pfGetPieceWisePolySurfaceSurfaceUorder(pfPieceWisePolySurface *s,
int patchu, int patchv);
int -
pfGetPieceWisePolySurfaceSurfaceVorder(pfPieceWisePolySurface *s,
int patchu, int patchv);
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfPieceWisePolySurface is derived from the
parent class pfParaSurface, so each of these member functions of class
pfParaSurface are also directly usable with objects of class
pfPieceWisePolySurface. Casting an object of class
pfPieceWisePolySurface 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);
Page 1
pfPieceWisePolySurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
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);
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);
Page 2
pfPieceWisePolySurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
void pfParaSurfaceClearTessellation(pfParaSurface* surf);
Since the class pfParaSurface is itself derived from the parent class
pfGeode, objects of class pfPieceWisePolySurface 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 pfPieceWisePolySurface 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 pfPieceWisePolySurface 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);
Page 3
pfPieceWisePolySurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
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 pfPieceWisePolySurface 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 pfPieceWisePolySurface 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
A piecewise polynomial surface consists of a rectangular array of
patches. Each patch is a polynomial mapping from UV plane to XYZ space
where the domain is always [0,1] X [0,1]. Suppose there are nu patches
along u direction and nv patches along v direction, the total number of
patches is nu*nv.
Notice that an pfPieceWisePolySurface is a subclass of pfParaSurface. The
Page 4
pfPieceWisePolySurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
domain of a pfPieceWisePolySurface is defined to be [0, nu] X [0, nv].
For any given (u,v) is [0, nu]X[0,nv], its corresponding xyz is evaluated
in the following way: The patch index that corresponds to (u,v) is
(floor(u), floor(v)), and the polynomial of that patch is evaluated at
(u-floor(u), v-floor(v)) to get the (x,y,z).
You set the coefficients by setControlHull(patchu, patchv, i,j, Cij).
Here, pfVec3 Cij is the (i'th, j'th) entry of the controlHull of a
specific patch. If you don't set a certain entry, that entry is treated
as a zero vector. The value at parametric coordinates (u,v) is calculated
as the following:
pfVec3 result = (C00 + C01*v + C02*v^2 + ...) +
(C10 + C11*v + C12*v^2 + ...)*u +
(C20 + C21*v + C22*v^2 + ...)*u^2 +
For example, you want a surface with x=v, y=v^2 and z=2uv+3, then
C00 = (0,0,3); only z has a constant 3 item
C01 = (1,0,0); only x=v has a v item
C02 = (0,1,0); only y=v^2 has a v^2 item
C10 = (0,0,0); no u item
C11 = (0,0,2); z has 2uv
All other Cij are zeros.
pfGetPieceWisePolySurfaceSurfaceClassType returns the pfType* for the
class pfPieceWisePolySurface. The pfType* returned by
pfGetPieceWisePolySurfaceSurfaceClassType is the same as the pfType*
returned by invoking pfGetType on any instance of class
pfPieceWisePolySurface. 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.
pfNewPieceWisePolySurface creates an instance of pfPieceWisePolySurface
but sets no valid data.
pfPieceWisePolySurfaceControlHull set the iu iv coefficient of the patchu
patchv polynomial to p. patchu and patchv are clamped if they are
greater than nu and nv respectively.
pfGetPieceWisePolySurfaceControlHull Returns the iu iv coefficient of the
patchu patchv polynomial. No check are made to see if patchu patchv are
in the valid range.
pfGetPieceWisePolySurfaceUpatchCount Returns the number of intervals in
the u direction.
pfGetPieceWisePolySurfaceVpatchCount Returns the number of intervals in
the v direction.
pfGetPieceWisePolySurfaceUorder Returns the order of u in the patchu
Page 5
pfPieceWisePolySurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
patchv polynomial.
pfGetPieceWisePolySurfaceVorder Returns the order of v in the
patchupatchv polynomial.
SEE ALSO
pfRep, pfGeode, pfParaSurface
Page 6