Encapsulates the user defined interface to command history.
#include <AlCommand.h>
class AlCommand : public AlObject
AlCommand();
virtual ~AlCommand();
virtual statusCode deleteObject();
virtual AlObjectType type() const;
statusCode create( const char *name );
statusCode install();
statusCode uninstall();
statusCode modified();
int execute( boolean freeIfInvalid = TRUE );
int undo( boolean freeIfInvalid = TRUE );
AlSurfaceType surfaceType() const;
statusCode setSurfaceType( AlSurfaceType );
AlUserCommand* userCommand();
int status() const;
static statusCode setDebug( boolean on );
static statusCode add( AlUserCommandAlloc *, const char *name );
static statusCode remove( const char *name );
This file contains the definitions required to define an user command history command.
The command layer in Alias is a software layer that is between the user interface and the main application. A command is an object that represents actions such as: fillet, square, or patch.
The user interface code builds commands that are sent through the layer to be executed. The user interface does not create geometry itself, it creates commands that do it.
Commands can be saved somewhere and re-executed whenever the system feels it is necessary. As long as the data the command depends upon is valid, the command remains valid.
The most practical application of re-executing a command is the generation of data from a piece of source geometry. When the original geometry changes, the new model can be ’automatically’ created by re-executing the command history on the new data.
Command functions: These are outlined in the AlUserCommand class.
A ‘constructor’ DAG node is considered to be a DAG node which creates the result. An example of a constructor is one of the original curves in a fillet operation.
A ‘target’ DAG node is considered to be the result of a command operation. An example is the fillet created by the fillet command.
The ’AlCommand’ class is used to maintain a list of the current plug-in defined command history commands. New commands are installed using the ’AlCommand::add’ method. This associates a string with a function that allocates a new copy of a command. The first parameter of the add command is a AlUserCommandAlloc. An AlUserCommandAlloc is a pointer to a function returning an AlUserCommand class as defined below.
typedef AlUserCommand *AlUserCommandAlloc();
AlCommand::remove is used to remove a command type from the database.
AlCommand::create is used to create an new copy of the command. After a command has been created, its data fields can be accessed using the ’AlCommand->userCommand’ method.
A command has two components, the UI driver and the underlying geometry manipulation code. The UI creates a new command using AlCommand::create. The private data is accessed using the AlCommand -> userCommand method (which is typecast to the plug-in’s derived command). From this, the command data structure’s fields can be filled in. The UI uses the execute method to call the userCommand’s execute command. This does the actual command. Finally the result is added to the Alias system using the ’install’ method.
The Alias messaging system will call the various functions in the command to maintain the dependencies and re-execute the command if necessary.
statusCode AlCommand::add( AlUserCommandAlloc *func, const char *name )