A SERVICE OF

logo

Chapter 5: Creating an iTool 91
iTool Developer’s Guide Creating a New iTool Class
Creating a New iTool Class
An iTool object class definition file must contain, at the least, the class Init method
and the class structure definition routine. The Init method contains the statements that
register any operations, visualizations, manipulators, and file readers or writers
available in the iTool. The class structure definition routine defines an IDL structure
that will be used when creating new instances of the iTool object.
The process of creating an iTool definition is outlined in the following sections:
“Creating the Class Structure Definition” on page 91
“Creating an Init Method” on page 93
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 have been 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 IDLitToolbase Class
The IDLitToolbase class defines the base operations and user interface functionality
used in iTools created by ITT Visual Information Solutions. If your aim is to create
an iTool that has base functionality similar to that included in the standard iTools,
you will want to subclass from the IDLitToolbase class, or from another tool that
subclasses from the IDLitToolbase class.
The IDLitToolbase class registers a large number of operations, manipulators, file
readers, and file writers. This base feature set may change from release to release;
inspect the file
idlittoolbase__define.pro in the lib/itools subdirectory
of your IDL distribution for the exact set of features included in your distribution.