A SERVICE OF

logo

Appendix A: Controlling iTools from the IDL Command Line 395
iTool Developer’s Guide Replacing Data in an iTool
Note
If the currently-active iTool contains only one view, setting the VIEW_NEXT
keyword has the same effect as setting VIEW_NUMBER=1.
Using the SetData Method
You can replace the data that underlies a visualization using the SetData method of
the IDLitData class. This technique has the advantage of preserving other changes
you may have made to your visualization (property changes, etc.), but requires that
you first retrieve the object identifier for the data item you want to replace. This, in
turn, requires that you know the parameter name of the of the parameter that contains
the data.
Retrieving Parameter Names from the Visualization
To retrieve a list of parameter names for a visualization type, use the QueryParameter
method of the IDLitParameter class. The following example creates a plot
visualization and retrieves the names of the plot visualization’s registered parameters:
; Create the plot visualization
IPLOT, RANDOMU(seed, 15)
idTool = ITGETCURRENT(TOOL=oTool)
; Retrieve the object reference to the plot visualization object.
idPlot = oTool->FindIdentifiers('*plot', /VISUALIZATIONS)
oPlot = oTool->GetByIdentifier(idPlot)
; Retrieve and print the parameter names.
oPlotParams = oPlot->QueryParameter(COUNT=count)
For i=0,count-1 DO PRINT, oPlotParams[i]
IDL prints:
Y
X
VERTICES
Y ERROR
X ERROR
PALETTE
VERTEX_COLORS
Setting a New Data Value
Once you know the name of the parameter whose data you wish to change, retrieve
the IDLitData object associated with that parameter using the GetParameter method
of the IDLitParameter class. You can then use the SetData method of the IDLitData