A SERVICE OF

logo

Chapter 7: Creating an Operation 153
iTool Developer’s Guide Creating a New Data-Centric Operation
Creating an IDLitDataOperation
The process of creating an IDLitDataOperation is outlined in the following sections:
“Creating the Class Structure Definition” on page 153
“Creating an Init Method” on page 154
“Creating a Cleanup Method” on page 158
“Creating an Execute Method” on page 159
“Creating a DoExecuteUI Method” on page 160
“Creating a GetProperty Method” on page 161
“Creating a SetProperty Method” on page 162
“Creating an UndoExecute Method” on page 164
Creating the Class Structure Definition
When any IDL object is created, IDL looks for an IDL class structure definition that
specifies the instance data fields needed by an instance of the object, along with the
data types of those fields. The object class structure must be defined before any
objects of the type are created. In practice, when the IDL OBJ_NEW function
attempts to create an instance of a specified object class, it executes a procedure
named
ObjectClass
__define (where ObjectClass is the name of the object),
which is expected to define an IDL structure variable with the correct name and
structure fields. For additional information on how IDL creates object instances, see
“The Object Lifecycle” (Chapter 13, Object Programming).
Note
The class structure definition is generally the last routine in the
.pro file that
defines an object class.
Subclassing from the IDLitDataOperation Class
The IDLitDataOperation class simplifies the creation of operations that act only on
data (as opposed to acting on the visual representation of that data) by providing
methods that automate much of the process of execution and storing undo/redo data.
If your operation class modifies data, you will almost certainly subclass from
IDLitDataOperation, or from another operation that subclasses from
IDLitDataOperation. See “IDLitDataOperation” (IDL Reference Guide) for details on