In this example, we create a macro to add drop shadows to graphical objects. We might not realize there is a need for this function until we execute the steps once for the oval labeled "GENERATOR" in the first (blue) panel on the left. Then we review the history (second yellow panel), and select out the four steps that created the drop shadow. Now we don't want the steps to always be applied to the same graphical object and use the same color for the drop shadows, so we parameterize the macro - defining a first argument called "object" and a second argument called "color". The parameterization is shown in the third (green) panel on the left.
There are many possible semantic interpretations for the actions that have been performed in the history, and it is necessary to generalize these steps to turn them into a useful macro. We have built an inference engine that identifies the most likely interpretations for the various actions that can be performed in the editor. However, these can be overridden. The fourth (yellow) panel shows the generalizations for one of steps in the macro (moving the copied object over to a new location). The system correctly infers, for example, that the object to be moved is the result of the copy (in the third history panel) and the movement is a relative one rather than an absolute one.
The macro is next named and saved, and then it can be applied to other objects in the scene. The fifth (purple) panel shows a dialog for setting the arguments, which we had specified during the earlier parametrization step. We can select an object in the scene and set it to be the first argument, and specify a color for the second argument. We try this on several different kind of objects in the scene, and the results are shown in the last (pink) panel on the left.
It is certainly possible to make a mistake while defining a macro, but the visual representation of a macro is based upon editable graphical histories, and the macro can be edited in place, in the macro window. In fact, in defining this macro we first made a mistake and did not change the line-color of the drop shadow - only the fill-color. However, since the histories and macros are editable it was simple to correct.
|