Figure 3 Drawing a Filled Rectangle with GraphX

#DEFINE SOLID 0.0

/* Draw a bar from (x1,y1) to (x2,y2) */
void draw_bar(x1,y1,x2,y2)
double x1,y1,x2,y2;
{
   POLYMATRIX *pm;
   POLYLIST *pl;
   short *ea;

   /*  Open polygon */
   DPOLY(0,0,0,0,0);
   /*  Insert vertices 1 thru 4 */
   DVERTEX(x1, y1, 0);
   DVERTEX(x1, y2, 0);
   DVERTEX(x2, y2, 0);
   DVERTEX(x2, y1, 0);
   /*  Close current polygon */
   pl = DENDPOLY(0);
   /*  Fetch matrix of polygon vertices */
   pm = DMATRIXP(pl, &ea);
   /*  Draw the polygon */
   DDRAW(pl,1,0);
   /*  Fill the polygon */
   DFILLP(pm, SOLID, 0, 1);
   /*  Recover allocate matrix & edge list */
   DKILLM(pm, ea);
}