Share

AlCanvas

An interface to Alias Canvas objects. Note that some functionality works only in OpenAlias plugins.

Synopsis

#include <AlCanvas.h>
class AlCanvas : public AlObject
struct CanvasLocation {
        double origin[3];
        double scale[2];
        double axisX[3];
        double axisY[3];
        double axisZ[3];
};
struct CanvasInfo {
        const char* name;
        int imageSize[2];
        void* image;        
};
struct CanvasFileInfo {
        const char* name;
        const char* absoluteFilePath;
};
virtual    ~AlCanvas();    
AlCanvas();    

virtual AlObject* copyWrapper() const;
virtual statusCode deleteObject();
virtual AlObjectType type() const;

const char * name() const;
statusCode setName( const char*);

// Only for use in OpenAlias plugins. Creation of canvas images
// can not be done from an OpenModel executable.
statusCode create(CanvasInfo&, CanvasLocation&);
statusCode create(CanvasFileInfo&, CanvasLocation&);
statusCode createInWindow(CanvasInfo&);
statusCode createInWindow(CanvasFileInfo&);

AlConstructionPlane* plane();

statusCode pick(API_BOOLEAN);
API_BOOLEAN isPicked() const;

statusCode getImage( CanvasInfo& );

Description

This wrapper provides access to Alias canvas objects. Some functions work only in OpenAlias binaries, not in OpenModel ones. If such restrictions apply, it is noted in the function description.

AlCanvas::AlCanvas()

Construct a new AlCanvas wrapper object.

AlCanvas::~AlCanvas()

Description

Deconstruct an AlCanvas wrapper object.

AlObject *AlCanvas::copyWrapper() const

Description

Makes a copy of the AlCanvas. The returned AlCanvas will reference the same data as the original.

statusCode AlCanvas::deleteObject()

Description

Deletes the canvas wrapped by the AlCanvas wrapper.

Return codes

sSuccess - the object was deleted

sFailure - an internal failure occurred

sInvalidObject - the object was invalid

AlObjectType AlCanvas::type() const

Description

Returns the class identifier ’kCanvasType’.

const char* AlCanvas::name() const

Description

Returns a pointer to this canvas’s name.

statusCode AlCanvas::setName( const char *newName )

Description

Changes the canvas’s name to the given name. If the given name is not a unique one, then a unique name is generated based on the given name and assigned to the canvas. In this case, a status code of ’sNameChangedToUniqueOne’ is returned. A copy of the argument string is made, so you are responsible for deleting it.

Arguments

< newName - the name to be given to the canvas

Return Codes

sSuccess - successful

sInvalidObject - the canvas is not valid

sInvalidArgument - given pointer is NULL

statusCode create(CanvasInfo&, CanvasLocation&)

Description

Create a new canvas.

This function works only in OpenAlias plugins.

Return codes

sSuccess - the canvas was created

sFailure - the canvas failed to be createdCanvasLocation

sAlreadyCreated - object has already been created

statusCode create(CanvasFileInfo&, CanvasLocation&)

Description

Create a new canvas.

This function works only in OpenAlias plugins.

Return codes

sSuccess - the canvas was created

sFailure - the canvas failed to be created

sAlreadyCreated - object has already been created

statusCode createInWindow(CanvasInfo&)

Description

Create a new canvas in the current modeling window.

This function works only in OpenAlias plugins.

Return codes

sSuccess - the canvas was created

sFailure - the canvas failed to be created

sAlreadyCreated - object has already been created

statusCode createInWindow(CanvasFileInfo&)

Description

Create a new canvas in the current modeling window.

This function works only in OpenAlias plugins.

Return codes

sSuccess - the canvas was created

sFailure - the canvas failed to be created

sAlreadyCreated - object has already been created

AlConstructionPlane* plane()

Description

Return a new construction plane that coincides with the canvas of this wrapper.

statusCode pick(API_BOOLEAN)

Description

Sets the Pick Status of the canvas

Arguments

< state - new state of the canvas, a value of true makes the canvas picked and false sets it to unpicked

Return Codes

sSuccess - the state was set

sFailure - internal error

sInvalidObject - the object is not valid

API_BOOLEAN isPicked() const

Description

Returns the pick status of the Canvas.

Return codes

true - if the Canvas is picked

false - if it is not picked, the object is invalid

statusCode getImage( CanvasInfo& )

Description

Returns the image of this canvas.

Works only in an OpenAlias plugin.

Arguments

> info - the canvas info

Return codes

sSuccess - the canvas info was written.

sFailure - the wrapper is invalid or called in an OpenModel plugin

sInvalidObject - the canvas this wrapper contains could not be found

Was this information helpful?