SampledCurveEditDoc.tioga
Copyright Ó 1992 by Xerox Corporation. All rights reserved.
Michael Plass, July 1, 1992 10:53 am PDT
SampledCurveEdit
CEDAR 10.1 FOR INTERNAL XEROX USE ONLY
SampledCurveEdit
Michael Plass
Ó Copyright 1992 Xerox Corporation. All rights reserved.
Abstract: SampledCurveEdit is a simple editor for sampled curves - that is, 2-d polygons and polylines that may have many vertices. It was the predecessor of the DrawCurve tool.
Created by: Michael Plass
Maintained by: Michael Plass:PARC:Xerox
Keywords: Curves, Editors, Graphics, Illustrators
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
The SampledCurveEdit Viewer
Overview of Operation
The DrawCurve tool is designed to allow the entry of free form curves, represented as polylines with many vertices. The primary modes of interaction are sketching, moving, pulling, resampling, and filtering.
Getting started
The SampledCurveEdit command takes one optional argument, the filename of a SampledCurveEdit-format file.
The Rotate and Scale menu buttons, and the horizontal and vertical scrollbars, may be used to move the view around; these don't affect the coordinate system that the data is in.
The menu buttons are
Clear Refresh Save Store Smooth Reverse Delete
Most of these are pretty obvious. The Smooth and Delete buttons work on the current selection, and are both accessible via the keybord (see below), which is usually the more convenient way to invoke them. The Reverse button reversed the order of the samples, which will not be very evident except when the data is written to a file.
To sketch a curve, hold down the shift key and draw with the left mouse button. The right mouse button (with shift down) may be used to extend the current curve, and the shift-middle may be used to move a single point around without having to select it first.
To select a range of samples, left-click at one end and right-click at the other (sorry, dragging the mouse aroud with the right button down does not really do what you want).
To edit a different curve, click near it with the middle mouse button.
Keyboard operations
DEL => Delete selected points (same as Delete button)
S (any case) => Smooth (low-pass-filter) selected points (same as Smooth button)
T (any case) => T-Square - force selected points into a vertical or horizontal line.
v (lower case) => Mark selected points as corners - they will not be moved by Smooth operation.
V (upper case) => Remove corner marking.
C (any case) => Copy selected points, amking a new trajectory.
d (lower case) => Double - double the number of points in the selection by resampling.
D (upper case)=> UnDouble - discard every other points in the selection.
b (lower case) => Break - break the trajectory into pieces.
Advanced mousing
CNTL-middle will move (drag) the selected points around.
TAB-middle (using TAB like a shift key) will move "pulling" the selected points around, keeping the endpoints fixed, in a way that locally preserves the "shape" of the curve.
For those of you that stayed awake during a complex-analysis class, this is doing a bilinear transformation of the points. If you don't understand what this means, that's OK - just play with it and you'll probably get enough of an idea what's going on to make some use of it.
The SampledCurveEdit Client Interface
There is a client interface for dealing with samples - there is not, however, a mechanism for adding UI for them.
File Format
The file format is an ascii file, with postfix operators.
SampledCurveEditImpl
If you are interested in building tools, you may want to look at the way SampledCurveEditImpl is put together. It is written as one module, and not a terrifically large one, so it is probably a little easier to understand than your average editor.
All requests get placed into an action queue, and all the editing and redisplay happens in a single thread. The queued operations get optimized, so that unnecessary redisplay operations get skipped.
BUGS
There's not really any undo.
The UI is not especially coherent.
The Store button does not provide a working directory.
This program was written many years (about 8 years, as far as I can figure) before I got around to writing some documentation so I could release it, so the documentation is probably incomplete.