Encapsulates methods common to surface CVs.
#include <AlSurfaceCV.h>
class AlSurfaceCV : public AlObject , public AlClusterable , public AlAnimatable , public AlSettable , public AlPickable
virtual ~AlSurfaceCV();
virtual AlObject* copyWrapper() const;
AlObjectType type() const;
int uIndex() const;
int vIndex() const;
AlSurfaceCV* nextInU() const;
AlSurfaceCV* nextInV() const;
AlSurfaceCV* prevInU() const;
AlSurfaceCV* prevInV() const;
statusCode nextInUD();
statusCode nextInVD();
statusCode prevInUD();
statusCode prevInVD();
int multiplicityInU() const;
int multiplicityInV() 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, int );
statusCode setWorldPosition( double, double, double, boolean );
statusCode setWorldPosition( double, double, double, AlTM );
statusCode setUnaffectedPosition( double, double, double, double );
AlSurface* surface() const;
statusCode blindData( int, long&, const char *& );
statusCode setBlindData( int, long, const char * );
statusCode removeBlindData( int );
statusCode applyIteratorToCVsInU( AlIterator* iter, int &rc );
statusCode applyIteratorToCVsInV( AlIterator* iter, int &rc );
statusCode doUpdates( boolean newState = TRUE );
AlSurfaceCV is the class used to access and manipulate surface CVs (also referred to as Control Points). There is one AlSurfaceCV object for each CV of an AlSurface as you see it in the interactive Alias package. You cannot create or delete an AlSurfaceCV. AlSurfaceCVs are only created through AlSurfaces.
There are methods to query and set the multiplicity of a CV, and method 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.
For more information on CVs please see AlCurveCV.
statusCode AlSurfaceCV::worldPosition( double &x, double &y,double &z, double &w) const
Returns the position of this surface CV in world space. This position includes the transformations of all DAG nodes above this surface and the effects of all clusters.
Note that the position returned is [ x y z w ] and not [ w*x w*y w*z w ].
If the surface CV is no longer active no position is returned.
statusCode AlSurfaceCV::affectedPosition( const AlTM& tm, double &x, double &y,double &z, double &w) const
Returns the position of this surface CV modified by the AlTM.
Note that the position returned is [ x y z w ] and not [ w*x w*y w*z w ].
If the surface CV is no longer active no position is returned.
statusCode AlSurfaceCV::unaffectedPosition( double &x, double &y,double &z, double &w ) const
Returns the position of this surface CV PRIOR TO ANY TRANSFORMATIONS (hence "unaffected").
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 surface applied to it AND the transformations of all affecting clusters applied to it (in proportion).
If the surface CV is no longer active no position is returned.
statusCode AlSurfaceCV::setMultiplicity( int u, int v )
Sets the multiplicity of this surface CV to the given multiplicity. The new multiplicity must be 1, 2, or 3. You cannot change the multiplicity of a corner CV of a surface that is open in either the u or v direction.
statusCode AlSurfaceCV::setWorldPosition( double x, double y, double z, boolean includeWorld )
statusCode AlSurfaceCV::setWorldPosition( double x, double y, double z, AlTM tm )
Sets the world position of the CV. The CV may 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.
statusCode AlSurfaceCV::setUnaffectedPosition( double x, double y,double z, double w )
statusCode AlSurfaceCV::blindData( int user_type, long& size, const char *& data )
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 13099 are reserved. If you would like to reserve a block of "user_types" please contact us.
statusCode AlSurfaceCV::setBlindData( int user_type, long size, const char * data )
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.
statusCode AlSurfaceCV::applyIteratorToCVsInU( AlIterator* iter, int &rc )
Starting at this CV, apply the iterator to all CVs in the surface in the U direction. This iterator can be combined with the applyIteratorToCVsInV iterator to create a ’superiterator’ that iterates over all CVs in the surface.
class iterV : public AlIterator {
public:
iterV( AlIterator* inIter ) : iter( inIter ) {};
virutal int func( AlObject* obj )
{
int rc;
if( sSuccess == obj->asSurfaceCVPtr()->applyIteratorToCVsInU( iter, rc ) )
return rc;
else
return -1;
}
private:
AlIterator* iter;
}
....
statusCode applyIteratorToSurfaceCVs( AlSurface *surf, AlIterator* iter, int &rc )
{
if( !iter || !surf )
return sInvalidArgument;
iterV doV( iter );
AlSurfaceCV* cv = surface->firstCV();
statusCode stat = cv->applyIteratorToCVsInV( &doV, rc );
delete cv;
return stat;
}
See the documentation for AlIterator.
statusCode AlSurfaceCV::applyIteratorToCVsInV( AlIterator* iter, int &rc )
Starting at this CV, apply the iterator to all CVs in the surface in the V direction. See the documentation for AlIterator.