An interface to Alias layer objects.
#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); statusCode create(int); 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 isPicked() const; statusCode pick(); statusCode unpick(); static boolean startNumber(); static statusCode setStartNumber( boolean ); // Symmetric layer support statusCode setSymmetric( boolean ); boolean isSymmetric() const; statusCode setSymmetricOrigin( double, double, double ); statusCode setSymmetricNormal( double, double, double ); statusCode symmetricOrigin( double&, double&, double& ); statusCode symmetricNormal( double&, double&, double& );
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.
Symmetric layers are also supported in the API. Methods available allow the developer to turn symmetric layers on, find out if a layer is symmetric, set/query the origin and normal parameters of the symmetric plane and create the symmetric geometry. Symmetric layers are specified by a normal and a point(origin).
Note: creation of symmetric geometry is done by the AlDagNode class. The complete layer interface is available in Open Model as well.
Constructs an AlLayer wrapper object.
Deletes an AlLayer wrapper object.
This method deletes the layer.
sSuccess - the object was deleted
sInvalidObject - the locator was not valid
Returns an exact copy of the AlLayer wrapper.
Returns the class identifier kLayerType.
Creates a new layer
> number - the number of the new layer
< name - the name of the new layer
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
Creates a new layer.
> number - the number of the new layer
< name - the name of the new layer
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
Create a new layer with the given number
> number - the number of the new layer
sSuccess - the layer was created
sFailure - the layer was not created because either the maximum number of layers had already created or the
layer functionality is turned off.
sAlreadyCreated - object has already been created
Checks if the layer is invisible. Note that if an invisible layer is made the creation layer, it temporarily becomes visible while it is the creation layer.
true - the layer is invisible
false - the layer is visible or the object is invalid or layer functionality is turned off
Changes the visibility of the layer. If a creation layer is made invisible, the default layer becomes the creation layer.
< invisible - a value of true makes the layer invisible and false makes it visible
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
Checks the pickability of the layer.
> pickType - shows whether the layer is inactive, reference or pickable
sSuccess - the layer pickability attribute was found
sInvalidObject - the object is not valid.
Changes the pickability of the layer. If a creation layer is made referenced or inactive, the default layer becomes the creation layer.
< pickability - kLayerInactive makes the layer unpickable and unsnappable, kLayerReference makes the layer unpickable but snappable, and kLayerPickable makes the layer both pickable and snappable.
sSuccess - the layer pickability attribute was set
sFailure - the layers have been turned off
sInvalidObject - the object is not valid
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.
Returns the name of the object.
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
< newName - the new name of the layer
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
Returns true if the instances are drawn in the modeling windows and false otherwise. False is also returned if the layer is invalid.
Sets the drawability of instance nodes in the Alias modeling windows.
< draw - a value of true enables the drawing of instances and a value of false disables it
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
Returns true if the layer can be played back and false otherwise. False is also returned if the layer is invalid.
Sets whether or not a layer can play back.
< enablePlayback - a value of true enables the layer to play back; false prevents it from playing back
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
Returns the color index for inactive modeling in the Alias interface. Color indexes are defined in AlUserColors.h.
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 modeling colors
-1 - the object is invalid
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().
< 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
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
Returns true if the layer is picked. FALSE is returned if the layer is not picked or if the object is invalid.
Unpicks the layer.
sSuccess - the unpick was successfully
sFailure - the unpick operation failed because layers have been disabled
sInvalidObject - the object is not valid
Picks the layer.
sSuccess - the pick was successful
sFailure - the pick operation failed because layers have been disabled
sInvalidObject - the object is not valid
Determines whether or not the layer is visible in the layer bar in the Alias window
Sets whether or not the layer menu should appear in the layer bar.
< visibility - a value of true makes the layer bar visible and false makes it invisible
sSuccess - the visibility in the layer bar was set
sFailure - the layers functionality is turned off
Provides the number of the layer which will be added with the create() method.
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.
< newStart - the new layer will get the layer of this number. newStart can range from 1 to 65,023.
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
Sets this layer to be symmetric or turns layer symmetry off.
< symm - true if symmetry is required, false to turn symmetry off
sSuccess - the method was successful
sFailure - the method failed
sInvalidObject - the layer is invalid
Returns TRUE if this layer is symmetric. FALSE will be returned if the layer is not symmetric of if the method failed.
This methods sets the location of the origin of the symmetric layer.
< x,y,z -coordinates of the symmetric layer’s origin
sSuccess - the method succeeded
sFailure - the method failed
sInvalidObject - the layer is invalid or is not symmetric
This method sets the normal of the symmetric plane.
< x,y,z - the normal of the symmetric plane.
sSuccess - the method succeeded
sFailure - the method failed
sInvalidObject - the layer is invalid or is not symmetric
Returns the symmetric origin of the layer.
> x,y,z - components of the symmetric origin
sSuccess - the method succeeded
sFailure - the method failed
sInvalidObject - the layer is invalid or is not symmetric
Returns the symmetric normal of the layer.
> x,y,z - the components of the normal
sSuccess - the method succeeded
sFailure - the method failed
sInvalidObject - the layer is invalid or is not symmetric