pfDisCurve3d(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
NAME
pfGetDisCurve3dClassType, pfNewDisCurve3d, pfDisCurve3dSetClosed,
pfGetDisCurve3dClosed, pfDisCurve3dSet, pfDisCurve3dPoint,
pfGetDisCurve3dPointCount, pfGetDisCurve3dCurvature - Base class for all
discrete 3D parametric curves.
FUNCTION SPECIFICATION
#include <Performer/pf.h>
pfType * pfGetDisCurve3dClassType(void);
pfDisCurve3d * pfNewDisCurve3d(void *arena);
void pfDisCurve3dSetClosed(pfDisCurve3d *curve, int loopVal);
int pfGetDisCurve3dClosed(pfDisCurve3d *curve);
void pfDisCurve3dSet(pfDisCurve3d* curve, int nPoints,
pfReal *points);
void pfDisCurve3dPoint(pfDisCurve3d* curve, int i,
const pfVec3 &pnt);
int pfGetDisCurve3dPointCount(pfDisCurve3d* curve);
pfReal pfGetDisCurve3dCurvature(const pfDisCurve3d* curve,
int i);
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfDisCurve3d is derived from the parent class
pfRep, so each of these member functions of class pfRep are also directly
usable with objects of class pfDisCurve3d. Casting an object of class
pfDisCurve3d to an object of class pfRep is taken care of automatically.
This is also true for casts to objects of ancestor classes of class
pfRep.
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 pfRep is itself derived from the parent class pfGeode,
objects of class pfDisCurve3d 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);
Page 1
pfDisCurve3d(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
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 pfDisCurve3d 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);
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 pfDisCurve3d 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);
Page 2
pfDisCurve3d(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
Since the class pfObject is itself derived from the parent class
pfMemory, objects of class pfDisCurve3d 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 discrete 3D curve is an array of 3D points. The tangent at each point
is defined as the first order derivative of the curve with respect to arc
length, and is approximated by a finite central difference (forward or
backward difference is used for the first and the last point):
0.5 * ((p[i+1]-p[i])/||p[i+1]-p[i]|| + (p[i]-p[i-1])/||p[i]-p[i-1]|| )
where ||p[i]-p[i-1]|| is the Euclidean distance. Notice that the tangent
is not normalized.
The principal normal at each point is defined as the second order
derivative of the curve with respect to the arc length, and is also
approximated by finite central difference over tangents. Notice that the
normals are not normalized.
The curvature at each point is defined as the length of the principal
normal.
Each discrete 3D curve keeps a flag that indicates whether the curve is
closed or not. If the curve is closed, then it is thought of as having a
line that connects the last point to the first point. This affects the
derivative (tangent, normal, etc) computations at the first and last
point.
pfGetDisCurve3dClassType returns the pfType* for the class pfDisCurve3d.
The pfType* returned by pfGetDisCurve3dClassType is the same as the
pfType* returned by invoking pfGetType on any instance of class
pfDisCurve3d. 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
Page 3
pfDisCurve3d(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
derived from a Performer type rather than to test for strict equality of
the pfType*'s.
pfNewDisCurve3d creates an instance of an pfDisCurve3d. By default the
parametric domain is defined as [0..1].
pfDisCurve3dSetClosed sets the flag that indicates whether this curve is
closed or not.
pfGetDisCurve3dClosed returns a flag indicating whether this curve is
closed or not.
pfDisCurve3dSet the coordinates of the points points. The coordinates of
the point i should be stored in points[3*i], points[3*i+1] and
points[3*i+2].
pfGetDisCurve3dPointCount returns the number of points.
pfDisCurve3dPoint sets the i'th point.
pfGetDisCurve3dPoint returns the i'th point
pfGetDisCurve3dCurvature returns the ith curvature.
SEE ALSO
pfRep, pfGeode
Page 4