AlCurveNode
 
 
 

A DAG node that refers to a NURB curve’s geometry.

Synopsis

#include <AlCurveNode.h>
class AlCurveNode : public AlDagNode
AlCurveNode();
virtual	~AlCurveNode();
virtual AlObject*	copyWrapper() const;
statusCode	create( AlCurve* );
virtual AlObjectType	type() const;
AlCurve*	curve() const;
AlCurve*	curve(AlTM&) const;
AlCurveNodeJoinErrors	join(AlCurveNode*);
int	curvePrecision() const;
statusCode	setCurvePrecision( int );

Description

AlCurveNode is the class used to access and manipulate curves within a DAG. This class behaves like other DAG nodes (see AlDagNode for a description of the usage and purpose of DAG nodes). Users access the geometry of the curve via the ’curve()’ method which returns a pointer to an AlCurve object which provides the user with the methods used to modify the geometry of the curve. Curves can be created from scratch by instantiating and creating an AlCurve, and then by instantiating and creating an AlCurveNode (using the AlCurve as a parameter).

There are two ways to delete an AlCurveNode. If the AlCurveNode deleteObject() method is called, then the node’s AlCurve is also deleted. If the AlCurve::deleteObject() method is called, then its associated AlCurveNode is also deleted.

AlCurveNode::AlCurveNode()

Description

Constructs an AlCurveNode wrapper object.

AlCurveNode::~AlCurveNode()

Description

Deletes an AlCurveNode wrapper object.

AlObject* AlCurveNode::copyWrapper() const

Description

Returns an exact duplicate of this AlCurveNode wrapper.

statusCode AlCurveNode::create( AlCurve *newCurve )

Description

Allocates the DAG node for this object and attaches it to the given AlCurve. This method should only be called once for any AlCurve. It is an error to call this method twice or if the object has been read in from a wire file.

Arguments

< newCurve - the curve to create this curve node from

Return Codes

sSuccess - everything was successful

sInvalidArgument - the ’newCurve’ was invalid or NULL

sAlreadyCreated - the curve was already created elsewhere

sInsufficientMemory - not enough memory available

AlObjectType AlCurveNode::type() const

Description

Returns the class identifier kCurveNodeType.

AlCurveNode* AlCurveNode::asCurveNodePtr()

Description

This virtual function returns a non-null pointer to itself, indicating that it is safe to cast to an object of this class.

AlCurve* AlCurveNode::curve() const

Description

Returns a pointer to the curve data structure that can be used to access the geometry of the curve.

AlCurve* AlCurveNode::curve(AlTM& tm) const

Description

Returns a pointer to the curve data structure that can be used to access the geometry of the curve. The AlTM will be updated with the curveNode’s TM if a curve exists.

Arguments

> tm - the transformation matrix to be updated with the curveNode’s TM

AlCurveNodeJoinErrors AlCurveNode::join(AlCurveNode* curveNode)

Description

Joins the passed-in curveNode’s curve to the end of this curve if the end is coincident with the beginning of the of the curveNode’s curve. This is most useful when using curves with attributes.

Warning

This operation will remove this curve’s CVs from all clusters and sets but not the curveNode that is passed in. This means that all AlClusterMembers’ and AlSetMembers’ of this curves CVs will no longer be valid after a join. Further all AlCurveCVs and attributes on ’this’ AlCurve will have been deleted and regenerated (the passed curve is unchanged). If the return value is either kJoinSuccess or kJoinFailure so all pointers to this curve’s AlCurveCVs will be invalid.

If the return value is one of kJoinDuplicateCurve, kJoinBadData, kJoinNoAttributes, or kJoinInvalidKeyPoints, the model will not have been modified.

If the return value is kJoinBadCluster, all AlCurveCVs below this AlCurveNode will have been removed from all sets and clusters and the cluster effects may have been applied to some CVs.

Finally, if the return code is kJoinFailure, all AlCurveCVs below this AlCurveNode will have been removed from all sets and clusters, all AlCurveCVs have been deleted and recreated, existing AlAttributes have been moved to the garbage list and new ones created, and a join was attempted but failed, perhaps because the ends of the two curves did not overlap.

Arguments

< curveNode - a curve that will be added to the end of this curve

Return Values

kJoinSuccess - the join succeeded

kJoinFailure - the join failed, perhaps because the end points didn’t overlap

kJoinBadCluster - failed to remove effect of all clusters

kJoinInvalidKeyPoints - one curve may have been a circle

kJoinNoAttributes - attributes for a curve could not be found or created

kJoinBadData - the model is in an incorrect state

kJoinDuplicateCurve - an attempt was made to join a curve to itself

int AlCurveNode::curvePrecision() const

Description

Obtains the curve precision for the curve. This method returns -1 if the curve node is invalid.

statusCode AlCurveNode::setCurvePrecision( int precision )

Description

Sets the curve precision for the curve.

Arguments

< precision - the new curve precision (range is 1-129).

Return code

sSuccess - curve precision set

sInvalidArgument - value for curve precision was invalid

sInvalidObject - this CurveNode is invalid.