Homework 2, CSE 490ra, Winter 2005
Due Tuesday, January 18, 11:59 am
Stroke counter
There is nothing inspired about this assignment - however, it will give you a chance to start exploring
the ink structures. You are to write an application that keeps track of the number of strokes, the
total length of strokes, and the number of connected components formed by the strokes. Below is a
screen shot of a sample solution.
- The clear button clears the ink, and resets the counters
- The stroke count gives the number of strokes since the last clear
- The length gives the sum of all of the stroke lengths since the last clear. You should convert the
units so that length is the actual length on the tablet.
- Components is the number of connected components.
Hints
- Start with the clear button.
- Add a storke event handler to the ink collector, so you do all your work when a stroke is completed
- You will need to break the stroke into packets to compute it length. You will also need to figure out the
correct normalization factor to use.
- Don't worry about efficiency on connected components unless you care to.
- Methods exist for finding intersections between strokes.
Creativity
Feel free to extend this. For example, it would be nice to color the connected components with different colors.
There is no requirement to reproduce
the sample solution exactly.
Submission
Submit a screen shot by the deadline by email to the instructor (anderson@cs.washington.edu).
Also, submit a zipped directory of your code, project files, and executable.