AlPolysetVertex

Interface to Alias polyset vertices.

Synopsis

#include <AlPolysetVertex.h>
class AlPolysetVertex : public AlObject , public AlClusterable , public AlAnimatable , public AlSettable , public AlPickable
AlPolysetVertex();
virtual ~AlPolysetVertex();
virtual AlObject* copyWrapper() const;
virtual AlAnimatable* asAnimatablePtr();
virtual AlSettable* asSettablePtr();
virtual AlClusterable* asClusterablePtr();
virtual AlPickable* asPickablePtr();
virtual AlObjectType type() const;
virtual AlPolysetVertex* asPolysetVertexPtr();
statusCode worldPosition( double&, double&, double& )const;
statusCode affectedPosition( AlTM&, double&, double&, double& )const;
statusCode unaffectedPosition( double&, double&, double& )const;
statusCode setWorldPosition( double, double, double, boolean );
statusCode setWorldPosition( double, double, double, AlTM );
statusCode setUnaffectedPosition( double, double, double );
statusCode normal( double&, double&, double& ) const;
statusCode setNormal( double, double, double );
statusCode freezeNormalFlag( boolean& ) const;
statusCode setFreezeNormalFlag( boolean );
statusCode st( double&, double& ) const;
statusCode setSt( double, double );
statusCode color( double&, double&, double&, double& ) const;
statusCode setColor( double, double, double, double );
int index() const;
AlPolyset* polyset() const;
statusCode blindData( int, long&, const char *& );
statusCode setBlindData( int, long, const char * );
statusCode removeBlindData( int );
statusCode doUpdates( boolean newState = TRUE );

Description

AlPolysetVertex is the interface to the vertex data of Alias' polyset objects. An AlPolysetVertex can only be created through AlPolyset::newVertex() method, and it can be deleted only through the AlPolyset::deleteVertex() method. AlPolysetVertex's have similar methods to AlCurveCV and AlSurfaceCV for getting and setting the unaffected and affected positions of vertices.

An AlPolysetVertex defines a location in space for a corner of an AlPolygon.

Summary

AlAnimatable *AlPolysetVertex::asAnimatablePtr()

Description

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

AlSettable *AlPolysetVertex::asSettablePtr()

Description

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

AlClusterable *AlPolysetVertex::asClusterablePtr()

Description

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

AlPickable *AlPolysetVertex::asPickablePtr()

Description

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

AlPolysetVertex::~AlPolysetVertex()

Description

Deletes an AlPolysetVertex wrapper object.

AlObject* AlPolysetVertex::copyWrapper() const

Description

This makes an exact copy of the AlPolysetVertex wrapper.

AlObjectType AlPolysetVertex::type() const

Description

Returns the class identifier kPolysetVertexType.

AlPolysetVertex* AlPolysetVertex::asPolysetVertexPtr()

Description

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

AlPolyset* AlPolysetVertex::polyset() const

Description

Returns a pointer to the AlPolyset for this vertex.

statusCode AlPolysetVertex::worldPosition( double& x, double& y, double& z ) const

Description

Returns the world position of the vertex. This position includes the transformations of all dag nodes above this polyset, as well as the effect of clusters.

Arguments

> 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

Return code

sSuccess - The normal was retrieved from the vertex.

sFailure - the vertex is inactive.

sInvalidObject - the vertex is invalid

statusCode AlPolysetVertex::affectedPosition( AlTM& tm, double& x, double& y, double& z ) const

Description

Returns the affected position of the vertex. The affected position is the unaffected position pre-multiplied by the AlTM.

Arguments

> AlTM& tm - the transformation matrix.

> double& x - the affected position in the x direction

> double& y - the affected position in the y direction

> double& z - the affected position in the z direction

Return code

sSuccess - The affected position was retrieved from the vertex.

sFailure - the vertex is inactive.

sInvalidObject - the vertex is invalid

statusCode AlPolysetVertex::unaffectedPosition( double& x, double& y, double& z ) const

Description

Returns the position of this vertex PRIOR TO ANY TRANSFORMATIONS (hence "unaffected").

Arguments

> double& x - the local x position

> double& y - the local y position

> double& z - the local z position

Return code

sSuccess - The unaffected position was retrieved from the vertex.

sFailure - the vertex is inactive.

sInvalidObject - the vertex is invalid

statusCode AlPolysetVertex::doUpdates( boolean newState )

Description

See AlDagNode for info

statusCode AlPolysetVertex::setWorldPosition( double x, double y, double z, boolean includeWorld )

Description

Sets the world position of the vertex. This includes vertices in clusters.

Arguments

> double x - the unaffected position in the x direction

> double y - the unaffected position in the y direction

> double z - the unaffected position in the z direction

> boolean includeWorld - include world transformation in move

Return code

sSuccess - affected position was set

sFailure - the vertex is inactive.

- the move could not be performed

sInvalidObject - the vertex is invalid

statusCode AlPolysetVertex::setWorldPosition( double x, double y, double z, AlTM tm )

Description

Sets the world position of the vertex. This includes vertices within clusters. 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 unaffected position in the x direction

> double y - the unaffected position in the y direction

> double z - the unaffected position in the z direction

> AlTM tm - user's transformation matrix

Return code

sSuccess - affected position was set

sFailure - the vertex is inactive.

- the move could not be performed

sInvalidObject - the vertex is invalid

statusCode AlPolysetVertex::setUnaffectedPosition( double x, double y, double z )

Description

Sets the unaffected position of the vertex.

Arguments

> double x - the unaffected position in the x direction

> double y - the unaffected position in the y direction

> double z - the unaffected position in the z direction

Return code

sSuccess - unaffected position was set

sFailure - the vertex is inactive.

sInvalidObject - the vertex is invalid

statusCode AlPolysetVertex::normal( double& x, double& y, double& z ) const

Description

Get the normal for the vertex.

Arguments

> double &x, &y, &z - retrieved 3D vector for the normal

Return code

sSuccess - The normal was retrieved from the vertex.

sFailure - the vertex is inactive.

sInvalidObject - the vertex is invalid

statusCode AlPolysetVertex::setNormal( double x, double y, double z )

Description

Set the normal for the vertex.

Arguments

< double x, y, z - 3D vector for the normal

Return code

sSuccess - The normal was retrieved from the polygon.

sInvalidObject - the vertex is invalid

sFailure - the normal was frozen or the polyset's normals are frozen

statusCode AlPolysetVertex::freezeNormalFlag( boolean& freezeNormal ) const

Description

Return the value of the flag that determines whether or not the renderer recalculates vertex normals.

Arguments

> freezeNormal - the returned state of the freeze flag

Return codes

sSuccess - The flag was properly returned.

sInvalidObject - The vertex is invalid

statusCode AlPolysetVertex::setFreezeNormalFlag( boolean freezeNormal )

Description

Set the flag that governs whether or not vertex normals are recalculated by the renderer. If the freezeNormal flag is set to TRUE, the renderer will NOT recalculate the vertex normal. If it is set to FALSE, the renderer will recalculate the vertex normal.

Arguments

< freezeNormal - flag state to set.

Return codes

sSuccess - The flag was properly set.

sInvalidObject - The vertex is invalid

statusCode AlPolysetVertex::st( double& s, double& t ) const

Description

Get the ST coordinates for the vertex. S and T coordinates for a polyset vertex are typically used for texture coordinates, and may be generated based on the parametrization of the surface.

Arguments

> s - the s coordinate to retrieve

> t - the t coordinate to retrieve

Return code

sSuccess - The st coordinates were retrieved from the vertex.

sFailure - The st coordinates were invalid and not returned.

sInvalidObject - the vertex is invalid

statusCode AlPolysetVertex::setSt( double s, double t )

Description

Set the ST coordinates for the vertex. S and T coordinates for a polyset vertex are typically used for texture coordinates, and may be generated based on the parameterization of the surface.

Arguments

< s, t - the s,t parametric coordinate for the vertex

Return code

sSuccess - The st coordinates were set in the polygon.

sFailure - the vertex is inactive.

sInvalidObject - the vertex is invalid

statusCode AlPolysetVertex::color( double& r, double& g, double &b, double &a ) const

Description

Gets the color information for a vertex.

Note that the color information is provided for OpenModel user convenience only. This information is not used by the Alias application. Alias shading calculations will neither affect nor respect the information specified by this method.

Arguments

> double &r, &g, &b, &a - the retrieved color information

Return code

sSuccess - The color was retrieved from the vertex.

sFailure - the vertex is inactive.

sInvalidObject - the vertex is invalid.

statusCode AlPolysetVertex::setColor( double r, double g, double b, double a )

Description

Sets the color information for a vertex.

Note that the color information is provided for OpenModel user convenience only. This information is not used by the Alias application. Alias shading calculations will neither affect nor respect the information specified by this method.

Arguments

< double r, g, b, a - the red, green, blue, alpha information to set

Return code

sSuccess - The color was set in the polygon.

sInvalidObject - the vertex is invalid.

int AlPolysetVertex::index() const

Description

Return the index of this vertex in the polyset. On errors -1 is returned.

statusCode AlPolysetVertex::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.

> size - number of characters in the block of data.

> data - address of the block of data.

Return codes

sSuccess - blind data retrieved

sInvalidObject - object is invalid

statusCode AlPolysetVertex::setBlindData( int user_type, long size, const char * data )

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.

< size - number of characters in the block.

< data - address of the block of data.

Return codes

sSuccess - everything is okay.

sInsufficientMemory - not enough memory to allocate a new block.

sInvalidObject - the vertex is invalid.

statusCode AlPolysetVertex::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

sFailure - no such blind data existed sInvalidObject - the given object was not valid





aliasdocs@aw.sgi.com
Copyright © 1996, Alias|Wavefront, a Silicon Graphics Company. All rights reserved.