A SERVICE OF

logo

Chapter 8: Creating a Manipulator 211
iTool Developer’s Guide Creating a New Manipulator
FUNCTION ExampleManip::Init, _REF_EXTRA = _extra
; Initialize the superclass.
IF (self->IDLitManipulator::Init(TYPES=['IDLIMAGE'], $
NAME='Sample Manipulator', TRANSIENT_DEFAULT=1, $
OPERATION_IDENTIFIER='SET_PROPERTY', $
PARAMETER_IDENTIFIER='ALPHA_CHANNEL', $
_EXTRA = _extra) NE 1) THEN $
RETURN, 0
; Call a custom method that registers a cursor for this
; manipulator.
self->DoRegisterCursor
; Indicate success.
RETURN, 1
END
Discussion
The
ExampleManip class is based on the IDLitManipulator class (discussed in
“Subclassing From the IDLitManipulator Class” on page 207). As a result, all of the
standard features of an iTool manipulator are already present. We don’t define any
keyword values to be handled explicitly in the Init method, but we do use the
keyword inheritance mechanism to pass keyword values through to methods called
within the Init method. The
ExampleManip Init method does the following things:
1. Calls the Init method of the superclass, IDLitManipulator. Init method
keywords are specified as follows:
The TYPES keyword indicates the manipulator works on data that has the
iTool data type of
IDLIMAGE. Allowable values for the TYPES keyword
are those types returned by the GetTypes method of IDLitVisualization.
See “IDLitVisualization::GetTypes” (IDL Reference Guide) for details.
Note
You can also examine the IDLitVis* classes in the
lib/itools/framework subdirectory of the IDL installation directory.
The TYPE defined during the IDLitVisualization initialization defines the
visualization type. See “Predefined iTool Visualization Classes” on page 115
for the visualization type of each visualization class.
The NAME keyword identifies the manipulator. If the IDENTIFIER
keyword is not set, the manipulator’s identifier is created from the name.