pfCurve3d(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
NAMEpfCurve3d - Abstract base class for all continuous 3D parametric curves.
FUNCTION SPECIFICATION
#include <Performer/pf/pfCurve3d.h>
static pfType* pfCurve3d::getClassType(void);
pfReal pfCurve3d::getBeginT()
pfReal pfCurve3d::getEndT()
pfVec3 pfCurve3d::getBeginPt();
pfVec3 pfCurve3d::getEndPt();
pfVec3 pfCurve3d::getBeginTan();
pfVec3 pfCurve3d::getEndTan();
void pfCurve3d::setClosed(int loopVal);
int pfCurve3d::getClosed();
void pfCurve3d::setClosedTol(pfReal tol);
pfReal pfCurve3d::getClosedTol();
virtual void pfCurve3d::evalPt(pfReal t, pfVec3& pnt) = 0;
virtual void pfCurve3d::evalTan(pfReal t, pfVec3& pnt);
virtual void pfCurve3d::evalNorm(pfReal t, pfVec3& pnt);
virtual void pfCurve3d::evalCurv(pfReal t, pfReal& curv);
void pfCurve3d::eval(pfReal t, pfVec3 &pnt, pfVec3 &tan,
pfReal &curv, pfVec3 &norm)
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfCurve3d is derived from the parent class
pfRep, so each of these member functions of class pfRep are also directly
usable with objects of class pfCurve3d. This is also true for ancestor
classes of class pfRep.
void pfRep::setOrigin(const pfVec3 *origin);
void pfRep::setOrient(const pfMatrix *mat);
void pfRep::getOrigin(pfVec3& origin);
void pfRep::getOrient(pfMatrix& matrix);
Page 1
pfCurve3d(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
Since the class pfRep is itself derived from the parent class pfGeode,
objects of class pfCurve3d 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 pfCurve3d 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 pfCurve3d 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 2
pfCurve3d(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 pfCurve3d 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
An pfCurve3d abstracts a general two dimensional parametric curve,
parameterized by t, where t has a domain of [endT..beginT]. Each curve
contains a parametric range and a pure virtual function, evalPt, to
evaluate the curve. The pfCurve3d class also contains virtual functions
for evaluating the tangent, curvature, and normal as a function of t. If
a derived class does not provide any one of these higher-order
evaluators, the pfCurve3d classes will approximate these values using
central differences. The central difference is taken about a small delta
in u, given by (endT - beginT) * pfRep::functionTol (see pfRep).
Curves can be open, closed or periodic. In an open curve, the end point
3-D values are not coincident. In a closed curve, the end points are
coincident in position. In a periodic curve, the endpoints are coincident
in position and in tangent, and the parameter t is assumed to wrap
toroidially. Coincidence is defined as the absolute value of the
difference of the two values, such that this quantity is less than that
of getClosedTol. The curve's end point disposition may be overriden via
the method-ref setClosed member function.
pfCurve3d::getClassType returns the pfType* for the class pfCurve3d. The
pfType* returned by pfCurve3d::getClassType is the same as the pfType*
returned by invoking the virtual function getType on any instance of
Page 3
pfCurve3d(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
class pfCurve3d. 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.
pfCurve3d::pfCurve3d() creates an instance of an pfCurve3d. By default
the parametric domain is defined as [0..1].
pfCurve3d::pfCurve3d(pfReal beginT,pfReal endT) creates an instance of a
pfCurve3d and sets the parametric domain to [beginT, endT].
pfCurve3d::setBeginT Sets the beginning parametric t value. This function
has the side effect of evaluating the curve at this value and caching the
result in the class's state.
pfCurve3d::setEndT Sets the ending parametric t value. This function has
the side effect of evaluating the curve at this value and caching the
result in the class's state.
pfCurve3d::getBeginT() Returns the beginning value of the parametric
domain.
pfCurve3d::getEndT() Returns the ending value of the parametric domain.
pfCurve3d::getBeginPt Returns the curve's 3-D value of the beginning
value of the parametric domain.
pfCurve3d::getEndPt Returns the curve's 3-D value of the ending value of
the parametric domain.
pfCurve3d::getBeginTan Returns the curve's 3-D tangent value of the
beginning value of the parametric domain.
pfCurve3d::getEndTan Returns the curve's 3-D tangent value of the ending
value of the parametric domain.
pfCurve3d::setClosed Overrides the default value of the curve's end point
disposition as described in the CLASS DESCRIPTION. Once, overriden the
curve's end point disposition is not automatically determined.
pfCurve3d::getClosed Returns the current value of the curve's end point
disposition.
pfCurve3d::setClosedTol Sets the tolerance used to determine when a curve
is closed. By default, this value is set by pfRep::subtractiveTol.
pfCurve3d::getClosedTol Returns the tolerance used to determine when a
curve is closed. By default this value is set pfRep::subtractiveTol.
pfCurve3d::evalPt Evaluates the curve at parametric value t, placing the
returned value in pnt. Note that this function is a pure virtual
Page 4
pfCurve3d(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
function and must be defined by at least one derived class.
pfCurve3d::evalTan Evaluates the curve's tangent at parametric value t,
placing the returned value in tan. If a derived class does not define a
tangent function, the one in this class is invoked. It will compute the
tangent using central differences (or the analytic tangent of a quadratic
fit) and is given by the equation:
tan = (f(t + dt) - f(t - dt)) / (2.0 * dt)
where f is the point-valued curve function.
pfCurve3d::evalNorm Evaluates the curve's principal normal at parametric
value t, placing the returned value in tan. If a derived class does not
define a normal function, the one in this class is invoked. It computes
the tangent using central differences (or the analytic normal of a
quadratic fit of the tangents) and is given by the equation:
tan = (f'(t + dt) - f'(t - dt)) / (2.0 * dt)
where f' is the vector valued tangent function.
pfCurve3d::evalCurv Evaluates the curve's curvature at parametric value
t, placing the returned value in curv. If a derived class does not define
a curvature function, the one in this class is invoked. It computes the
curvature by crossing the curves tangent and principal normal to produce
the binormal. The curvature is given by:
curv = || binormal || / (||tan|| * ||tan|| * ||tan||)
pfCurve3d::eval(pfReal t,pfVec3 &pnt,pfVec3 &tan,pfReal &curv,pfVec3
&norm) A convenience function that evaluates the position, tangent,
curvature and normal at the parameter t. These values are computed in
the manner described in the individual evaluation routines: evalPt,
evalTan, evalNorm, and evalCurv.
SEE ALSO
pfRep, pfGeode
Page 5