#include <AlCurveCV.h>
class AlCurveCV : public AlObject , public AlClusterable , public AlAnimatable , public
AlSettable , public AlPickable
virtual AlAnimatable* asAnimatablePtr();
virtual AlSettable* asSettablePtr();
virtual AlClusterable* asClusterablePtr();
virtual AlPickable* asPickablePtr();
virtual ~AlCurveCV();
virtual AlObject* copyWrapper() const;
AlObjectType type() const;
AlCurveCV* asCurveCVPtr();
AlCurveCV* next() const;
AlCurveCV* prev() const;
statusCode nextD();
statusCode prevD();
int multiplicity() const;
statusCode worldPosition( double&, double&, double&, double& ) const;
statusCode affectedPosition( const AlTM&, double&, double&, double&,
double& ) const;
statusCode unaffectedPosition( double&, double&, double&, double& )
const;
statusCode setMultiplicity( int );
statusCode setWorldPosition( double, double, double, boolean );
statusCode setWorldPosition( double, double, double, AlTM );
statusCode setUnaffectedPosition( double, double, double, double );
AlCurve* curve() const;
statusCode blindData( int, long&, const char *& );
statusCode setBlindData( int, long, const char * );
statusCode removeBlindData( int );
statusCode doUpdates( boolean newState = TRUE );
There are methods to query and set the multiplicity of a CV, and methods to query the world position and the "unaffected" position of a CV. The "unaffected" position of a CV is its position BEFORE any transformations (from its parent dag node or from affecting clusters) have been applied to it. There is also a method to access the clusters that affect a CV. Methods setWorldPosition(*) are used for setting either the unaffected or affected(clusters) position of a CV.
To print out all CVs of a curve:
AlCurve curve;
AlCurveCV *cvPtr;
int i = 0;
double x, y, z, w;
if ( cvPtr = curve->firstCV() )
{
do {
cvPtr->worldPosition( x, y, z, w );
printf("CV %d is at %G, %G, %G with weight %G.\n", i, x, y, z, w );
i++;
} while( cvPtr->nextD() == sSuccess );
}
delete cvPtr;
Example Result:
CV 1 is at 0.0, 1.0, 0.0 with weight 1.0
CV 2 is at 0.0, 2.0, 0.0 with weight 1.0
CV 3 is at 0.0, 3.0, 0.0 with weight 1.0
CV 4 is at 0.0, 4.0, 0.0 with weight 1.0
For example, to print all internal CVs of a curve with 4 AlCurveCV's where the second AlCurveCV has multiplicity = 2, you would do this:
AlCurve curve;
AlCurveCV *cvPtr;
int i,j = 0;
double x, y, z, w;
if ( cvPtr = curve->firstCV() )
{
do {
for( j = 0; j <= cvPtr->multiplicity(); j++, i++ )
{
cvPtr->worldPosition( x, y, z, w );
printf("CV %d is at %G, %G, %G with weight %G.\n", i, x, y, z, w );
}
i++;
} while( cvPtr->nextD() == sSuccess );
}
delete cvPtr;
Example Result:
CV 1 is at 0.0, 1.0, 0.0 with weight 1.0
CV 2 is at 0.0, 2.0, 0.0 with weight 1.0
CV 3 is at 0.0, 2.0, 0.0 with weight 1.0
CV 4 is at 0.0, 3.0, 0.0 with weight 1.0
CV 5 is at 0.0, 4.0, 0.0 with weight 1.0
Routines that require the CV to be in the dag:
next
nextD
worldPosition
setMultiplicity
setUnaffectedPosition
setWorldPosition
Summary
AlAnimatable *AlCurveCV::asAnimatablePtr()
sFailure - there is no next CV in the curve








* 







::


() 




sInvalidObject - the curve CV was invalid
sFailure - there is no previous CV in the curve
Note that the positions returned are [ x y z w ] and not [ w*x w*y w*z w ].
> double &y - the world position in the y direction
> double &z - the world position in the z direction
> double &weight - homogeneous coordinate
sInvalidObject - the CV was invalid
sFailure - the CV is not created or not in the world.
Note that the positions returned are [ x y z w ] and not [ w*x w*y w*z w ].
> double &x - the world position in the x direction
> double &y - the world position in the y direction
> double &z - the world position in the z direction
> double &weight - homogeneous coordinate
sInvalidObject - the CV is not created or not in the world.
How are the unaffected position and world position related? The world position is the unaffected position with the inclusive transformation of all dag nodes above this curve applied to it AND the transformations of all affecting clusters applied to it (in appropriate proportions).
> double &y - the unaffected position in the y direction
> double &z - the unaffected position in the z direction
> double &weight - homogeneous coordinate
sInvalidObject - the CV was invalid
sFailure - the CV is not created or not in the world.
sInvalidArgument - the multiplicity was not 1, 2 or 3
sInvalidObject - the CV was invalid
sFailure - the CV is not created or not in the world.
statusCode AlCurveCV::setWorldPosition( double x, double y, double z, boolean includeWorld )
Description
Set the world position of the CV. The CV may also be in a cluster. Arguments
< double x - the new unaffected position in the x direction Return codes
sSuccess - the position of this curve CV was set statusCode AlCurveCV::setWorldPosition( double x, double y, double z, AlTM tm )
Description
Set the world position of the CV. The CV may also be in a cluster. Note that this method uses the inverse of the transformation matrix that is passed in so that the calling routine does not need to generate it. Arguments
< double x - the new unaffected position in the x direction Return codes
sSuccess - the position of this curve CV was set statusCode AlCurveCV::setUnaffectedPosition( double x, double y,double z, double weight )
Description
Sets the unaffected position of a curve CV. Arguments
< double x - the new unaffected position in the x direction Return codes
sSuccess - the position of this curve CV was set AlCurve* AlCurveCV::curve() const
Description
Returns a pointer to the AlCurve that this curve CV belongs to. statusCode AlCurveCV::blindData( int user_type, long& size, const char *& data )
Description
Obtains the size and address of a block of data associated with the object. If there is no data, then the size will be zero and the address of the data is NULL. User_types between 0 and 11999 are reserved. If you would like to reserve a block of "user_types" please contact us. Arguments
< type - user type of the data desired. Return codes
sSuccess - the blind data was returned sInvalidObject - the curveCV was invalid Description
Associates a block of data with the object. If a block of data is already associated with this object and this user_type, the old block is replaced by a reference to the new block. The old block of data is not deleted. Arguments
< user_type - user type of the blind data desired. Return codes
sSuccess - everything is okay. statusCode AlCurveCV::removeBlindData( int user_type )
Description
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. Arguments
< user_type - user type of the blind desired. Return codes
sSuccess - everthing is okay