=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/plot/plotp.c,v retrieving revision 1.16 retrieving revision 1.19 diff -u -p -r1.16 -r1.19 --- OpenXM_contrib2/asir2000/plot/plotp.c 2013/12/19 05:48:25 1.16 +++ OpenXM_contrib2/asir2000/plot/plotp.c 2014/06/27 07:58:29 1.19 @@ -45,7 +45,7 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/plot/plotp.c,v 1.15 2011/08/11 06:25:06 saito Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/plot/plotp.c,v 1.18 2014/05/13 20:02:40 ohara Exp $ */ #include "ca.h" #include "parse.h" @@ -80,7 +80,8 @@ void area_print(DISPLAY *display,double **tab,struct c int ix,iy,width,height,wc,**mask; XImage *image; DRAWABLE pix; - unsigned long color,black,white,c2; + unsigned int color,black,white,c2; + //unsigned long color,black,white,c2; double *px,*px1,*px2; //GXcode 0:new 1:cp 2:and 3:or 4:xor width=can->width; @@ -158,17 +159,17 @@ void over_print(DISPLAY *display,double **tab,struct c } #endif -void if_print(DISPLAY *display,double **tab,struct canvas *can,int cond){ +void if_printNG(DISPLAY *display,double **tab,struct canvas *can,int cond){ int ix,iy,width,height; double zst,zed,zsp; DRAWABLE pix; width=can->width; height=can->height; pix=can->pix; if(cond==0){ - //MODE_IFPLOTB + //IFPLOTB for(iy=0;iy0){ @@ -182,7 +183,72 @@ void if_print(DISPLAY *display,double **tab,struct can flush(); } -void if_printOld(DISPLAY *display,double **tab,struct canvas *can){ +void polar_print(DISPLAY *display,struct canvas *can){ + int len,i,j,x,y; + unsigned int color; + POINT *pa; + +#if defined(VISUAL) + HDC dc; + HPEN pen,oldpen; + len=can->pa[0].length; + color=can->color; + pa=can->pa[0].pos; + for(i=1;ipix,pen); + DRAWLINE(display,can->pix,drawGC,XC(pa[j]),YC(pa[j]),XC(pa[i]),YC(pa[i])); + SelectObject(can->pix,oldpen); + + dc = GetDC(can->hwnd); + oldpen = SelectObject(dc,pen); + DRAWLINE(display,dc,drawGC,XC(pa[j]),YC(pa[j]),XC(pa[i]),YC(pa[i])); + SelectObject(dc,oldpen); + ReleaseDC(can->hwnd,dc); + + DeleteObject(pen); + } else { + DRAWLINE(display,can->pix,drawGC,XC(pa[j]),YC(pa[j]),XC(pa[i]),YC(pa[i])); + dc = GetDC(can->hwnd); + DRAWLINE(display,dc,drawGC,XC(pa[j]),YC(pa[j]),XC(pa[i]),YC(pa[i])); + ReleaseDC(can->hwnd,dc); + } + } +#else + len=can->pa[0].length; + color=can->color; + pa=can->pa[0].pos; + for(i=1;ipix,cdrawGC,XC(pa[j]),YC(pa[j]),XC(pa[i]),YC(pa[i])); + } + XFlush(display); +#endif +} + + +void if_print(DISPLAY *display,double **tab,struct canvas *can){ + int ix,iy,width,height; + double *px,*px1,*px2; + DRAWABLE pix; + + if ( can->mode == modeNO(CONPLOT) ) { + con_print(display,tab,can); return; + } + flush(); + width = can->width; height = can->height; pix = can->pix; + for( ix=0; ix= 0) && ((*px1 <= 0) || (*px2 <= 0))) || + ((*px <= 0) && ((*px1 >= 0) || (*px2 >= 0))) ) { + DRAWPOINT(display,pix,cdrawGC,ix,height-iy-1); + count_and_flush(); + } + flush(); +/* int i,ix,iy,width,height; double *px,*px1,*px2; double **vmax,**vmin,*zst,zstep,zv,u,l; @@ -190,7 +256,7 @@ void if_printOld(DISPLAY *display,double **tab,struct POINT *pa,*pa1; struct pa *parray; - if(can->mode==MODE_CONPLOT){ + if(can->mode==modeNO(CONPLOT)){ width=can->width;height=can->height;pix=can->pix; //con_print(display,tab,can); // calc all cell max,min value @@ -236,6 +302,7 @@ void if_printOld(DISPLAY *display,double **tab,struct } } flush(); +*/ } #define MEMORY_DRAWPOINT(a,len,x,y) (((a)[(len)*(y)+((x)>>3)]) |= (1<<((x)&7))) @@ -245,7 +312,7 @@ void memory_if_print(double **tab,struct canvas *can,B double *px,*px1,*px2; unsigned char *array; int scan_len; - if ( can->mode == MODE_CONPLOT ){ + if ( can->mode==modeNO(CONPLOT)){ memory_con_print(tab,can,bytes); return; } @@ -358,7 +425,7 @@ void memory_print(struct canvas *can,BYTEARRAY *bytes) /* scan_len = byte length of the scan line */ scan_len = (can->width+7)/8; MKBYTEARRAY(*bytes,scan_len*can->height); - array = BDY(*bytes); + array = (char*)BDY(*bytes); len = can->pa[0].length; pa = can->pa[0].pos; @@ -402,7 +469,8 @@ void plot_print(DISPLAY *display,struct canvas *can){ #endif } -void draw_point(DISPLAY *display,struct canvas *can,int x,int y,int color){ +void draw_point(DISPLAY *display,struct canvas *can,int x,int y,unsigned int color){ +//void draw_point(DISPLAY *display,struct canvas *can,int x,int y,int color){ #if defined(VISUAL) HDC dc; @@ -419,7 +487,8 @@ void draw_point(DISPLAY *display,struct canvas *can,in } void draw_line( - DISPLAY *display,struct canvas *can,int x,int y,int u,int v,int color){ + DISPLAY *display,struct canvas *can,int x,int y,int u,int v,unsigned int color){ + //DISPLAY *display,struct canvas *can,int x,int y,int u,int v,int color){ #if defined(VISUAL) HDC dc; HPEN pen,oldpen; @@ -452,7 +521,8 @@ void draw_line( } void draw_character_string( - DISPLAY *display,struct canvas *can,int x,int y,char *str,int color){ + DISPLAY *display,struct canvas *can,int x,int y,char *str,unsigned int color){ + //DISPLAY *display,struct canvas *can,int x,int y,char *str,int color){ #if defined(VISUAL) HDC dc; COLORREF oldcolor; @@ -490,9 +560,9 @@ void pline(DISPLAY *display,struct canvas *can,DRAWABL double adjust_scale(); /* XXX : should be cleaned up */ - if ( can->noaxis || (can->mode == MODE_PLOT && !can->pa) ) + if ( can->noaxis || (can->mode==modeNO(PLOT)&& !can->pa) ) return; - if ( can->mode == MODE_INTERACTIVE ) + if ( can->mode==modeNO(INTERACTIVE)) return; xadj = yadj = 0;