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

Class description:

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

Methods:

  • addLinePoint
  • addPolygonPoint
  • clear
  • drawLine
  • endPolygon
  • getSize
  • move
  • setColor
  • setInstructionLimit
  • setLineStyle
  • setLineWidth
    addLinePoint( self, endPoint )

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


    addPolygonPoint( self, polygonPoint )

    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( self )

    Clears the drawing by removing all of its instructions.


    drawLine( self, startPoint, endPoint )

    Adds a line segment from startPoint to endPoint.


    endPolygon( self )

    This method ends the polygon currently being drawn.


    getSize( self )

    Returns the current number of instructions in the drawing.


    move( self, location )

    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.


    setColor( self, newColor, transparencyValue )

    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).


    setInstructionLimit( self, limit )

    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.


    setLineStyle( self, lineStyle )

    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 "-------- ".


    setLineWidth( self, lineWidth )

    Specifies the width of the line to be drawn.