AlFace
 
 
 

Interface to Alias face curves.

Synopsis

#include <AlFace.h>
class AlFace : public AlCurve
AlFace();
virtual	~AlFace();
virtual statusCode	deleteObject();
virtual AlObject*	copyWrapper() const;
statusCode	create( int, curveFormType, int, const double[], int, const double[][4], const int[] );
virtual AlObjectType	type() const;
AlFaceNode*	faceNode() const;
AlFace*	prevFace() const;
AlFace*	nextFace() const;
statusCode	prevFaceD();
statusCode	nextFaceD();
statusCode	area( double&, boolean = TRUE, double = 0.001 );
AlShader*	firstShader() const;
AlShader*	nextShader( AlShader* ) const;
statusCode	nextShaderD( AlShader* ) const;
statusCode	renderInfo( AlRenderInfo& ) const;
statusCode	setRenderInfo( const AlRenderInfo& ) const;
statusCode	normal( double[3] ) const;

Description

An AlFace is derived from AlCurve and inherits AlCurve’s public methods.

AlFace objects are created independently from the AlFaceNode, and then added to the AlFaceNode afterwards. An AlFaceNode requires one valid AlFace object in order for it to be created. Other faces can be added to the list of faces under the AlFaceNode afterwards using AlFaceNode::addFace().

Deleting a face can cause one of two things to happen. If the AlFace is not under an AlFaceNode, or it is one of several faces under an AlFaceNode, then only the face will be deleted. If the AlFace is the only face under the AlFaceNode, then the AlFaceNode will also be deleted.

Each face curve must be planar and each face curve must lie in the same plane as all the others. In addition to the parent class (AlCurve) methods this class allows you to walk through the list of the face curves that make up the face.

All AlFace objects will have at least one shader attached to them. These can be accessed through the firstShader and nextShader methods.

AlFace::AlFace()

Description

Constructs an AlFace wrapper object.

AlFace::~AlFace()

Description

Deletes an AlFace wrapper object.

AlObject *AlFace::copyWrapper() const

Description

Creates an exact copy of the AlFace wrapper.

AlFaceNode* AlFace::faceNode() const

Description

Returns the face node associated with this face.

statusCode AlFace::deleteObject()

Description

If this face isn’t the last face under the parent face node, then this face is removed from the parent node and deleted. If this face is the last face under the parent node, then the face node is deleted as well. If this face doesn’t have a parent node, then only the face is deleted.

Return Codes

sSuccess - the face was successfully removed

sInvalidObject - the face object was invalid

sFailure - the face could not be removed

statusCode AlFace::create( int degree, curveFormType form,int lengthKnotVector, const double knotVector[],int lengthControlP, const double controlPoints[][4],const int multiplicity[] )

Description

Similar to the AlCurve::create() method except that the form can only be either closed or periodic (kClosed or kPeriodic). See the description in AlCurve of the AlCurve::create() method for more details.

Arguments

See AlCurve::create().

Return Codes

sSuccess - the face was successfully created

sInvalidArgument - one of the arguments was NULL or out of range

sFailure - the face could not be created

AlObjectType AlFace::type() const

Description

Returns the class identifier kFaceType.

AlFace* AlFace::prevFace() const

Description

Returns a pointer to the previous face in the list of faces. Returns NULL for the end of the list.

statusCode AlFace::prevFaceD()

Description

Destructively points the current wrapper to the previous face in the list of faces.

Return Codes

sSuccess - the wrapper now points to the previous face

sFailure - there is no previous face

sInvalidObject - the face is invalid

AlFace* AlFace::nextFace() const

Description

Returns a pointer to the previous face in the list of faces. Returns NULL for the end of the list.

statusCode AlFace::nextFaceD()

Description

Destructively points the current wrapper to the next face in the list of faces.

Return Codes

sSuccess - the wrapper now points to the next face

sFailure - there is no next face in the list

sInvalidObject - this face is invalid

AlShader* AlFace::firstShader() const

Description

Returns the first shader that this face object references. Note that only the first AlFace of an AlFaceNode has valid render information.

AlShader* AlFace::nextShader( AlShader* last_shader ) const

Description

Returns the shader after the given shader in the shader list. Specifying NULL as parameter will return the first shader. Note that only the first AlFace of an AlFaceNode has valid render information.

Arguments

< last_shader - shader from which to walk forward

statusCode AlFace::nextShaderD( AlShader* last_shader ) const

Description

Destructively points ’last_shader’ to the shader after the given shader in the shader list.

Arguments

< last_shader - shader from which to walk forward

Return Codes

sSuccess - ’last_shader’ now points to the next shader

sInvalidArgument - ’last_shader’ was invalid or NULL

sInvalidObject - the current face was invalid

sFailure - there was no next shader

statusCode AlFace::renderInfo( AlRenderInfo &render ) const

Description

Fills in the renderInfo structure with the render info for this face. If there wasn’t any render information, in which case the renderInfo is unchanged. NOTE that ONLY the first AlFace of an AlFaceNode has valid render information.

Arguments

> renderInfo - the structure to fill in

Return Codes

sSuccess - getting the render information was successful

sFailure - there wasn’t any render information

sInvalidObject - the face was invalid

statusCode AlFace::setRenderInfo( const AlRenderInfo &render ) const

Description

Sets the render info for this face to the contents of the renderInfo structure. NOTE that ONLY the first AlFace of an AlFaceNode has valid render information.

Arguments

< renderInfo - the structure to take the render information from

Return Codes

sSuccess - setting the render information was successful

sFailure - setting the render information failed

sInvalidObject - the face is invalid

sInvalidArgument - one of the parameters in ’render’ was invalid

statusCode AlFace::normal( double norm[3] ) const

Description

Returns the normal for a curve on a face. The normal for an AlFaceNode is the normal of the first AlFace.

Arguments

> norm - returned normal

Return Codes

sSuccess - getting the normal was successful

sInvalidArgument - the parameter ’norm’ was NULL

sFailure - the normal couldn’t be determined

sInvalidObject - the face was invalid

statusCode AlFace::area( double& area, boolean worldCoordinates, double tolerance )

Description

Determines the area of the face sSuccess will be returned if the evaluation succeeded. sFailure will be returned if the evaluation failed.

Arguments

> area - the returned value

< worldCoordinates - the evaluation is to be in world coordinates

< tolerance - the error tolerance

Return Codes

sSuccess - the coordinate was successfully determined

sFailure - the evaluation failed, or the face was linear or not planar

sInvalidObject - the surface is invalid