World file contents

The world file is used to read in objects of various kinds and their attributes. The following is a description of what the i/o routines we provide expect within a world file. Note that while whitespace is necessary to differentiate between each of the parameters, the type of whitespace used (tabs, newlines, etc) is unimportant.

DrawColor

color { r g b }

r, g, b represent the red, green, blue components of a color. Must be between 0 and 255.

DrawPoint

point { c x y r }

c is the color of the point, of type DrawColor. x and y are the coordinate locations. r is the radius of the point.

DrawLine

line { c w pt1 pt2 }

c is the color of the line, of type DrawColor. w is the thickness of the line. pt1 and pt2 are the begin/end points of the line, of type DrawPoint.

DrawRectangle

rectangle { c s pt1 pt2 }

c is the color of the rectangle, of type DrawColor. s is t if the rectangle is filled, else f. pt1 and pt2 are the opposite corners of the rectangle, of type DrawPoint.

DrawEllipse

ellipse { c s r }

c is the color of the ellipse, of type DrawColor. s is t if the ellipse is filled, else f. r is the bounding rectangle, of type DrawRectangle.

DrawableObject

geometry { o p1 p2 p3… }

o is the origin of the object. Following that is a list of DrawingPrimitives (designated p1 p2 p3…). Note that it is possible to have a DrawableObject with only the origin.