pfPieceWisePolySurface(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
NAMEpfPieceWisePolySurface - A piecewise polynomial surface
FUNCTION SPECIFICATION
#include <Performer/pf/pfPieceWisePolySurface.h>
static pfType * pfPieceWisePolySurface::getClassType(void);
pfPieceWisePolySurface::pfPieceWisePolySurface();
void pfPieceWisePolySurface::setControlHull(int patchu,
int patchv, int iu, int iv, const pfVec3 *p);
pfVec3 * pfPieceWisePolySurface::getControlHull(int patchu,
int patchv, int iu, int iv);
int pfPieceWisePolySurface::getUpatchCount();
int pfPieceWisePolySurface::getVpatchCount();
int pfPieceWisePolySurface::getUorder(int patchu,
int patchv);
int pfPieceWisePolySurface::getVorder(int patchu,
int patchv);
virtual void pfPieceWisePolySurface::evalPt(pfReal u, pfReal v,
pfVec3 &pnt);
virtual void pfPieceWisePolySurface::evalDu(pfReal u, pfReal v,
pfVec3 &Du);
virtual void pfPieceWisePolySurface::evalDuu(pfReal u, pfReal v,
pfVec3 &Duu);
virtual void pfPieceWisePolySurface::evalDvv(pfReal u, pfReal v,
pfVec3 &Du);
virtual void pfPieceWisePolySurface::evalNorm(pfReal u, pfReal v,
pfVec3 &norm);
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. This is also true for ancestor classes of class
pfParaSurface.
void pfParaSurface::setBeginU(pfReal u);
void pfParaSurface::setEndU(pfReal u);
Page 1
pfPieceWisePolySurface(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
void pfParaSurface::setBeginV(pfReal v);
void pfParaSurface::setEndV(pfReal v);
void pfParaSurface::setSolidId(int solidId);
void pfParaSurface::setTopoId(int topoId);
void pfParaSurface::setSurfaceId(int surfaceId);
pfReal pfParaSurface::getBeginU(pfParaSurface* surf);
pfReal pfParaSurface::getEndU(pfParaSurface* surf);
pfReal pfParaSurface::getBeginV(pfParaSurface* surf);
pfReal pfParaSurface::getEndV(pfParaSurface* surf);
int pfParaSurface::getTrimLoopCount(pfParaSurface* surf);
pfLoop pfParaSurface::getTrimLoopClosed(int loopNum);
int pfParaSurface::getTrimCurveCount(int loopNum);
pfEdge* pfParaSurface::getTrimCurve(int loopNum, int curveNum);
pfTopo* pfParaSurface::getTopo();
int pfParaSurface::getTopoId();
int pfParaSurface::getSolidId();
int pfParaSurface::getSurfaceId();
void pfParaSurface::getHandednessHint(pfBool _clockWise);
pfBool pfParaSurface::getHandednessHint();
void pfParaSurface::insertTrimCurve(int loopNum, pfCurve2d *c,
pfDisCurve2d *d);
void pfParaSurface::addTrimCurve(int loopNum, pfCurve2d *c,
pfDisCurve2d *d);
void pfParaSurface::setTrimLoopClosed(int loopNum,
pfLoop closed);
void pfParaSurface::evalPt(pfReal u, pfReal v, pfVec3& pnt);
void pfParaSurface::evalDu(pfReal u, pfReal v, pfVec3& Du);
void pfParaSurface::evalDv(pfReal u, pfReal v, pfVec3& Dv);
void pfParaSurface::evalDuu(pfReal u, pfReal v, pfVec3& Duu);
void pfParaSurface::evalDvv(pfReal u, pfReal v, pfVec3& Dvv);
void pfParaSurface::evalDuv(pfReal u, pfReal v, pfVec3& Duv);
void pfParaSurface::evalNorm(pfReal u, pfReal v, pfVec3& norm);
void pfParaSurface::evalD(pfReal u, pfReal v, pfReal theta,
pfVec3& D);
void pfParaSurface::evalDD(pfReal u, pfReal v, pfReal theta,
pfVec3& DD);
int pfParaSurface::setGState(pfGeoState *gState);
pfGeoState* pfParaSurface::getGState();
void pfParaSurface::clearTessellation();
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 pfRep::setOrigin(const pfVec3 *origin);
void pfRep::setOrient(const pfMatrix *mat);
void pfRep::getOrigin(pfVec3& origin);
void pfRep::getOrient(pfMatrix& matrix);
Page 2
pfPieceWisePolySurface(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
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 pfGeode::addGSet(pfGeoSet* gset);
int pfGeode::removeGSet(pfGeoSet* gset);
int pfGeode::insertGSet(int index, pfGeoSet* gset);
int pfGeode::replaceGSet(pfGeoSet* old, pfGeoSet* new);
pfGeoSet * pfGeode::getGSet(int index);
int pfGeode::getNumGSets(void);
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 * pfNode::getParent(int i);
int pfNode::getNumParents(void);
void pfNode::setBound(pfSphere *bsph, int mode);
int pfNode::getBound(pfSphere *bsph);
pfNode* pfNode::clone(int mode);
pfNode* pfNode::bufferClone(int mode, pfBuffer *buf);
int pfNode::flatten(int mode);
int pfNode::setName(const char *name);
const char * pfNode::getName(void);
pfNode* pfNode::find(const char *pathName, pfType *type);
pfNode* pfNode::lookup(const char *name, pfType* type);
int pfNode::isect(pfSegSet *segSet, pfHit **hits[]);
void pfNode::setTravMask(int which, uint mask, int setMode,
int bitOp);
uint pfNode::getTravMask(int which);
void pfNode::setTravFuncs(int which, pfNodeTravFuncType pre,
pfNodeTravFuncType post);
void pfNode::getTravFuncs(int which, pfNodeTravFuncType *pre,
pfNodeTravFuncType *post);
void pfNode::setTravData(int which, void *data);
void * pfNode::getTravData(int which);
void pfNode::setTravMode(int which, int mode, int val);
int pfNode::getTravMode(int which, int mode) const;
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* pfObject::operator new(size_t);
void* pfObject::operator new(size_t, pfFluxMemory *fmem);
void pfObject::setUserData(void *data);
void pfObject::setUserData(int slot, void *data);
void* pfObject::getUserData(pfObject *obj);
Page 3
pfPieceWisePolySurface(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
void* pfObject::getUserData(pfObject *obj, int slot);
int pfObject::getNumUserData();
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.
void* pfMemory::getData(const void *ptr);
pfType * pfMemory::getType();
int pfMemory::isOfType(pfType *type);
int pfMemory::isExactType(pfType *type);
const char * pfMemory::getTypeName();
int pfMemory::copy(pfMemory *src);
int pfMemory::compare(const pfMemory *mem);
void pfMemory::print(uint which, uint verbose, char *prefix,
FILE *file);
int pfMemory::getArena(void *ptr);
void* pfMemory::getArena();
int pfMemory::ref();
int pfMemory::unref();
int pfMemory::unrefDelete();
int pfMemory::unrefGetRef();
int pfMemory::getRef();
int pfMemory::checkDelete();
int pfMemory::isFluxed();
void * pfMemory::getArena();
int pfMemory::getSize();
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
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 +
Page 4
pfPieceWisePolySurface(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
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.
pfPieceWisePolySurface::getClassType returns the pfType* for the class
pfPieceWisePolySurface. The pfType* returned by
pfPieceWisePolySurface::getClassType is the same as the pfType* returned
by invoking the virtual function getType 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 the member function isOfType 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.
pfPieceWisePolySurface::pfPieceWisePolySurface creates an instance of
pfPieceWisePolySurface but sets no valid data.
pfPieceWisePolySurface::setControlHull 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.
pfPieceWisePolySurface::getControlHull Returns the iu iv coefficient of
the patchu patchv polynomial. No check are made to see if patchu patchv
are in the valid range.
pfPieceWisePolySurface::getUpatchCount Returns the number of intervals in
the u direction.
pfPieceWisePolySurface::getVpatchCount Returns the number of intervals in
the v direction.
pfPieceWisePolySurface::getUorder Returns the order of u in the patchu
patchv polynomial.
pfPieceWisePolySurface::getVorder Returns the order of v in the
patchupatchv polynomial. pfPieceWisePolySurface::evalPt Evaluates the
surface at point u v, and returns the result in pnt. The values of u v
are clamped to fit within the defined interval.
pfPieceWisePolySurface::evalDu Calculates the u derivative of the surface
at the point u v and returns the result in Du. The values of u v are
clamped to fit within the defined interval.
pfPieceWisePolySurface::evalDv Calculates the v derivative of the surface
at the point u v and returns the result in Dv. The values of u v are
clamped to fit within the defined interval.
pfPieceWisePolySurface::evalDuu Calculates the second order u derivative
Page 5
pfPieceWisePolySurface(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
of the surface at the point u v and returns the result in Duu. The
values of u v are clamped to fit within the defined interval.
pfPieceWisePolySurface::evalDvv Calculates the second v derivative of the
surface at the point u v and returns the result in Dvv. The values of u
v are clamped to fit within the defined interval.
SEE ALSO
pfRep, pfGeode, pfParaSurface
Page 6