#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;
virtual AlFace* asFacePtr();
AlFaceNode* faceNode() const;
AlFace* prevFace() const;
AlFace* nextFace() const;
statusCode prevFaceD();
statusCode nextFaceD();
statusCode area( double&, boolean worldCoords=TRUE, double
tolerance=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;
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.
sInvalidObject - the face object was invalid
sFailure - the face could not be removed
Arguments
See AlCurve::create(). Return codes
sSuccess - the face was successfully created AlObjectType AlFace::type() const
Description
Returns the class identifier kFaceType. AlFace* AlFace::asFacePtr()
Description
This virtual function returns a non-null pointer to itself, indicating that it is safe to cast to an object of this class. 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 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 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 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 code
sSuccess - if getting the render information was successful. 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 code
sSuccess - if setting the render information was successful. statusCode AlFace::normal( double norm[3] ) const
Description
Return 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 code
sSuccess - if getting the normal was successful. 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 Return codes
sSuccess - the coordinate was successfully determined