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.
NULL constructor.
NULL destructor.
This method deletes a blend curve object and any points it has. In addition, the output AlCurve of the blend curve object is deleted.
sSuccess - the object was successfully deleted
sFailure - the method failed
sInvalidObject - the object was invalid
Returns an exact copy of the blend curve wrapper. NULL is returned if this method failed.
Create a blend curve based on a specified degree and knot spacing. Points are added to the blend curve using the insertPoint() or appendPoint() methods.
< degree - one of 1, 2, 3, 5, or 7
< ks - kChord or kUniform
sSuccess - a blend curve was created
sFailure - blend curve is currently valid, or other internal error occurred
sInvalidArgument - degree is not one of 1, 2, 3, 5, 7
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.
< degree - one of 1, 2, 3, 5, or 7
< ks - kChord or kUniform
< numPoints - number of points in the point[] array
< points[] - array of 3D points
sSuccess - a blend curve was created
sFailure - blend curve is currently valid, or other internal error occurred
sInvalidArgument - degree is not one of 1, 2, 3, 5, 7, or points are too close together (tolerance = 0.01).
Returns the class identifier kBlendCurveType.
Returns the degree of the blend curve. Note that -1 is returned if the blend curve is invalid or if an internal error occurs.
Sets the degree of the blend curve.
< degree - one of 1, 2, 3, 5, or 7
sSuccess - the method succeeded
sFailure - internal failure
sInvalidArgument - degree was not one of 1, 2, 3, 5 or 7
sInvalidObject - invalid blend curve
Returns the knot spacing setting of the blend curve.
> kst - knot spacing of the curve
sSuccess - the method succeeded
sFailure - internal failure
sInvalidObject - invalid blend curve
Sets the knot spacing of the blend curve.
< kst - kChord or kUniform
sSuccess - the method succeeded
sFailure - internal failure
sInvalidObject - invalid blend curve
Returns the number of points in a blend curve. If this method fails, -1 is returned. This method will fail if the blend curve is invalid.
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.
index - the index of the point on the blend curve to return the param for param - the blend point’s param value
sSuccess - the method succeeded
sFailure - internal failure,
sInvalidObject - the blend point is invalid
Returns the Nth point of the blend curve. NULL is returned if this method fails. This method will fail if index is less than 0 or greater than the number of points in the blend curve. The first blend curve point is at index = 0.
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.
< numPoints - size of the points array, must be a value greater than 0. For every n points, you need to allocate n * 3 elements
> points - array to return points in
sSuccess - the method succeeded
sFailure - internal failure
sInvalidObject - the blend curve is invalid
sInvalidArgument - numPoints < 1
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.
< index - position to insert the point before
< x,y,z - world space location of the new point
sSuccess - method succeeded
sFailure - internal failure
sInvalidObject - the blend curve is invalid
sInvalidArgument - index < 0 or falls after the last point
Appends a new blend point to the end of the blend curve. Note: a new point is initially not connected to any object, has a location interpolation direction, and has a parallel direction type.
x,y,z - the world space coordinates of the new blend point
sSuccess - the method succeeded
sFailure - internal failure
sInvalidObject - the blend curve is invalid
Returns the construction history curve that is the output of the blend curve.
Returns TRUE is the blend curve is currently picked. FALSE is returned if the blend curve is invalid or if an internal error occurs.
Returns the next blend curve in the Universe.
Destructive method for returning the next blend curve in the universe. sFailure is returned if there is no next blend curve in the universe.
< blendCurve - the blend curve to obtain the next blend curve from
sSuccess - the method worked sFailure - the method failed, could be due to there being no next blend curve sInvalidObject - this blend curve is invalid
Returns the previous blend curve in the Universe.
Destructive method for returning the previous blend curve in the universe. sFailure is returned if there is no previous blend curve in the universe.
< blendCurve - the blend curve to obtain the previous blend curve from
sSuccess - the method worked sFailure - the method failed, could be due to there being no previous blend curve sInvalidObject - this blend curve is invalid