A SERVICE OF

logo

Chapter 6: Creating a Visualization 143
iTool Developer’s Guide Example: Image-Contour Visualization
END
; The method was called with an image array as the argument.
'IMAGEPIXELS': BEGIN
void = self._oImage->SetData(oSubject, $
PARAMETER_NAME = 'IMAGEPIXELS')
void = self._oContour->SetData(oSubject, $
PARAMETER_NAME = 'Z')
; Make our contour appear at the top of the surface.
IF (oSubject->GetData(zdata)) THEN $
self._oContour->SetProperty, ZVALUE = MAX(zdata)
END
; The method was called with a palette as the argument.
'PALETTE': BEGIN
void = self._oImage->SetData(oSubject, $
PARAMETER_NAME = 'PALETTE')
void = self._oContour->SetData(oSubject, $
PARAMETER_NAME = 'PALETTE')
END
ELSE: ; DO nothing
ENDCASE
END
Discussion
The OnDataChangeUpdate method accepts the two required arguments: an object
reference to the data object whose data has changed (
oSubject), and a string
containing the name of the parameter associated with the data object (
parmName).
We use a CASE statement to determine which parameter has been modified, and
process the data as appropriate. We first handle the special case where the parameter
has the value
<PARAMETER SET> by looping through all of the parameters in the
parameter set object, calling the OnDataChangeUpdate method again on each
parameter.
We handle the
IMAGEPIXELS parameter by calling the IDLitParameter::SetData
method once on each of the two component visualizations, specifying that the input
data object
oSubject corresponds to the IMAGEPIXELS parameter of the
IDLitVisImage object, and to the
Z parameter of the IDLitVisContour object. We
also set the Z value of the IDLitVisContour object using the maximum data value of
the data contained in
oSubject.