Chapter 3. Tutorial II: Editing and Creating Visual Programs
Partial Table-of-Contents
This tutorial will show you how to modify existing visual programs and
create new ones.
In the process, it will also introduce you to a number of the most
commonly used modules.
As you become more experienced using Data Explorer, you can explore more of
each module's many options.
Tutorial II Visual
Programs |
---|
|
3.1 Editing a Visual Program: The Basics
When you open the Visual Program Editor (VPE) with the
dx -edit
command,
or by choosing New Visual Program in the Startup
window,
you will see a large blank area (the "canvas")
and two "palettes" to its left (see Figure
4).
The palette at top lists "categories" of tools
(modules).
The palette below it lists the tools in the currently selected
(highlighted) category.
Selecting tools and placing icons
- Click on a tool category (e.g., Transformation) in
the
upper palette.
The tools in that category are now listed in the lower palette.
- Click on a tool in the lower palette (e.g.,
AutoColor) to
highlight it.
- Move the cursor into the canvas area.
Note that it becomes an inverted "L."
- Position the cursor at the point where you want the tool icon to
appear and click again to generate the icon.
Tool icons
Each tool icon has one or more tabs on top and bottom.
These tabs represent, respectively, input(s) to the tool module and
output(s) from it.
There are two ways to specify an input:
- by specifying a value in the configuration dialog box associated
with a particular tool
- with an arc, or line, connecting the output tab of one icon to the
input tab of another.
Specifying inputs: configuration dialog boxes
To open the configuration dialog box for a tool, either:
- Double click on the tool icon in the canvas, or
- Single click on (highlight) the tool icon in the canvas and select
"Configuration" from the Edit pull-down menu.
In the case of interactors, color maps, the Image tool, and the
Sequencer, the first procedure invokes a "control box"
(another kind of dialog box).
The second procedure always invokes a configuration
dialog box.
Tabs and inputs to a tool module
| Each input parameter in the configuration dialog box corresponds
to an upper tab on the tool icon.
The leftmost tab corresponds to the first parameter, and so on.
|
Visible versus hidden parameters
| At the bottom of the dialog box are
Expand and
Collapse buttons.
The first button "expands" the dialog box, displaying
additional parameters.
The second button "collapses" the dialog box, hiding every
parameter whose "Hide" toggle button is activated.
(When a tool has no hidden parameters, both buttons are disabled, as
indicated by their gray labels.)
|
Specifying inputs: arcs and icons
A visual program is a "network" of interconnected
tool modules.
In the VPE window, this network is represented as a set of tool icons
connected to one another by lines ("arcs") representing the data
(Figure 4 in Tutorial I shows such a
network.)
Connecting tool icons with arcs
|
- Position the cursor on an output tab of an icon and
hold down the left mouse button:
the cursor becomes a downward-pointing arrow, and a parameter or data
name for that tab appears on the icon.
- Drag the cursor to another icon:
the output tab remains connected to the cursor by a highlighted line
(arc).
If the connection is valid, the input tab(s) will be highlighted when
the cursor arrow touches the icon.
(If the connection is invalid, the tab(s) will not be highlighted, and
an error message will appear.
- Release the mouse button to establish a connection to a valid
input tab.
Notes:
- If the "receiving" icon has two or more valid input tabs, if
you release the mouse button when the cursor is on the main part
of the icon, the connection to the first (leftmost) tab
is automatic.
To establish a connection to a different tab requires
placing the cursor on that tab before releasing the
mouse button.
- You can establish a connection starting with an input tab and
dragging the arc to an output tab.
|
Disconnecting or moving an arc
| Click on the input tab to which the arc is connected
(e.g., the input tab on Sequencer):
a highlighted arc, connected to an (Import) output tab appears:
- Disconnect the arc by dragging the cursor to an empty spot in the
canvas and releasing the mouse button, or
- Move the arc by dragging it to another icon and releasing the
mouse button to establish the new connection.
|
Deleting a tool icon
- Highlight the tool icon by clicking on it.
- Select Delete in the
Edit
pull-down menu. .
Moving a tool icon
Select a tool icon and drag it to the desired location before
releasing the mouse button.