Bookshelf Contents Previous Next Glossary Index Search

AlLayer

An interface to Alias layer objects.

Synopsis

#include <AlLayer.h>
class AlLayer : public AlObject
enum AlLayerPickType {
kLayerPickable,
kLayerReference,
kLayerInactive
};
AlLayer();
virtual ~AlLayer();
virtual AlObject* copyWrapper() const;
virtual statusCode deleteObject();
virtual AlObjectType type() const;
statusCode create(const char * = NULL);
statusCode create(int&, const char * = NULL);
boolean invisible() const;
statusCode setInvisible( boolean );
int number() const;
const char * name() const;
statusCode setName( const char * );
statusCode pickability( AlLayerPickType& ) const;
statusCode setPickability( AlLayerPickType );
boolean playback() const;
statusCode setPlayback( boolean );
boolean drawInstances() const;
statusCode setDrawInstances( boolean );
boolean visibleInLayerBar() const;
statusCode setVisibleInLayerBar( boolean );
int color() const;
statusCode setColor( int );
boolean selected() const;
statusCode setSelected( boolean );
boolean isPicked() const;
statusCode pick();
statusCode unpick();
static boolean startNumber();
static statusCode setStartNumber( boolean );

Description

Layers provide a way of organizing models to improve the workflow. The layers have attributes such as visibility and pickability that apply to all the DAG nodes which refer to them. The AlDagNode has methods to get the AlLayer it is in and set to a new AlLayer.

Each AlLayer has a unique identifying number and a name. By default, the layer gets the unique name based on its number; however, the user is free to change it to any name. Layer names provided by the user do not have to be unique.

The types of layers are:

A DAG node (AlDagNode) can be transferred from one layer to another but can exist on only one layer at a time. When an AlDagNode is assigned to a non-default layer:

All attributes in an AlLayer can be obtained and set with the methods in this class. By default, all the layers have a corresponding menu in the Alias interface and are visible in the layer bar in the Alias interface. However, if you want to work with a partial list of layers you can make them visible using the visibleInLayerBar() method. The change in visibility in the layer bar does not change the other attributes of the AlLayer.

All existing layers in an AlUniverse can be accessed through methods in AlUniverse. The layer functionality can be temporarily disabled through the static method setLayersEnabled() in the AlUniverse class. When the layer functionality is disabled or turned off, all the layer attributes temporarily become similar to the default layer. However, the layer references of the AlDagNode are not changed.

The complete layer interface is available in Open Model as well.

Summary

AlLayer::AlLayer(void)

Description

Constructs an AlLayer wrapper object.

AlLayer::~AlLayer()

Description

Deletes an AlLayer wrapper object.

statusCode AlLayer::deleteObject()

Description

This method deletes the layer.

Return Codes

sSuccess - the object was deleted

sInvalidObject - the locator was not valid

AlObject* AlLayer::copyWrapper() const

Description

Returns an exact copy of the AlLayer wrapper.

AlObjectType AlLayer::type() const

Description

Returns the class identifier kLayerType.

statusCode AlLayer::create( const char* name)

Description

Creates a new layer

Arguments

> number - the number of the new layer

< name - the name of the new layer

Return Codes

sSuccess - the layer was created

sFailure - the layer was not created because either the maximum number of layers were already created or the layer functionality is turned off

sAlreadyCreated - the object has already been created

statusCode AlLayer::create( int& number, const char* name)

Description

Creates a new layer.

Arguments

> number - the number of the new layer

< name - the name of the new layer

Return Codes

sSuccess - the layer was created

sFailure - the layer was not created because either the maximum number of layers were already created or the layer functionality is turned off

sAlreadyCreated - the object has already been created

boolean AlLayer::invisible() const

Description

Checks if the layer is invisible. Noter that if an invisible layer is made the creation layer, it temporarily becomes visible while it is the creation layer.

Return Values

true - the layer is invisible

false - the layer is visible or the object is invalid or layer functionality is turned off

statusCode AlLayer::setInvisible(boolean invisible)

Description

Changes the visiblity of the layer. If a creation layer is made invisible, the default layer automatically becomes the creation layer.

Arguments

< invisible - a value of true makes the layer invisible and false makes it visible

Return Codes

sSuccess - the layer visibility attribute was set

sFailure - the attribute was not set (perhaps the layer functionality was turned off)

sInvalidObject - the object is not valid

statusCode AlLayer::pickability (AlLayerPickType& pickType) const

Description

Checks the pickability of the layer.

Arguments

> pickType - shows whether the layer is inactive, reference or pickable

Return Codes

sSuccess - the layer pickability attribute was found

sInvalidObject - the object is not valid.

statusCode AlLayer::setPickability (AlLayerPickType pickType)

Description

Changes the pickability of the layer. If a creation layer is made referenced or inactive, the default layer automatically becomes the creation layer.

Arguments

< pickability - kLayerInactive makes the layer unpickable and unsnapable, kLayerReference makes the layer unpickable but snapable, and kLayerPickable makes the layer both pickable and snapable

Return Codes

sSuccess - the layer pickability attribute was set

sFailure - the layers have been turned off

sInvalidObject - the object is not valid

int AlLayer::number() const

Description

Gets the number of the layer. This number is fixed and unique. It cannot be set to another value.

A value of 0 is returned if this is the default layer. -1 is returned if the object is not valid.

const char * AlLayer::name() const

Description

Returns the name of the object.

statusCode AlLayer::setName (const char *newName)

Description

Sets the name of a layer. By default the name of the layer is determined by its number. For example, a layer with a number 3 is named layer#3 by default

Arguments

< newName - the new name of the layer

Return Codes

sSuccess - the name was set

sFailure - the layer is a default layer or the name length exceeded 255 characters, or the layers functionality is disabled.

sInvalidArgument - newName was NULL

sInvalidObject - the object is not valid

boolean AlLayer::drawInstances() const

Description

Returns true if the instances are drawn in the modeling windows and false otherwise. False is also returned if the layer is invalid.

statusCode AlLayer::setDrawInstances (boolean draw)

Description

Sets the drawability of instance nodes in the Alias modelling windows.

Arguments

< draw - a value of true enables the drawing of instances and a value of false disables it

Return Codes

sSuccess - the drawing of instances was set

sFailure - the layer is a default layer or the layer functionality is disabled

sInvalidObject - the object is not valid

boolean AlLayer::playback() const

Description

Returns true if the layer can be played back and false otherwise. False is also returned if the layer is invalid.

statusCode AlLayer::setPlayback (boolean enablePlayback)

Description

Sets whether or not a layer can play back.

Arguments

< enablePlayback - a value of true enables the layer to play back; false prevents it from playing back

Return Codes

sSuccess - the playback setting was enabled

sFailure - the layer is a default layer or the layer functionality is disabled

sInvalidObject - the object is not valid

int AlLayer::color() const

Description

Returns the color index for inactive modelling in the Alias interface. Color indexes are defined in AlUserColors.h.

Return Values

kUserInactiveModelColor - the layer does not have a color and it uses the default Alias colors

kUserInactiveLayerUser1, kUserInactiveLayerUser2, ..., kUserInactiveLayerUser15 - the color index of the Alias inactive modelling colors

-1 - the object is invalid

statusCode AlLayer::setColor (int colorField)

Description

Sets the layer color by colorField, as defined in AlUserColors.h. The valid color indices vary from kUserInactiveLayerUser1Color to kUserInactiveLayerUser15Color, providing 15 valid colors which can be set for the layers. The definition of these colors can be changed with AlUniverse::setUserPrefColor().

Arguments

< colorField - kUserInactiveLayerUser1Color to kUserInactiveLayerUser15Color - the layer uses colors 1 through 15, depending on which value you specify, or kUserInactiveModelColor - the layer uses the default Alias model color

Return Codes

sSuccess - the color was set

sFailure - the layer functionality is disabled

sInvalidArgument - the color index was out of range

sInvalidObject - the object is not valid

boolean AlLayer::selected() const

Description

Obselete method. Call AlLayer::isPicked() instead.

statusCode AlLayer::setSelected (boolean select)

Description

Obselete method. Call the pick() or unpick() methods instead.

boolean AlLayer::isPicked() const

Description:

Returns true if the layer is picked. FALSE is returned if the layer is not picked or if the object is invalid.

statusCode AlLayer::unpick()

Description:

Unpicks the layer.

Return code:

sSuccess - the unpick was successfully

sFailure - the unpick operation failed because layers have been disabled

sInvalidObject - the object is not valid

statusCode AlLayer::pick()

Description:

Picks the layer.

Return code:

sSuccess - the pick was successfully

sFailure - the pick operation failed because layers have been disabled

sInvalidObject - the object is not valid

boolean AlLayer::visibleInLayerBar() const

Description

Determines whether or not the layer is visible in the layer bar in the Alias window

statusCode AlLayer::setVisibleInLayerBar (boolean visibility)

Description

Sets whether or not the layer menu should appear in the layer bar.

Arguments

< visibility - a value of true makes the layer bar visible and false makes it invisible

Return Codes

sSuccess - the visibility in the layer bar was set

sFailure - the layers functionality is turned off

int AlLayer::startNumber()

Description

Provides the number of the layer which will be added with the create() method.

statusCode AlLayer::setStartNumber(int newStart)

Description

Sets the number which a new layer created with create() method will get. Further create() invocations will increment the number by one for each new layer. Once the layer is created its number cannot be changed. Also if the layer by that number already exists, the number is incremented until a layer by that number does not exist.

Arguments

< newStart - the new layer will get the layer of this number. newStart can range from 1 to 65,023.

Return Codes

sSuccess - the layer start number was set

sFailure - the layer could not be set

sInvalidArgument - the number was outside the range of 1 to 65,023



Bookshelf Contents Previous Next Glossary Index Search

[email protected]
Copyright © 1998, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved.