pfParaSurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
NAME
pfGetParaSurfaceClassType, pfParaSurfaceBeginU, pfParaSurfaceEndU,
pfParaSurfaceBeginV, pfParaSurfaceEndV, pfParaSurfaceSolidId,
pfParaSurfaceTopoId, pfParaSurfaceSurfaceId, pfGetParaSurfaceBeginU,
pfGetParaSurfaceEndU, pfGetParaSurfaceBeginV, pfGetParaSurfaceEndV,
pfGetParaSurfaceTrimLoopCount, pfGetParaSurfaceTrimLoopClosed,
pfGetParaSurfaceTrimCurveCount, pfGetParaSurfaceTrimCurve,
pfGetParaSurfaceTopo, pfGetParaSurfaceTopoId, pfGetParaSurfaceSolidId,
pfGetParaSurfaceSurfaceId, pfParaSurfaceHandednessHint,
pfGetParaSurfaceHandednessHint, pfParaSurfaceInsertTrimCurve,
pfParaSurfaceAddTrimCurve, pfParaSurfaceTrimLoopClosed,
pfParaSurfaceEvalPt, pfParaSurfaceEvalDu, pfParaSurfaceEvalDv,
pfParaSurfaceEvalDuu, pfParaSurfaceEvalDvv, pfParaSurfaceEvalDuv,
pfParaSurfaceEvalNorm, pfParaSurfaceEvalD, pfParaSurfaceEvalDD,
pfParaSurfaceGState, pfGetParaSurfaceGState,
pfParaSurfaceClearTessellation - A trimmed parametric surface.
FUNCTION SPECIFICATION
#include <Performer/pf.h>
pfType * pfGetParaSurfaceClassType(void);
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);
Page 1
pfParaSurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
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);
Page 2
pfParaSurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
int pfParaSurfaceGState(pfParaSurface* surf,
pfGeoState *gState);
pfGeoState* pfGetParaSurfaceGState(pfParaSurface* surf);
void pfParaSurfaceClearTessellation(pfParaSurface* surf);
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfParaSurface is derived from the parent class
pfGeode, so each of these member functions of class pfGeode are also
directly usable with objects of class pfParaSurface. Casting an object
of class pfParaSurface to an object of class pfGeode is taken care of
automatically. This is also true for casts to objects of ancestor
classes 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 pfParaSurface 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 pfParaSurface 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[]);
Page 3
pfParaSurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
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 pfParaSurface 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 pfParaSurface 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);
Page 4
pfParaSurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
DESCRIPTION
A parametric surface is a mapping from 2D UV space (parametric space) to
3D XYZ space (object space) with the domain being a rectangle specified
by [beginU, endU] X [beginV, endV].
A trimmed parametric surface is a parametric surface with some number of
trim loops which redefines the domain by, intuitively speaking, cutting
holes in the domain rectangle. Each trim loop divides the UV plane into
two areas: the one enclosed by this loop and the one outside this loop.
If a trim loop is oriented counter-clock wise, the area enclosed by this
loop is retained (as part of the domain), and the part outside is
discarded. If a trim loop is oriented clock wise, the area enclosed by
this loop is discarded, and the part outside is retained.
It is assumed that any two trim loops do not intersect, and each trim
loop does not intersect itself. If any of these conditions are violated,
the result of the tessellation is not defined.
The following suggestions should help to clarify these conventions. The
outmost trim loop should be counter clockwise. The one immediately
enclosed by this outmost trim loop should be clockwise, etc.
pfGetParaSurfaceClassType returns the pfType* for the class
pfParaSurface. The pfType* returned by pfGetParaSurfaceClassType is the
same as the pfType* returned by invoking pfGetType on any instance of
class pfParaSurface. 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.
pfParaSurfaceAddTrimCurve takes an input trim curve as specified by (c,
d), and stick it to the end of the trim loop as indexed by loopNum. It is
an error if the loop is already closed before adding this curve.
pfParaSurfaceClearTessellation removes all the data resulted from
previous tessellation. This allows this surface to be retessellated with
a different tolerance. For each trim curve, the disCurve is deleted if
the contCurve is not NULL. The xyzBoundary in its boundary structure (-
pfBoundary) is deleted. Also the tessellated triangles (pfGeoSets) are
removed.
pfParaSurfaceEval evaluates the point, all the first and second order
partial derivatives.
pfParaSurfaceEvalD evaluates the directional derivatives along the
direction which has the angle theta relative to u-axis. The deriatives
are stored in D.
Page 5
pfParaSurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
pfParaSurfaceEvalDD evaluates the second order directional derivatives
along the direction which has the angle theta relative to u-axis. The
deriatives are stored in DD.
pfParaSurfaceEvalDu evaluates the partial derivatives of the surface with
respect to parameter u at (u,v). The result is stored in Du.
pfParaSurfaceEvalDuu evaluates the second order partial derivatives of
the surface with respect to parameter u at (u,v). The result is stored
in Duu.
pfParaSurfaceEvalDuv evaluates the second order mixed derivatives of the
surface at (u,v). The result is stored in Duv.
pfParaSurfaceEvalDv evaluates the partial derivatives of the surface with
respect to parameter v at (u,v). The result is stored in Dv.
pfParaSurfaceEvalDvv evaluates the second order partial derivatives of
the surface with respect to parameter v at (u,v). The result is stored
in Dvv.
pfParaSurfaceEvalNorm evaluates the surface normal at (u, v). The result
is stored in norm.
pfParaSurfaceEvalPt evaluates the xyz in the object space at (u, v). The
result is stored in pnt.
pfGetParaSurfaceBeginU returns beginU.
pfGetParaSurfaceBeginV returns beginV.
pfGetParaSurfaceEndU returns endU.
pfGetParaSurfaceEndV returns endV.
pfGetParaSurfaceHandednessHint returns true if clockwise, false
otherwise.
pfGetParaSurfaceSolidId returns the solidId.
pfGetParaSurfaceSurfaceId returns the surfaceId.
pfGetParaSurfaceTopo returns the topology of the surface.
pfGetParaSurfaceTopoId returns the topoId.
pfGetParaSurfaceTrimCurve returns the trim curve indexed by loopNum and
curveNum.
pfGetParaSurfaceTrimCurveCount returns the number of trim curves of the
loop loopNum.
Page 6
pfParaSurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
pfGetParaSurfaceTrimLoopClosed returns the closedness (PFLOOP_OPEN,
PFLOOP_CLOSED, PFLOOP_PERIODIC, PFLOOP_UNRESOLVED) of the loop.
pfGetParaSurfaceTrimLoopCount returns the number of trim loops.
pfParaSurfaceInsertTrimCurve takes an input trim curve as specified by
(c, d), and linearly searches all the trim curves in the loop (specified
by loopNum) to find any existing trim curve whose end point matches one
or both the input curve's end point.
If no matches are found, it is appended to at the end of the loop.
pfParaSurfaceBeginU sets beginU to be u, and updates du.
pfParaSurfaceBeginV sets beginV to be v, and updates dv.
pfParaSurfaceEndU sets endU to be u, and updates du.
pfParaSurfaceEndV sets endV to be v, and updates dv.
pfParaSurfaceHandednessHint set a handedness hint about the surface.
False means counter-clockwise (right-handed).
pfParaSurfaceSolidId sets solidId.
pfParaSurfaceSurfaceId sets surfaceId.
pfParaSurfaceTopoId sets topoId.
pfParaSurfaceTrimLoopClosed set trimLoopClosed[loopNum] to be closed.
pfGetParaSurfaceGState returns a pointer to the geostate used for
tessellation of this surface.
pfParaSurfaceGState sets the pointer for the geostate to be used during
tessellation of this surface. Returns 1 if successful and -1 otherwise.
BUGSSEE ALSO
pfTopo, pfEdge, pfCurve2d, pfDisCurve2d, pfBoundary, pfGeode, pfRep,
pfGeoState, pfGeoSet, pfdTessellateGeometry
Page 7