pfSweptSurface(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
NAMEpfSweptSurface - A parametric swept surface
FUNCTION SPECIFICATION
#include <Performer/pf/pfSweptSurface.h>
static pfType * pfSweptSurface::getClassType(void);
pfSweptSurface::pfSweptSurface();
void -
pfSweptSurface::setCrossSection(pfCurve3d *crossSection);
void pfSweptSurface::setPath(pfCurve3d *path);
void pfSweptSurface::setT(pfCurve3d *tng);
void pfSweptSurface::setB(pfCurve3d *b);
void pfSweptSurface::setProf(pfScalar *profile);
pfCurve3d* pfSweptSurface::getCrossSection() const;
pfCurve3d* pfSweptSurface::getPath() const;
pfCurve3d* pfSweptSurface::getT() const;
pfCurve3d* pfSweptSurface::getB() const;
pfScalar* pfSweptSurface::getProf() const;
void pfSweptSurface::evalPt(pfReal u, pfReal v,
pfVec3& pnt);
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfSweptSurface is derived from the parent
class pfParaSurface, so each of these member functions of class
pfParaSurface are also directly usable with objects of class
pfSweptSurface. This is also true for ancestor classes of class
pfParaSurface.
void pfParaSurface::setBeginU(pfReal u);
void pfParaSurface::setEndU(pfReal u);
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);
Page 1
pfSweptSurface(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
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 pfSweptSurface 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);
Since the class pfGeode is itself derived from the parent class pfGeode,
objects of class pfSweptSurface can also be used with these functions
designed for objects of class pfGeode.
int pfGeode::addGSet(pfGeoSet* gset);
int pfGeode::removeGSet(pfGeoSet* gset);
Page 2
pfSweptSurface(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
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 pfSweptSurface 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 pfSweptSurface 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);
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 pfSweptSurface can also be used with these
functions designed for objects of class pfMemory.
Page 3
pfSweptSurface(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
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 swept surface is a parametric surface defined taking a cross-sectional
3-dimensional curve, pfCurve3d, and sweeping it along a path, another
pfCurve3d. The cross section is scaled by a scalar function, called the
profile.
The surface is defined as:
s(u,v) = path(u) + frame(t(u),b(u)) * profile(u) * crossSection(v)
where
path(u) is a point-valued function in (x,y,z)
frame(v1,v2) is a 3x3 matrix valued function.
The "u" parameter maps to the longitudinal or the sweeping direction. The
"v" parameter maps to the cross sectional direction. Both are given in
units relative to the parametric space of the defining curves. To obtain
an arbitrarily-oriented swept surface, either set the orientation matrix
by using the appropriate superclass, pfRep, member function, or reorient
the defining curves either explicitly or through their respective pfRep
orientation matrix.
It takes two vectors v1 != v2 and generates a changes of basis
transformation. This transformation takes the z-axis and aligns it with
v1 and takes the x-axis and aligns it with a projection of the v2 vector
on the plane normal to v1. V1 will most often be the tangent vector to
path(u) and v2 a binormal vector to path(u).
t(u) is a vector-valued function, like the tangent vector
b(u) is a vector-valued function, like the binormal
(The binormal, the tangent vector and their cross product are known as
the Frenet-Serret frame.)
Page 4
pfSweptSurface(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
profile(u) is a scalar-valued function
crossSection(v) is a point-valued function in (x,y,0)
Here u runs along the spine or path, and v runs "around" the path. The
crossSection is a function in the x,y plane which outlines the shape.
Profile is a scalar function along the path which scales the cross
section as it is swept along the path. So a cone would be a circle swept
along a linear path with a profile that also varied linearly along the
path.
For a more explicit example here a definition of a torus lying in the x,y
plane would be:
path(u) = ( cos(u)*radius_1, sin(u)*radius_1, 0 ) t(u) = (-
sin(u)*radius_1, cos(u)*radius_1, 0 ) b(u) = (-cos(u)*radius_1,-
sin(u)*radius_1, 0 ) profile(u) = radius_2 crossSection(v) = (cos(v),
sin(v), 0)
Note that the twist and alignment of the profile curve is a function of
of two vector-valued functions along the path. Usually these will be the
normal and binormal of the Frenet-Serret frame, see pfFrenetSweptSurface,
but need not be. This generalization is necessary because for certain
paths the Frenet-Serret frame can do unpredictable things, due to
singularities in the first and second derivatives. Thus the API allows
for the specification of arbitrary vector-valued functions. These
vector-valued functions can, for instance, define a parallel transport
function which keeps things from twisting and can be defined
incrementally by starting with two vectors and updating them as you move
in u. This incremental update is made by minimizing the relative twist
from one frame to the next.
The family of surfaces definable as swept surfaces is fairly large and
include: all ruled surfaces, cones, spheres, planes, cylinders, genus-1
(single hole) torii, ribbons and mobius strips, fillets, chamfers, water
shaped drops.
pfSweptSurface::getClassType returns the pfType* for the class
pfSweptSurface. The pfType* returned by pfSweptSurface::getClassType is
the same as the pfType* returned by invoking the virtual function getType
on any instance of class pfSweptSurface. 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.
pfSweptSurface::pfSweptSurface creates an instance of pfSweptSurface.
Most of it's members, such as crossSection, are set to NULL.
pfSweptSurface::pfSweptSurface(pfCurve3d *crossSection,pfCurve3d
*path,pfCurve3d *t,pfCurve3d *b,pfScalar *profile) creates an instance of
a pfSweptSurface creates a swept surface with the given path, cross
section, and profile. The arguments t and b are vector-valued functions
Page 5
pfSweptSurface(3pf) OpenGL Performer 3.2.2 libpf C++ Reference Pages
of the path's parameter. They define the orientation of the profile at
each point on the path.
The orientation at a particular point on the curve is determined by
rendering the graph of crossSection in the coordinate plane perpendicular
to t, which locally defines the z axis of an x-y-z coordinate system. The
x axis is defined by the projection b onto the plane, and the y axis
forms a right-hand coordinate system with the other two axes. The cross
section is plotted in the x-y plane.
If you specify a NULL value for profile, crossSection does not vary along
path.
pfSweptSurface::setCrossSection sets the crossSection field.
pfSweptSurface::getCrossSection returns the crossSection field.
pfSweptSurface::setPath sets the path field.
pfSweptSurface::getPath returns the path field.
pfSweptSurface::setT sets the t field.
pfSweptSurface::getT returns the t field.
pfSweptSurface::setB sets the b field.
pfSweptSurface::getB returns the b field.
pfSweptSurface::setProf sets the profile field.
pfSweptSurface::getProf returns the profile field.
pfSweptSurface::evalPt calculates the point on the surface, pnt, as the
vector sum of (a) the point on the path corresponding to the value u and
(b) the point on the cross section corresponding to the value v. The
vector location the point on the cross section is scaled by the value at
u of the profile function, if profile is not NULL.
SEE ALSO
pfRep, pfGeode, pfParaSurface, pfCurve3d, pfScalar
Page 6