user manual

122 Chapter 6: Creating a Visualization
Creating a New Visualization Type iTool Developers Guide
IDLitVisualization class. See “IDLitVisualization” (IDL Reference Guide) for details
on the methods and properties available to classes that subclass from
IDLitVisualization.
Example Class Structure Definition
The following is the class structure definition for the ExampleVis visualization
class. This procedure should be the last procedure in a file named
examplevis__define.pro.
PRO ExampleVis__Define
struct = { ExampleVis, $
INHERITS IDLitVisualization, $
_oPlot: OBJ_NEW(), $
_oSymbol: OBJ_NEW(), $
_exampleProperty: '' $
}
END
Discussion
The purpose of the structure definition routine is to define a named IDL structure
with structure fields that will contain the visualization object instance data. The
structure name should be the same as the visualization’s class name — in this case,
ExampleVis.
Like many iTool visualizations,
ExampleVis is created as a subclass of the
IDLitVisualization class. Visualization classes that subclass from the
IDLitVisualization class inherit all of the standard iTool visualization features, as
described in “Subclassing from the IDLitVisualization Class” on page 121.
The ExampleVis visualization class instance data includes two graphics objects: an
IDLitVisPlot object, to which a reference is stored in the
_oPlot class structure
field, and an IDLitSymbol object, to which a reference is stored in the
_oSymbol
class structure field. Both graphics objects are defined in the class structure
definitions as object instances, denoted by the presence of the
OBJ_NEW() after the
structure field name. Finally, instance data for a string property named
ExampleProperty is stored in the _exampleProperty class structure field.
Note
This example is intended to demonstrate how simple it can be to create a new
visualization class definition. While the class definition for a visualization class