Overview of iTool Programmatic Control
The iTool framework is designed to let you create tools that are used interactively, in real time. Furthermore, one of the main goals of the iTools framework is to make it easier to create a standard graphical user interface that allows end-users to manipulate tools using a mouse and keyboard.
Still, it may be useful and convenient at times to control iTools programmatically, from the IDL command line or in more traditional routines that do not rely heavily on framework programming. For example, you may want to write a simple IDL batch file that creates a visualization, manipulates it in various ways, and exports an image file containing the result.
While complete control over an existing iTool is difficult from "outside" the tool itself, this appendix describes techniques that allow you to control many features of a tool using a small number of framework methods and procedural helper routines. Controlling an iTool using the techniques described here requires a basic familiarity with iTool concepts including property management, operations, and iTool object identifiers. It also departs from purely procedural techniques in that it requires the use of object method calls, albeit at a very basic level.
How to Control an iTool
To control an existing iTool from the IDL command line (and by extension, from within non-iTool routines invoked at the IDL command line), you will do the following things:
- Use the IGETCURRENT function to retrieve the object reference to an existing iTool.
- Use the tool object's FindIdentifiers method to retrieve the iTool identifiers of visualizations you wish to alter and operations you wish to execute.
- Use the tool object's DoSetProperty method to change properties of visualizations or operations.
- Use the visualization object's Select method to ensure that the proper items are selected, if necessary.
- Use the tool object's DoAction method to execute operations.
- Use the tool object's CommitActions method to commit the changes to the tool's undo/redo buffer, if necessary.
These steps are described in detail in the following sections.