Drawing Graphics: 2 Shapes

Up: GEOS SDK TechDocs| Up | Down | Prev: 1 Drawing Goals | Next: 3 Shape Attributes

Depending on how much experience you have with the GEOS graphics system, you may have some idea already about what sorts of shapes can be drawn and the ways to draw them. Most of these commands have names like GrDrawShape() or GrFillShape() (e.g. GrDrawRect() , GrFillEllipse() ). Normally, a command of the form GrDrawShape() draws the outline of a shape, while GrFillShape() fills in the interior of the shape. Commands with names like GrSetAttribute() (e.g. GrSetAreaColor() ) change the color, fill pattern, and other attributes of shapes to be drawn. Most of these commands are passed a GState. The drawing commands are also passed coordinates at which to draw.

For many of these commands, there are GString opcodes which represent the command in a GString. Also, the arguments used when drawing these shapes often correspond to instance data specific to the Graphic Object which draws that shape.

Most of these routines work with standard coordinates, measured in typographer's points. For geodes that need to make drawings which are precise to a fraction of a point, four routines have been set up to use WWFixed coordinates, and are thus accurate to a fraction of a point. These routines are GrDrawRelLineTo() , GrRelMoveTo() , GrDrawRelCurveTo() , and GrDrawRelArc3PointTo() . Geodes may use these routines to draw the outline of any conceivable two-dimensional shape. To create a precise, filled shape, use these routines to describe a path and then fill the path.


Up: GEOS SDK TechDocs| Up | Down | Prev: 1 Drawing Goals | Next: 3 Shape Attributes