user manual

258 Chapter 10: Creating a File Writer
Creating a New File Writer iTool Developers Guide
Creating a New File Writer
The process of creating an visualization type is outlined in the following sections:
“Creating the Class Structure Definition” on page 258
“Creating an Init Method on page 259
“Creating a Cleanup Method on page 264
“Creating a GetProperty Method” on page 264
“Creating a SetProperty Method” on page 265
“Creating a SetData Method” on page 266
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 IDLitWriter Class
The IDLitWriter class is the base class for all iTool file writers. In almost all cases,
new file writers will be subclassed either from the IDLitWriter class or from a class
that is a subclass of IDLitWriter.
See “IDLitWriter” (IDL Reference Guide) for details on the methods properties
available to classes that subclass from IDLitWriter.