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.
statusCode AlLayer::setPickability (AlLayerPickType pickType)
Changes the pickability of the layer. If a creation layer is made referenced or inactive, the default layer becomes the creation layer.
statusCode AlLayer::setColor (int colorField)
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().
statusCode AlLayer::setStartNumber(int newStart)
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.