AlShell
 
 
 

Interface to Alias NURBS surface geometry.

Synopsis

#include <AlShell.h>
class AlShell : public AlObject
AlShell();
virtual	~AlShell();
virtual AlObject*	copyWrapper() const;
virtual AlObjectType	type() const;
AlShellNode*	shellNode() const;
statusCode	create( AlTrimRegion*, boolean );
statusCode addToShell( AlTrimRegion*, boolean );
boolean	isInShell( AlTrimRegion* );
AlTrimRegion*	firstTrimRegion() const;
AlGroupNode*	unstitchShell( void );
AlShader*	firstShader() const;
AlShader*	nextShader( const AlShader* ) const;
statusCode	nextShaderD( AlShader* ) const;
statusCode	assignShader( AlShader* );
statusCode	layerShader( AlShader* );
statusCode	renderInfo( AlRenderInfo& ) const;
statusCode	setRenderInfo( const AlRenderInfo& ) const;
boolean isDisplayModeSet( AlDisplayModeType ) const;
statusCode setDisplayMode( AlDisplayModeType, boolean );
statusCode area( double &, boolean = TRUE, double tolerance=0.001 );
statusCode circumference( double &, boolean = TRUE, double tolerance=0.001 );

Description

A shell is a collection of surfaces that behaves as a single object. Each surface can have its own set of trim curves. A cube with six square sides is a shell. The cube can be assigned a single shader and rendering formation. The cube is made of a collection of 6 spline surfaces.

The AlTrimRegions are inaccurately named. They actually represent the surfaces in the shell.

AlShell::AlShell()

Description

Constructs an AlShell wrapper object.

AlShell::~AlShell()

Description

Deletes an AlShell wrapper object.

AlObject *AlShell::copyWrapper() const

Description

Returns an exact duplicate of this AlShell wrapper.

AlObjectType AlShell::type() const

Description

Returns the class identifier kShellType.

AlShell* AlShell::asShellPtr()

Description

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

AlShellNode* AlShell::shellNode() const

Description

Returns a pointer to the AlShellNode for this surface.

statusCode AlShell::create( AlTrimRegion * region, boolean shrink_surface )

Description

Creates a shell by transforming the given trim region. A new shell is created in Alias, which matches the trim region. A DagNode is also constructed above the shell.

Arguments

region - an AlTrimRegion which serves as a base for the shell

shrink_surface - if this flag is set, the surface underlying the given trim region will be reparameterized if the amount thrown away is great enough

Return Codes

sSuccess - a shell was constructed

sInvalidArgument - the given region was not valid

sFailure - the shell could not be constructed

statusCode AlShell::addToShell( AlTrimRegion * region, boolean shrink_surface )

Description

Adds trim region to the shell. Note that only adjacent surfaces can be added to a shell. This may require that the user try this method for all of the remaining shells to see if it fails for each one.

Arguments

region - an AlTrimRegion which is added to the shell

shrink_surface - if this flag is set, the surface underlying the given trim region will be reparameterized if the amount thrown away is great enough

Return Codes

sSuccess - the trim region was added

sInvalidArgument - the given region was not valid

sFailure - the trim region could not be added

boolean AlShell::isInShell( AlTrimRegion * region )

Description

Returns TRUE if the trim region is in the shell.

Arguments

region - an AlTrimRegion to check

AlTrimRegion* AlShell::firstTrimRegion() const

Description

Returns the first trim region of a list if the surface has been trimmed. Returns NULL if there is no such trim region. Use the methods in the AlNewTrimRegion class to get trim region information.

AlGroupNode *AlShell::unstitchShell( void )

Description

Unstitches the shell into a collection of objects.

AlShader* AlShell::firstShader() const

Description

Returns the first shader that this surface object references. Returns NULL if there are no shaders.

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

Description

Returns the shader after the given shader in the object’s shader list. Returns NULL if there isn’t a next shader. Specifying NULL as parameter will return the first shader.

Arguments

< last_shader - shader from which to walk forward

statusCode AlShell::nextShaderD( AlShader* last_shader ) const

Description

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

Arguments

< last_shader - shader from which to walk forward

Return Codes

sSuccess - last_shader now points to the next shader

sFailure - there isn’t a next shader

sInvalidArgument - last_shader is invalid

sInvalidObject - the surface is invalid

statusCode AlShell::assignShader( AlShader* shader )

Description

Assigns the given shader to the surface. If the surface already has shaders, they will be removed from the surface. The surface must have a surface node for this method to succeed.

Arguments

< shader - the shader which will be assigned to the surface

Return Codes

sSuccess - the shader was successfully assigned to the surface

sInvalidArgument - ’shader’ was invalid

sFailure - the shader was not created

sInvalidObject - the surface is invalid

statusCode AlShell::layerShader( AlShader* shader )

Description

Layers the given shader on the surface. The surface must have a surface node for this method to succeed.

Arguments

< shader - the shader that will be layered on the surface

Return Codes

sSuccess - the shader was successfully layered on the surface

sInvalidArgument - ’shader’ was invalid

sFailure - the shader was not created

sInvalidObject - the surface is invalid

statusCode AlShell::renderInfo( AlRenderInfo &renderInfo ) const

Description

Fills in the renderInfo structure with the render info for this surface.

Arguments

> renderInfo - the structure to fill in

Return Codes

sSuccess - getting the render information was successful

sInvalidArgument - ’renderInfo’ is NULL

sFailure - there wasn’t any render information (renderInfo is unchanged)

sInvalidObject - the surface is invalid

statusCode AlShell::setRenderInfo( const AlRenderInfo &renderInfo ) const

Description

Sets the render info for this surface to the contents of the renderInfo structure.

Arguments

< renderInfo - the structure to take the render information from

Return Codes

sSuccess - setting the render information was successful

sInvalidArgument - ’renderInfo’ was NULL or a parameter in ’renderInfo’ was out of range

sFailure - setting the render information failed

sInvalidObject - the surface is invalid

boolean AlShell::isDisplayModeSet( AlDisplayModeType mode ) const

Description

Returns TRUE if the specified display mode is toggled on for the surface. Returns FALSE otherwise.

The only valid AlDisplayModeTypes for an AlSurface are

kDisplayGeomHull 
kDisplayGeomEditPoints 
kDisplayGeomKeyPoints 
kDisplayGeomCVs 

Arguments

< mode - display mode of interest

statusCode AlShell::setDisplayMode( AlDisplayModeType mode, boolean on_or_off )

Description

For the given display mode, if the flag is TRUE then the display mode for the surface is set, otherwise it is unset.

The only valid AlDisplayModeTypes for an AlSurface are

kDisplayGeomHull 
kDisplayGeomEditPoints 
kDisplayGeomKeyPoints 
kDisplayGeomCVs 

Arguments

< mode - display mode of interest

< on_or_off - TRUE means that this surface will have the display mode set. FALSE means it will be unset.

Return values

sSuccess - operation was successful

sFailure - unable to complete this operation

sInvalidArgument - invalid display type

sInvalidObject - the surface is invalid

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

Description

Determines the area of the shell. This is the area of all of the members of the shell summed.

Arguments

< worldCoordinates - TRUE to get the world space area

> area - the returned value

> tolerance - the error tolerance

Return Codes

sSuccess - the coordinate was successfully determined

sFailure - the evaluation failed

sInvalidObject - the shell is invalid

statusCode AlShell::circumference( double& circ, boolean worldCoordinates, double tolerance )

Description

Determines the area of the shell. This will be the area of all of the members of the shell summed.

Arguments

< worldCoordinates - TRUE to get the world space area

> area - the returned value

> tolerance - the error tolerance

Return Codes

sSuccess - the coordinate was successfully determined

sFailure - the evaluation failed

sInvalidObject - the shell is invalid