AlCurveOnSurface
Interface to curves on surfaces geometry.
Synopsis
#include <AlCurveOnSurface.h>
class AlCurveOnSurface : public AlObject
AlCurveOnSurface();
virtual ~AlCurveOnSurface();
virtual statusCode deleteObject();
virtual AlObject* copyWrapper() const;
virtual AlObjectType type() const;
virtual AlCurveOnSurface* asCurveOnSurfacePtr();
virtual AlPickable* asPickablePtr();
statusCode create( int, curveFormType, int, const double[], int, const
double[][4] );
statusCode curveOnSurfaceData( double[], double[][4] ) const;
int degree() const;
curveFormType form() const;
int numberOfSpans() const;
int numberOfKnots() const;
int numberOfControlPoints() const;
double knotValue( int ) const;
statusCode controlPoint( int, double[4] ) const;
statusCode setKnotValue( int, double );
statusCode setControlPoint( int, const double[4] );
boolean inTrim() const;
boolean visible() const;
AlSurface* surface() const;
statusCode worldSpaceCopys( int& count, AlCurve **&ws_curves );
AlCurveOnSurface* nextCurveOnSurface() const;
AlCurveOnSurface* prevCurveOnSurface() const;
statusCode nextCurveOnSurfaceD();
statusCode prevCurveOnSurfaceD();
// obsolete
statusCode setCurveOnSurfaceData( int, curveFormType, int, const
double[], int, const double[][4] );
statusCode getCurveOnSurfaceData( double[],double[][4] ) const;
statusCode getKnotValue( int, double& ) const;
statusCode getControlPoint( int, double[4] ) const;
statusCode insert( double );
Description
AlCurveOnSurface is the interface to Alias' curve on surface data objects. Curves on surfaces are created and added to a surface by allocating an AlCurveOnSurface, then calling the create() method, and then calling AlSurfaceNode's addCurveOnSurface() method to add it to a surface.
Curves on surfaces can also be read in from wire file and modified with this class. Curves on surfaces will be deleted when the surface they are attached to is deleted.
When constructing a curve on surface, you will notice that you need to specify a matrix that has dimensions [numberOfControlPoints][4]. Each point has 4 values, for u, v, zero and w. The "u" and "v" specify the point in U-V parametric space. The third component is zero because this component is not used. The "w" component is the homogeneous value, which is usually 1.0.
See the example programs for an example.
Summary
AlCurveOnSurface::AlCurveOnSurface()
Description
Constructs an AlCurveOnSurface wrapper object.
AlCurveOnSurface::~AlCurveOnSurface()
Description
Deletes an AlCurveOnSurface wrapper object.
statusCode AlCurveOnSurface::deleteObject()
Description
Deletes the curve on surface. If it is attached to a surface, it is removed from the surface before it is deleted.
Return codes
sSuccess - the object was deleted
sInvalidObject - the curve was invalid
AlObject *AlCurveOnSurface::copyWrapper() const
Description
This method makes an exact copy of the AlCurveOnSurface wrapper.
AlObjectType AlCurveOnSurface::type() const
Description
Returns the class identifier kCurveOnSurfaceType.
AlCurveOnSurface* AlCurveOnSurface::asCurveOnSurfacePtr()
Description
This virtual function returns a non-null pointer to itself, indicating that it is safe to cast to an object of this class.
AlPickable* AlCurveOnSurface::asPickablePtr()
Description
This virtual function returns a non-null pointer to itself, indicating that it is safe to cast to an object of this class.
statusCode AlCurveOnSurface::setCurveOnSurfaceData(int deg,curveFormType form,int numKnots,const double knotVector[],int numControlPts,const double controlPoint[][4] )
Description
obsolete
statusCode AlCurveOnSurface::create(int deg,curveFormType form,int numKnots,const double knotVector[],int numControlPts,const double controlPoint[][4] )
Description
Refer to the AlCurve::create() method for information on the meaning and usage of the parameters.
There is one additional constraint placed on this method over and above the AlCurve::create() method. The third component of each control point must be zero, since a curve on surface is expressed only in two dimensions (which is U-V parameter space) plus a homogeneous coordinate (usually 1.0 ). U and V typically range from 0 to 1.
For any control point [u v 0.0 w], "u" and "v" represent the coordinate in U-V parameter space, and "w" represents the homogeneous coordinate.
Arguments
See the description.
Return codes
sSuccess - the curve on Surface was created
sInvalidArgument - an invalid or NULL argument was passed
sInsufficientMemory - there was not enough memory to create it
sFailure - the curve could not created
statusCode AlCurveOnSurface::getCurveOnSurfaceData(double knotVector[],double controlPoint[][4] ) const
Description
obsolete ... use curveOnSurfaceData
statusCode AlCurveOnSurface::curveOnSurfaceData(double knotVector[],double controlPoint[][4] ) const
Description
This method assumes that the 'knotVector' array is of length 'numberOfKnots()' and the 'controlPoint' array is of length 'numberOfControlPoints()' and returns the values of the knots and control points in these arrays.
Note that in the array of control points, each control point is represented by the quadruple [u v 0.0 w], where "u" and "v" represent the control point in U-V parameter space, the "0.0" doesn't represent anything, and the "w" is the homogeneous coordinate.
Arguments
> knotVector - Contains the knots for this curve upon return.
> controlPoint - Contains the control points upon return.
Return codes
sSuccess - the knotVector & controlPoint data was returned
sInvalidArgument - knotVector or controlPoint was NULL
sInvalidObject - the AlCurveOnSurface was invalid.
sFailure - an error occurred
int AlCurveOnSurface::degree() const
Description
Returns the degree of the curve. -1 is returned if the curve is not valid.
curveFormType AlCurveOnSurface::form() const
Description
Returns the form of the curve, which is kOpen, kClosed or kPeriodic. If a curve on surface is periodic, it is tangent continuous at the point where it is closed. (If you use the "close" menu item in the interactive Alias pacakge, you actually make a curve periodic.) If a curve is periodic, it implies that it is closed. If a curve is kClosed, then it just means that its endpoints are coincident. Otherwise, the curve is kOpen.
int AlCurveOnSurface::numberOfSpans() const
Description
Returns the number of spans in the curve. This method returns -1 if the curve is invalid.
int AlCurveOnSurface::numberOfKnots() const
Description
Returns the number of knots (just numberOfSpans() + 1). This method returns -1 if the curve is invalid.
statusCode AlCurveOnSurface::getKnotValue( int index, double& knotVal ) const
Description
obsolete, use AlCurveOnSurface::knotValue instead
double AlCurveOnSurface::knotValue( int index ) const
Description
Given a valid knot index, return the value of the knot in 'knotValue'. A valid knot index is one in the range '0' to 'numberOfKnots()-1'.
Arguments
< index - A valid index of the knot value to return.
statusCode AlCurveOnSurface::setKnotValue( int index, double knotValue )
Description
Given a valid knot index, set the value of the knot to be 'knotValue'. A valid knot index is one in the range '0' to 'numberOfKnots()-1'.
Arguments
< index - A valid index of the knot value to return.
< knotValue - Returns the knot value of the given index.
Return codes
sSuccess - the knot value was set sInvalidArgument - the 'index' was not in the range 0..#knots-1 sInvalidObject - the curve was invalid sFailure - the curve was alread in a trim
int AlCurveOnSurface::numberOfControlPoints() const
Description
Returns the number of control points.
statusCode AlCurveOnSurface::getControlPoint( int index, double point[4] ) const
Description
obsolete, use AlCurveOnSurface::controlPoint instead.
statusCode AlCurveOnSurface::controlPoint( int index, double point[4] ) const
Description
Given a valid index, return the value of the control point in 'point'. A valid index is one in the range '0' to 'numberOfControlPoints()-1'.
Note the control point is represented by the quadruple [u v 0.0 w], where "u" and "v" represent the control point in U-V parameter space, the "0.0" is unused, and the "w" is the homogeneous coordinate.
Arguments
< index - A valid index of the control point to return.
> point - Returns the control point at position 'index'.
Return codes
sSuccess - the control point was returned
sInvalidArgument - the index was not valid or 'point' was NULL
sInvalidObject - the curve was invalid
sFailure - an error occurred
statusCode AlCurveOnSurface::setControlPoint( int index, const double point[4] )
Description
Given a valid index, sets the value of the control point to 'point'. A valid index is one in the range '0' to 'numberOfControlPoints()-1'.
Note the control point is represented by a quadruple, [u v 0.0 w] where "u" and "v" represent the control point in U-V parameter space, the "0.0" doesn't represent anything, and the "w" is the homogeneous coordinate.
Arguments
< index - A valid index of the control point to return.
< point - The value to set the control point at position 'index' to.
Return codes
sSuccess - the control point was set
sInvalidArgument - the index was not valid or 'point' was NULL
sInvalidObject - the curve was invalid
sFailure - an error occurred
AlSurface* AlCurveOnSurface::surface() const
Description
Returns a pointer to the surface that this curve is on. Otherwise, returns NULL. The surface that this curve-on-surface belongs to MUST have a surface node attached to it.
statusCode AlCurveOnSurface::worldSpaceCopys( int& count, AlCurve **&ws_curves )
Description
Returns a pointer to a temporary curve that represents a world space copy of the curve on surface. The returned curve should be deleted after use. It does not have a parent node and so has not inserted into the DAG hierarchy. Otherwise, returns NULL. This method creates cubic world space versions of a curve on surface. As there may be more than one spline returned, a loop of splines is returned (and should be deleted later).
boolean AlCurveOnSurface::inTrim() const
Description
Returns TRUE if this curve on surface is being used to trim the surface it is on.
boolean AlCurveOnSurface::visible() const
Description
Returns TRUE if the curve is visible (FALSE means the curve is invisible).
AlCurveOnSurface* AlCurveOnSurface::nextCurveOnSurface() const
Description
Returns the next curve on surface in the list of curve on surfaces that are attached to a specific surface. Returns NULL if there is no next curve on surface.
statusCode AlCurveOnSurface::nextCurveOnSurfaceD()
Description
Destructively points the wrapper to the next curve on surface in the list of curves on surfaces that are attached to a specific surface.
Return codes
sSuccess - the wrapper now points to the next CurveOnSurface
sInvalidObject - the curve was invalid
sFailure - there is no next CurveOnSurface
AlCurveOnSurface* AlCurveOnSurface::prevCurveOnSurface() const
Description
Returns the previous curve on surface in the list of curves on surfaces that are attached to a specific surface. Returns NULL if there is no previous curve on surface.
statusCode AlCurveOnSurface::prevCurveOnSurfaceD()
Description
Destructively points the wrapper to the previous curve on surface in the list of curves on surfaces that are attached to a specific surface.
Return codes
sSuccess - the wrapper now points to the previous CurveOnSurface
sInvalidObject - the curve was invalid
sFailure - there is no previous CurveOnSurface
statusCode AlCurveOnSurface::insert( double param )
Description
Inserts an edit point into the curve.
Arguments
< param - parametric value of the new edit point on the curve
Return codes
sSuccess - normal completion
sInvalidArgument - param is out of bounds
sInvalidObject - the given object was not valid
sFailure - an error occurred
aliasdocs@aw.sgi.com
Copyright © 1996, Alias|Wavefront, a Silicon Graphics Company. All rights
reserved.