Interface to Alias blend curves.
#include <AlBlendCurve.h>
class AlBlendCurve : public AlObject
enum AlKnotSpacingType {
kChord,
kUniform
};
AlBlendCurve();
virtual ~AlBlendCurve();
virtual statusCode deleteObject();
virtual AlObject* copyWrapper() const;
statusCode create( int , AlKnotSpacingType , int , const double[][3] );
statusCode create( int , AlKnotSpacingType );
virtual AlObjectType type() const;
int degree();
statusCode setDegree( int );
statusCode knotSpacingType( AlKnotSpacingType& );
statusCode setKnotSpacingType( AlKnotSpacingType );
int numberOfPoints();
statusCode param( int, double& );
AlBlendPoint* getPoint( int );
statusCode points( int, double[] );
statusCode insert( int, double, double, double );
statusCode append( double, double, double );
boolean isPicked();
AlBlendCurve* next();
statusCode nextD( AlBlendCurve * );
AlBlendCurve* prev();
statusCode prevD( AlBlendCurve * );
AlCurveNode* curveNode();
An Alias Blend Curve is a normal NURBS curve with construction history. This class allows blend curves to be created and intersected with other curves, curves on surfaces, blend curves and surfaces. Note that intersection with clouds is not currently supported. Blend Curves contain Blend Points so it is necessary to use the AlBlendPoint class to make use of all of the Blend Curve functionality. To find the curve node which is the output of the Blend Curve command, use the curveNode() method.
Notes:
1. If a blend curve is active and the API is used to create another blend curve, the first blend curve will become inactive.
2. Blend curves can be made active or inactive by finding the curveNode() method and calling pick() on unpick() with the AlCurveNode.
statusCode AlBlendCurve::create( int degree, AlKnotSpacingType ks )
statusCode AlBlendCurve::create( int degree, AlKnotSpacingType ks, int numPoints, const double points[][3])
Create a blend curve based on a specified degree, knot spacing and points. More points can be added to the blend curve using the insertPoint() or appendPoint() methods. Note: a new point is initially not connected to any object, has a location interpolation direction, and has a parallel direction type.
statusCode AlBlendCurve::param( int index, double& param )
Returns the param or ’t’ value of the blend point at the index specified in the blend curve. The first blend point is at index = 0.
statusCode AlBlendCurve::points( int numPoints, double points[] )
Returns the world position of the points of a blend curve.
Example code:
int num = blendCurve->numberOfPoints(); double *points = (double *) malloc( sizeof(double) * num * 3 ); if ( points == NULL ) return; if ( blendCurve->points( num, points ) != sSuccess ) return; double *pt = points; for ( int i = 0 ; i < num ; i++ ) { pt[0] += x; pt[1] += y; pt[2] += z; pt += 3; }
Note: numPoints can be less than the actual number of points. The method will place as many points as possible into the array and then return successfully.
statusCode AlBlendCurve::insert( int index, double x, double y, double z )
Inserts a new blend point before the blend point at the index specified. Note: a new point is initially not connected to any object, has a location interpolation direction, and has a parallel direction type.
statusCode AlBlendCurve::append( double x, double y, double z)