These pages are auto-generated from self-documenting comments embedded in class files.
For more information on breve and steve, refer to the breve homepage.

## Abstract : Drawing

This class is included as part of the file Drawing.tz.
To use this class in a simulation, include the line "@use Drawing."

### Class description:

> A basic class to draw custom images using polygons and lines.

### Class methods:

> Managing the list of drawing instructions

> - add-line-point
> - add-polygon-point
> - clear
> - draw-line
> - end-polygon
> - get-size
> - move
> - set-color
> - set-instruction-limit
> - set-line-style
> - set-line-width

`add-line-point at endPoint (vector)`

> Adds a line segment from the last point defined (by draw-line or add-line-point to endPoint.

`add-polygon-point at polygonPoint (vector)`

> Adds a polygon vertex at polygonPoint. Repeated calls to this method add vertices to the same polygon until no new points are added, or until the method end-polygon or the method draw-line is called.

> In order to accurately render a polygon, all of the points on the polygon must be coplanar. If the points do not lie on the same plane, visual artifacts may occur.

`clear`

> Clears the drawing by removing all of its instructions.

`draw-line from startPoint (vector) to endPoint (vector)`

> Adds a line segment from startPoint to endPoint.

`end-polygon`

> This method ends the polygon currently being drawn.

`get-size`

> Returns the current number of instructions in the drawing.

`move to location (vector)`

> Moves the entire drawing to location. Additional points and polygon vertices added to the drawing are still interpreted as relative to the drawing's origin.

`set-color to newColor (vector) with-transparency transparencyValue = 1.0 (float)`

> Changes this drawing's current color to newColor. The optional value transparencyValue specifies the transparency level between 0.0 (fully transparent) and 1.0 (fully opaque).

`set-instruction-limit to limit (int)`

> Limits to limit the number of instructions that may be added to the drawing. When instructions are added beyond the instruction limit, instructions will be removed from the beginning of the instruction list.

> This may be useful in creating drawings which act as arbitrarily long trails on objects. If no limit were used, the trail would consume more and more resources.

`set-line-style to lineStyle (string)`

> lineStyle is a string of 16 spaces and/or dashes which specify the line pattern to be drawn. A dotted line, for example, would use the pattern "- - - - - - - - ". A thickly dashed line would use the pattern "-------- ".

`set-line-width to lineWidth (double)`

> Specifies the width of the line to be drawn.

Documentation created Thu Jul 3 18:18:12 2008