Interface to curves on surfaces geometry.
#include <AlCurveOnSurface.h>
class AlCurveOnSurface : public AlObject
AlCurveOnSurface();
virtual ~AlCurveOnSurface();
virtual statusCode deleteObject();
virtual AlObject* copyWrapper() const;
virtual AlObjectType type() const;
statusCode create( int, curveFormType, int, const double[], int, const double[][4] );
statusCode create( int, const AlCurve*[] );
statusCode curveOnSurfaceData( double[], double[][4] ) const;
statusCode realCurveOnSurfaceData( double[], double[][4] ) const;
int degree() const;
curveFormType form() const;
int numberOfSpans() const;
int numberOfKnots() const;
int numberOfControlPoints() const;
int realNumberOfKnots() 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;
statusCode setVisible( boolean ) const;
AlSurface* surface() const;
statusCode worldSpace3DCopies( int&, AlCurve **& );
statusCode unaffected3DCopies( int&, AlCurve **& );
statusCode affected3DCopies( AlTM&, int&, AlCurve **& );
AlCurveOnSurface* nextCurveOnSurface() const;
AlCurveOnSurface* prevCurveOnSurface() const;
statusCode nextCurveOnSurfaceD();
statusCode prevCurveOnSurfaceD();
statusCode persistentID( AlPersistentID *&id, int ut = 1 );
statusCode hasPersistentID( int ut = 1 );
statusCode setPersistentID( AlPersistentID &, int );
statusCode insert( double );
statusCode reverse();
statusCode blindData( int, long &, const char *& );
statusCode setBlindData( int, long, const char * );
statusCode removeBlindData( int );
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.
statusCode AlCurveOnSurface::create(int deg,curveFormType form,int numKnots,const double knotVector[],int numControlPts,const double controlPoint[][4] )
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.
statusCode AlCurveOnSurface::create( int nb_curves, const AlCurve *curves[] )
Creates a Closed Curve On Surface from a loop of AlCurves. This loop will be re-parameterized, so that the loop will be continuous and the form will be set accordingly. If the resulting curve is not physically closed, it is forced closed with all of the start/end points equal.
statusCode AlCurveOnSurface::curveOnSurfaceData(double knotVector[],double controlPoint[][4] ) const
Assumes that the ’knotVector’ array is of length ’numberOfKnots()’ and the ’controlPoint’ array is of length ’are studying()’ 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.
statusCode AlCurveOnSurface::realCurveOnSurfaceData( double knotVector[], double controlPoint[][4] ) const
This method assumes that the ’knotVector’ array is of length ’realNumberOfKnots()’ 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.
curveFormType AlCurveOnSurface::form() const
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 package, 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.
statusCode AlCurveOnSurface::setKnotValue( int index, double knotValue )
Given a valid knot index, sets the value of the knot to be ’knotValue’. A valid knot index is one in the range ’0’ to ’numberOfKnots()-1’.
statusCode AlCurveOnSurface::controlPoint( int index, double point[4] ) const
Given a valid index, returns 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.
statusCode AlCurveOnSurface::setControlPoint( int index, const double point[4] )
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.
statusCode AlCurveOnSurface::worldSpace3DCopies( int& count, AlCurve **&ws_curves )
Returns a pointer via a reference parameter 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 is not inserted into the DAG hierarchy. 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).
statusCode AlCurveOnSurface::unaffected3DCopies( int& count, AlCurve **&ws_curves )
Returns a pointer via a reference parameter 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 is not inserted into the DAG hierarchy. 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).
statusCode AlCurveOnSurface::affected3DCopies( AlTM& tm, int& count, AlCurve **&ws_curves )
Returns a pointer via a reference parameter 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 is not inserted into the DAG hierarchy. tm is the transformation matrix generated while walking the DAG. 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).
statusCode AlCurveOnSurface::persistentID( AlPersistentID *&id, int userType )
Returns a copy of the AlPersistentID associated with this curve on surface. For user type 1, persistent IDs are created if they do not exist already. For all other user types, persistent IDs are not created if they do not exist already, and the method fails. User types between 0 and 9999 are reserved. If you would like to reserve a block of user types please contact us.
statusCode AlCurveOnSurface::setPersistentID( AlPersistentID &id, int userType )
Sets the values of the AlPersistentID associated with this curve on surface. This method only allows you to create persistent IDs with user types other than 1. If the persistent ID does not exist, it will be created.
User types between 0 and 9999 are reserved. If you would like to reserve a block of user types please contact us.
statusCode AlCurveOnSurface::setBlindData( int userType, long blindDataSize, const char *blindData )
statusCode AlCurveOnSurface::removeBlindData( int user_type )