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.
Constructs an AlCurveOnSurface wrapper object.
Deletes an AlCurveOnSurface wrapper object.
Deletes the curve on surface. If it is attached to a surface, it is removed from the surface before it is deleted.
sSuccess - the object was deleted
sInvalidObject - the curve was invalid
Makes an exact copy of the AlCurveOnSurface wrapper.
Returns the class identifier kCurveOnSurfaceType.
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.
See the description.
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
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.
nb_curves - number of curves
curves - array of curves
sInvalidArgument - an invalid or NULL argument was passed
sFailure - the AlCurveOnSurface could not be created
sSuccess - the AlCurveOnSurface was created
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.
> knotVector - contains the knots for this curve upon return
> controlPoint - contains the control points upon return
sSuccess - the knotVector & controlPoint data was returned
sInvalidArgument - knotVector or controlPoint was NULL
sInvalidObject - the AlCurveOnSurface was invalid
sFailure - an error occurred
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.
> knotVector - Contains the knots for this curve upon return.
> controlPoint - Contains the control points upon return.
sSuccess - the knotVector & controlPoint data was returned
sInvalidArgument - knotVector or controlPoint was NULL
sInvalidObject - the AlCurveOnSurface was invalid.
sFailure - an error occurred
Returns the degree of the curve. -1 is returned if the curve is not valid.
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.
Returns the number of spans in the curve. This method returns -1 if the curve is invalid.
Returns the number of knots (just numberOfSpans() + 1). This method returns -1 if the curve is invalid.
Returns the actual number of knots on the curve. That is number_of_spans + 2*degree - 1. A value of -1 will be returned if this method fails.
Given a valid knot index, returns the value of the knot in ’knotValue’. A valid knot index is one in the range ’0’ to ’numberOfKnots()-1’.
< index - a valid index of the knot value to return
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’.
< index - a valid index of the knot value to return
< knotValue - returns the knot value of the given index
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 already in a trim
Returns the number of control points.
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.
< index - a valid index of the control point to return
> point - returns the control point at position ’index’
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
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.
< index - a valid index of the control point to return
< point - the value to set the control point at position ’index’ to
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
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.
Returns TRUE if this curve on surface is being used to trim the surface it is on.
Returns TRUE if the curve is visible (FALSE means the curve is invisible).
Sets the visibility on the curve on surface.
sSuccess - The visibility is set as given.
sFailure - The geometry under the curve on surface is invalid.
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.
Destructively points the wrapper to the next curve on surface in the list of curves on surfaces that are attached to a specific surface.
sSuccess - the wrapper now points to the next CurveOnSurface
sInvalidObject - the curve was invalid
sFailure - there is no next CurveOnSurface
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.
Destructively points the wrapper to the previous curve on surface in the list of curves on surfaces that are attached to a specific surface.
sSuccess - the wrapper now points to the previous CurveOnSurface
sInvalidObject - the curve was invalid
sFailure - there is no previous CurveOnSurface
Reverse the direction of this curve on surface.
sInvalidObject - the curve on surface was invalid.
sFailure - the method didn’t succeed.
sSuccess - the direction of the curve on surface was successfully reversed.
Inserts an edit point into the curve.
< param - parametric value of the new edit point on the curve
sSuccess - normal completion
sInvalidArgument - param is out of bounds
sInvalidObject - the given object was not valid
sFailure - an error occurred
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).
> count - the number of curves returned in the curve array
> ws_curves - the array of curves
sSuccess - normal completion
sInvalidObject - the given object was not valid
sFailure - an error occurred
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).
> count - the number of curves returned in the curve array
> ws_curves - the array of curves
sSuccess - normal completion
sInvalidObject - the given object was not valid
sFailure - an error occurred
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).
> tm - transformation matrix generated by walking the DAG
> count - the number of curves returned in the curve array
> ws_curves - the array of curves
sSuccess - normal completion
sInvalidObject - the given object was not valid
sFailure - an error occurred
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.
> id - a copy of the AlPersistentID
< userType - user type of the persistent ID desired.
sSuccess - normal completion
sInvalidObject - the given object is not valid
sFailure - the ID did not exist or could not be created
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.
< userType - user type of the persistent ID desired
> id - a copy of the AlPersistentID
sSuccess - normal completion
sInvalidObject - the given object is not valid
sInvalidArgument - the given user type is not valid
sFailure - the ID did not exist or could not be created
Checks to see if the Curve On Surface has a persistent ID associated with it.
< userType - user type of the persistent ID desired
sSuccess - the node has a persistent ID
sFailure - the node does not have a persistent ID
sInvalidObject - the given object is not valid
Get the blind data packet of the specified type from an AlCurveOnSurface.
sInvalidObject - the surface was invalid.
sSuccess - blind data successfully retrieved.
sFailure - blind data not found.
Add the passed blind data packet to an AlCurveOnSurface.
sInvalidObject - the surface was invalid.
sSuccess - blind data successfully added.
sFailure - blind data not added
Removes the block of data of the given type from the object. Note that the user is still responsible for the memory associated with this block of data.
< user_type - user type of the blind desired.
sSuccess - everything is okay
sFailure - no such blind data existed
sInvalidObject - the given object is not valid