The Match Tool Tutorial Eric Bier 1. Introduction 1.1 Getting Started Start up Gargoyle (see GargoyleDoc.tioga for details). Then, in a CommandTool, type PushV Commands; Bringover -pm MatchTool.df; Pop MatchTool If MatchTool complains that you must "Invoke a gargoyle viewer first." type "Gargoyle" to the CommandTool once more, followed by "MatchTool". The newly created Gargoyle viewer will share its control panel with the MatchTool. None of the others will. 1.2 Introductory Hints For the most part, using the MatchTool is like using the EditTool. However, graphical matching does differ from textual matching in a number of respects, and these tend to cause trouble. When a graphical match occurs, the MatchTool notices the position, orientation, and size differences between the search pattern and the matched scene object. These same differences are then applied to the replacement pattern if a replacement is performed. Hence, where the replacement ends up in the picture depends both on the position of the search pattern in the Search window and on the position of the replacement pattern in the Replace window. If BiScrollers have been used to look at one part of the Search window and a different part of the Replace window, unexpected pictures often result. To keep this from happening, create both your search pattern and your replacement pattern in the same window, so you know how the two patterns relate to each other, and then Fetch them into the MatchTool panes. This and other techniques will be illustrated in the Exercises. Both of the panes of the MatchTool are Gargoyle action areas. All Gargoyle mouse and keyboard commands work in them as usual. However, the MatchTool panes have no control panel of their own. They share the control panel of the Gargoyle viewer with which the MatchTool is associated. This sharing is not complete. The menu commands do not apply to the MatchTool panes. Only the alignment object menus and gravity modes apply. The history/undo tools are not shared. Someday this sharing will be improved. When the MatchTool is searching in a Gargoyle viewer, it expects that Gargoyle viewer to have the input focus. If this is not the case, strange things may happen. 2. Exercises 2.1 Triangle Subdivision Place the caret in the Gargoyle viewer that is associated with the MatchTool (see section 1.1). Click "Triangle" in the Shapes Menu. In the MatchTool, click the leftmost Fetch button (right above the word CHARACTERISTICS). You may need to put the input focus back in the Gargoyle viewer (ShiftLeftMouse will do this). Probably nothing visual will happen. You have fetched the triangle into the Search pane of the MatchTool, but it is off the screen. Click the CenterSel button to the right of Fetch in the MatchTool. You should now see the triangle. You have specified the search pattern. In Gargoyle build the following picture so that its three extreme vertices coincide to the vertices of the original triangle (each of these new triangles has half the edge-length of the original): Select these three triangles (and nothing else) and click the rightmost Fetch button on the MatchTool. Then hit the rightmost CenterSel button in the MatchTool. The three triangles should appear in the Replace pane of the MatchTool. In the set of options near the right edge of the MatchTool, turn on "ScaleInv". This allows the MatchTool to search for triangles regardless of size. You have specified the replacement pattern. Back in Gargoyle, delete everything but a single triangle. Scale it up (Gargoyle scale, not BiScrollers Scale) to almost fill the viewer. You have specified the starting illustration. It is time to try searching and replacing. In Gargoyle, deselect everything (LeftMouse in empty space) and place the caret above the triangle (ShiftLeftMouse). In the MatchTool, click Find. The triangle will become selected and the caret will move down to be at the same height as the top of the triangle. In the MatchTool, click Yes. Your triangle should be replaced by three triangles. Again, place your caret above all of the triangles in Gargoyle and click Find in the MatchTool. In the MatchTool, click Yes three times. Each of the three triangles should be replaced by three more triangles. Again, place your caret above all of the triangles. This time, click ChangeAll in the MatchTool. You should now have a picture that looks like this: Experiment further. Place the caret at an intermediate height and do a few Finds. Notice that the MatchTool finds the first triangle at that height or below. Try clicking the Find button with the Right mouse button a few times. Now the search goes up from the caret position. If you Middle-click ChangeAll the caret is automatically moved above all shapes before substitution begins, so all shapes participate in the search. Otherwise, only the shapes below the caret participate in the search. If you make a mistake, you will want to clear the Search and Replace areas of the MatchTool and try again. You can do this by placing the input focus in these areas (LeftMouse will do) and using CTRL-D followed by DEL. MatchToolTutorial.tioga Copyright 1988 by Xerox Corporation. All rights reserved. Bier, November 14, 1987 11:13:28 pm PST Pier, August 19, 1988 6:23:42 pm PDT [Artwork node; type 'Artwork on' to command tool] [Artwork node; type 'Artwork on' to command tool] 2defaultIcodewI V0>w0>wI V0>w V Vs  ss  sSs SSs Skkg Interpress90.0 mm xmin 0.0 mm ymin 69.05518 mm xmax 59.9926 mm ymax 62.81483 mm topLeading 62.81483 mm topIndent 1.411111 mm bottomLeading 0.5 0.3 0.95 backgroundColor the topLeading 6 pt .sub backgroundAscent 3 pt backgroundDescent 4 pt outlineBoxThickness 1 pt outlineBoxBearoff3Gargoyle file for scene: stuffed from Gargoyle at November 14, 1987 10:51:23 pm PST Produced by version 8710.19 Scripts: ///Users/Bier.pa/Gargoyle/bier871114-22-46-01.script Slope: [F 0.0] [F 30.0] [F 45.0] [F 60.0] [F 90.0] [F 120.0] [F 135.0] [F 150.0] Angle: [F -90.0] [F -60.0] [F -45.0] [F -30.0] [F 0.0] [F 30.0] [F 45.0] [F 60.0] [F 90.0] Radius: [F 4.0 4] [F 2.0 2] [F 1.0 1] [F 0.75 3/4] [F 0.6666667 2/3] [F 0.5 1/2] [F 0.3333333 1/3] [F 0.25 1/4] [F 0.125 1/8] [F 0.1111111 1/9] [F 5.555556e-2 1/18] LineDistance: [F 1.0 1] [F 0.5 1/2] [F 0.1111111 1/9] [F 5.555556e-2 1/18] [F 0.0 0] Midpoints: T Heuristics: T ShowAlignments: T ShowColors: F ScaleUnit: 72.0 DisplayStyle: print Gravity: T GravityExtent: 0.3472222 GravityType: pointsPreferred DefaultFont: xerox/pressfonts/Helvetica-mrr [r1: 0.0 s: [12.0 12.0] r2: 0.0] 1.0 1.0 Defaults: [1 0.5] [1 1.0] 2.0 round round Dashed: F Shadows: []F Anchor: T [-167.0,-145.0] Entities: [27]: Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-143.0316,-145.0] (Line ) [-155.0158,-124.2428] (Line ) [-167.0,-145.0] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-131.0474,-124.2428] (Line ) [-143.0316,-103.4856] (Line ) [-155.0158,-124.2428] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-119.0633,-145.0] (Line ) [-131.0474,-124.2428] (Line ) [-143.0316,-145.0] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-119.0632,-103.4856] (Line ) [-131.0474,-82.72834] (Line ) [-143.0316,-103.4856] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-107.0791,-82.72834] (Line ) [-119.0632,-61.97112] (Line ) [-131.0474,-82.72834] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-95.09488,-103.4856] (Line ) [-107.0791,-82.72834] (Line ) [-119.0632,-103.4856] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-95.09489,-145.0] (Line ) [-107.0791,-124.2428] (Line ) [-119.0633,-145.0] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-83.1107,-124.2428] (Line ) [-95.09488,-103.4856] (Line ) [-107.0791,-124.2428] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-71.12651,-145.0] (Line ) [-83.1107,-124.2428] (Line ) [-95.09489,-145.0] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-95.09486,-61.97112] (Line ) [-107.079,-41.2139] (Line ) [-119.0632,-61.97112] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-83.11067,-41.2139] (Line ) [-95.09485,-20.45668] (Line ) [-107.079,-41.2139] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-71.1265,-61.97112] (Line ) [-83.11067,-41.2139] (Line ) [-95.09486,-61.97112] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-71.12648,-20.45667] (Line ) [-83.11066,0.3005447] (Line ) [-95.09485,-20.45667] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-59.1423,0.3005447] (Line ) [-71.12648,21.05777] (Line ) [-83.11066,0.3005447] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-47.15811,-20.45667] (Line ) [-59.1423,0.3005447] (Line ) [-71.12648,-20.45667] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-47.15811,-61.97112] (Line ) [-59.14229,-41.2139] (Line ) [-71.12648,-61.97112] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-35.17392,-41.2139] (Line ) [-47.1581,-20.45668] (Line ) [-59.14229,-41.2139] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-23.18974,-61.97112] (Line ) [-35.17392,-41.2139] (Line ) [-47.15811,-61.97112] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-47.15812,-145.0] (Line ) [-59.1423,-124.2428] (Line ) [-71.1265,-145.0] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-35.17394,-124.2428] (Line ) [-47.15812,-103.4856] (Line ) [-59.1423,-124.2428] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-23.18975,-145.0] (Line ) [-35.17394,-124.2428] (Line ) [-47.15812,-145.0] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-23.18974,-103.4856] (Line ) [-35.17393,-82.72834] (Line ) [-47.15812,-103.4856] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [-11.20556,-82.72834] (Line ) [-23.18974,-61.97112] (Line ) [-35.17393,-82.72834] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [0.7786255,-103.4856] (Line ) [-11.20556,-82.72834] (Line ) [-23.18974,-103.4856] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [0.7786179,-145.0] (Line ) [-11.20557,-124.2428] (Line ) [-23.18975,-145.0] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [12.7628,-124.2428] (Line ) [0.7786179,-103.4856] (Line ) [-11.20557,-124.2428] (Line ) Outline fillColor: [1 0.5] Trajectories: [1] Traj (fence) [2] arrows: 0 j: round e: T round w: 2.0 c: T [1 1.0] d: T F [24.74699,-145.0] (Line ) [12.7628,-124.2428] (Line ) [0.7786179,-145.0] (Line ) 33PPko &G