The constructor for a line is
Line::Line(View *view, int vis, double lx, double ly, double sx, double sy, COLOR col="black", double wid=0.0, double style=1.0, int arrow=0);The lx and ly parameters correspond to locations, and the sx and sy parameters correspond to sizes. Line sizes can be positive or negative. wid defines the width of the line; it can range from 0.0 to 1.0 (corresponding roughly to percentages). 0.0 corresponds to a thin line, and 1.0 corresponds to the thickest line. Currently, we have implemented three thicknesses that are achieved by values in the range 0.0 to 0.333, 0.333 to 0.667, and 0.667 to 1.0, respectively. style defines the line's style. It ranges from 0.0 to 1.0 also. We have implemented three styles: 0.0 to 0.333 defines a dotted line, 0.333 to 0.667 defines a dashed line, and 0.667 to 1.0 defines a solid line. col gives the color of the image (COLOR is typedef'ed to char*). It can be any valid X color name such as ``PeachPuff'' or it can be an RGB valued string such as ``#F7A305'' (this corresponds to the mapping ``#RRGGBB''). On a black and white monitor, colors may be implemented as a fill pattern. If vis is 0, the image is initially invisible. arrow designates an arrow style: 0 means no arrows, 1 means a forward arrow, 2 means a backward arrow, and 3 means a bi-directional arrow.
Rectangle
The constructor for a Rectangle follows:
Rectangle::Rectangle(View *view, int vis, double lx, double ly, double sx, double sy, COLOR c="black", double fill=0.0) ;Rectangles are located by their lower left corner, with only positive sizes ranging up and to the right allowed. The fill parameter is a value between 0.0 and 1.0. 0.0 corresponds to an unfilled outline (the background color shows through on the inside) and 1.0 corresponds to 100 per cent solid fill in the given object color. At in-between fill values, the object color is mixed with white to get intermediate shades, that is, no background color shows through. In reality, forty graduated fill patterns are actually implemented for these in between values. At 0.5, for example, the object color alternates with white on every other interior pixel.
Circle
The class definition for a Circle follows:
Circle::Circle(View *view, int vis, double lx, double ly, double rad, COLOR c="black", double fill=0.0);For circles, the location pair denotes the center of the circle, with the rad parameter defining the radius of the circle.
Ellipse
The class definition for an Ellipse follows:
Ellipse::Ellipse(View *view, int vis, double lx, double ly, double sx, double sy, COLOR c="black", double fill=0.0);For ellipses, the location pair identifies the ellipse's center. The sx and sy values denote the ellipse's radii in x and y respectively.
Polyline
The class definition for a Polyline follows:
Polyline::Polyline(View *view, int vis, double lx, double ly, int vert, double vtx[], double vty[], COLOR c="black", double wid=0.0, double style=1.0, int arrow=0);The location pair identifies the beginning vertex of the polyline. The value vert identifies the number of vertices on the polyline. There can be a maximum of 8. The arrays vtx and vty define the x and y relative offsets of the other polyline vertices from the location vertex given earlier, not from each other. The vertex identified by the lx, ly pair should not be included in these arrays, i.e., the arrays can be at most 7 elements. wid and style define the width and style of the polyline segments just as in the line image type. arrow works just as in a line. In a polyline, the arrow's forward direction is determined by direction of the last polyline edge that is non-negative (vice-versa for backward).
Spline
The constructor for a spline is a as follows:
Spline::Spline(View *view, int vis, double lx, double ly, int vert, double vx[], double vy[], COLOR c="black", double wid=0.0, double style=1.0);The location pair identifies the beginning control point of the spline. The value vert identifies the number of points on the spline. There can be a maximum of 8. The arrays vx and vy define the x and y relative offsets of the other spline points from the location point given earlier. The point identified by the lx, ly pair should not be included in these arrays, i.e., the arrays can be at most 7 elements. wid and style define the width and style of the spline just as in the line image type.
Polygon
The constructor for a Polygon is as follows:
Polygon::Polygon(View *view, int vis, double lx, double ly, int sides, double vx[], double vy[], COLOR c="black", double fill=0.0);The location pair identifies a vertex of the polygon. The value sides identifies the number of sides (or equivalently vertices) on the polygon. There can be a maximum of 8. The arrays vx and vy define the x and y relative offsets of the other polygon vertices from the location vertex given earlier. The vertex identified by the lx, ly pair should not be included in these arrays, i.e., the arrays can be at most 7 elements. Polygons can be concave or convex, but they should not be self-intersecting. fill gives the fill value of the polygon.
Pie
The constructor for a pie slice is as follows:
Pie::Pie(View *view, int vis, double lx, double ly, double rad, double begangle=0.0, double angledelta=1.0, char *col="black", double fill=1.0);The Pie AnimObject supports pie slices.The location pair defines the center of the pie and rad defines its radius. begangle defines the angle at which to begin drawing the slice. Angles start (0.0) from due east (just like radians in math) and they sweep out in a counter-clockwise fashion. The values 0.0 to 1.0 sweep out a complete circle. Note that outlines (fill=0.0) do not presently work correctly.
Text
The constructor for text is as follows:
Text::Text(View *view, int vis, double lx, double ly, COLOR col, const char *fname, const char *textstring, int center);The location pair identifies the lower left corner of where the text will be placed if the center parameter is 0, or the center location of where the text will be placed if the parameter is 1. The fname parameter tells what font should be used (if NULL, the default font is used), and the textstring parameter gives the text to be displayed. Note that only the actual text itself is drawn and colored in. That is, regions within the bounding box of the text, but not the actual characters, show through in the background color (transparent mode).
Bitmap
The constructor for a bitmap is as follows:
Bitmap::Bitmap(View *view, int vis, double lx, double ly, int width, int height, char data[], COLOR fg, COLOR bg);The location pair identifies the lower left corner of where the bitmap will be placed. The width and height specify their relative values (in pixels) of the bitmap. We use the X protocol for bitmap specification. The following data array is an array of chars, where each bit is 1-fg or 0-bg. The array data is an array of bytes with the low order bit of the array's first byte containing the leftmost pixel of the first row of the bitmap. This is the exact format of the X11 utility bitmap(1), so it is wise to use that tool to generate your data arrays. If you are on a color display, the bitmaps 1's will be drawn in the color fg and 0's in bg color. On black-and-whites these are black and white respectively. If for any reason POLKA was unable to create your bitmap (e.g., your width, height, and data were messed up), it will generate a clear white pixmap for subsequent use.
Set
The constructor for a set is as follows:
Set::Set(View *view, int num, AnimObject *objs[]);A set is a special kind of AnimObject that is simply a reference to a list of other AnimObjects. A set is useful for grouping AnimObjects together (e.g. , a rectangle, its outline, and a centered text name) and then programming and performing Actions on the set object to save time and space, such as moving that whole collection of objects around together. num identifies the number of objects in the following array parameter. Note that a set can be used as a parameter to another set creation. One particular AnimObject will only be thought of as being in a set once, however. (It really does work like a mathematical set.) If a member of a set is deleted, that's fine. Subsequent actions upon the set just won't even act like that object ever existed. The member elements of a set respond to Action programming just as they would if they weren't involved in the set. Any Actions performed on the set are simply performed in order upon the set element objects.