static int disc(GEM_PLOTTER self,int x, int y, int radius, const plot_style_t * pstyle) { plotter_vdi_clip( self, 1); if( pstyle->fill_type != PLOT_OP_TYPE_SOLID) { vsf_rgbcolor( self->vdi_handle, pstyle->stroke_colour ); vsf_perimeter( self->vdi_handle, 1); vsf_interior( self->vdi_handle, 0 ); v_circle( self->vdi_handle, VIEW(self).x + x, VIEW(self).y + y, radius ); } else { vsf_rgbcolor( self->vdi_handle, pstyle->fill_colour ); vsf_perimeter( self->vdi_handle, 0); vsf_interior( self->vdi_handle, FIS_SOLID ); v_circle( self->vdi_handle, VIEW(self).x + x, VIEW(self).y + y, radius ); } plotter_vdi_clip( self, 0); return ( 1 ); }
int cdecl draw_pencil(PARMBLK *parmblk) { WEXTENSION_PENCIL *wext = (WEXTENSION_PENCIL *) parmblk->pb_parm ; int xy[8] ; int xc, yc ; xy[0] = parmblk->pb_x ; xy[1] = parmblk->pb_y ; xy[2] = parmblk->pb_x+parmblk->pb_w-1 ; xy[3] = parmblk->pb_y+parmblk->pb_h-1 ; vs_clip(handle, 1, xy) ; xc = (xy[0]+xy[2])/2 ; yc = (xy[1]+xy[3])/2 ; vswr_mode(handle, MD_REPLACE) ; vsf_interior(handle, FIS_SOLID) ; vsf_color(handle, 0) ; vr_recfl(handle, xy) ; vsf_color(handle, wext->pencil.color) ; switch( wext->pencil.type ) { case 0 : xy[0] = xc-wext->pencil.height/2 ; xy[1] = yc-wext->pencil.height/2 ; xy[2] = xc+wext->pencil.height/2 ; xy[3] = yc+wext->pencil.height/2 ; vr_recfl(handle, xy) ; break ; case 1 : v_circle(handle, xc, yc, wext->pencil.height/2) ; break ; case 2 : xy[0] = xc ; xy[1] = yc-wext->pencil.height/2 ; xy[2] = xc+wext->pencil.height/2 ; xy[3] = yc ; xy[4] = xc ; xy[5] = yc+wext->pencil.height/2 ; xy[6] = xc-wext->pencil.height/2 ; xy[7] = yc ; v_fillarea(handle, 4, xy) ; break ; } vs_clip(handle, 0, xy) ; return(0) ; }
/* draw the given set of points using a mark: this replaces v_pmarker, which is not implemented in fVDI on the Firebee 1 = dot, 2 = plus, 3 = star, 4 = square, 5 = cross, 6 = diamond Note: only 3-pt size used here. Not adjustable in line-chart. vsm_height can alter the size, for the built in pmarker. */ void my_pmarker (int app_handle, int point_style, int num_points, int * points) { int i; int s = 3; /* size of graphic to draw */ /* ensure line style solid, and fill type hollow */ vsl_type (app_handle, SOLID); vsf_interior (app_handle, 0); for (i = 0; i < num_points; i += 1) { int x = points[2*i]; int y = points[2*i+1]; int pxy[10]; switch (point_style) { case 1: /* dot */ v_circle (app_handle, x, y, 1); break; case 2: /* plus */ pxy[0] = x; pxy[1] = y-s; pxy[2] = x; pxy[3] = y+s; v_pline (app_handle, 2, pxy); pxy[0] = x-s; pxy[1] = y; pxy[2] = x+s; pxy[3] = y; v_pline (app_handle, 2, pxy); break; case 3: /* star */ pxy[0] = x; pxy[1] = y-s; pxy[2] = x; pxy[3] = y; pxy[4] = x-2*s/3; pxy[5] = y+s; v_pline (app_handle, 3, pxy); pxy[0] = x-s; pxy[1] = y-s; pxy[2] = x; pxy[3] = y; pxy[4] = x+2*s/3; pxy[5] = y+s; v_pline (app_handle, 3, pxy); pxy[0] = x+s; pxy[1] = y-s; pxy[2] = x; pxy[3] = y; v_pline (app_handle, 2, pxy); break; case 4: /* square */ pxy[0] = x-s; pxy[1] = y-s; pxy[2] = x+s; pxy[3] = y-s; pxy[4] = x+s; pxy[5] = y+s; pxy[6] = x-s; pxy[7] = y+s; pxy[8] = x-s; pxy[9] = y-s; v_fillarea (app_handle, 5, pxy); break; case 5: /* cross */ pxy[0] = x-s; pxy[1] = y-s; pxy[2] = x+s; pxy[3] = y+s; v_pline (app_handle, 2, pxy); pxy[0] = x+s; pxy[1] = y-s; pxy[2] = x-s; pxy[3] = y+s; v_pline (app_handle, 2, pxy); break; case 6: /* diamond */ pxy[0] = x; pxy[1] = y-s; pxy[2] = x-s; pxy[3] = y; pxy[4] = x; pxy[5] = y+s; pxy[6] = x+s; pxy[7] = y; pxy[8] = x; pxy[9] = y-s; v_fillarea (app_handle, 5, pxy); break; } } }