user manual
Chapter 6: Creating a Visualization 121
iTool Developer’s Guide Creating a New Visualization Type
Creating a New Visualization Type
An iTool visualization class definition file must (at the least) provide methods to
initialize the visualization class, get and set property values, handle changes to the
underlying data, clean up when the visualization is destroyed, and define the
visualization class structure. Complex visualization types will likely provide
additional methods.
The process of creating a visualization type is outlined in the following sections:
• “Creating the Class Structure Definition” on page 121
• “Creating an Init Method” on page 123
• “Creating a Cleanup Method” on page 130
• “Creating a GetProperty Method” on page 131
• “Creating a SetProperty Method” on page 132
• “Creating an OnDataChangeUpdate Method” on page 133
• “Creating an OnDataDisconnect Method” on page 134
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 IDLitVisualization Class
The IDLitVisualization class serves as a container for visualization objects displayed
in an iTool. The class includes methods to handle changes to data and property values
automatically; in almost all cases, new visualization types will be subclassed from the