=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/plot/plotp.c,v retrieving revision 1.17 retrieving revision 1.22 diff -u -p -r1.17 -r1.22 --- OpenXM_contrib2/asir2000/plot/plotp.c 2014/05/12 16:54:41 1.17 +++ OpenXM_contrib2/asir2000/plot/plotp.c 2015/08/06 10:01:53 1.22 @@ -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.16 2013/12/19 05:48:25 saito Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/plot/plotp.c,v 1.21 2014/08/20 16:51:34 ohara Exp $ */ #include "ca.h" #include "parse.h" @@ -59,11 +59,12 @@ #define EXP10(a) pow(10.0,a) #endif -#if defined(VISUAL) +#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) static POINT oldpos; #endif -#if defined(INTERVAL) +#if !defined(VISUAL) && !defined(__MINGW32__) && !defined(__MINGW64__) +extern Pixel BackPixel; unsigned long GetColor(Display *, char *); unsigned long GetColor(Display *dis, char *color_name) @@ -80,7 +81,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; @@ -137,6 +139,11 @@ void area_print(DISPLAY *display,double **tab,struct c count_and_flush(); flush(); } +#else +void area_print(DISPLAY *display,double **tab,struct canvas *can,int GXcode){ + /* not implemented */ +} +#endif void over_print(DISPLAY *display,double **tab,struct canvas *can,int GXcode){ int ix,iy,width,height; @@ -156,9 +163,8 @@ void over_print(DISPLAY *display,double **tab,struct c } flush(); } -#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; @@ -183,15 +189,16 @@ void if_print(DISPLAY *display,double **tab,struct can } void polar_print(DISPLAY *display,struct canvas *can){ - int len,color,i,j,x,y; + int len,i,j,x,y; + unsigned int color; POINT *pa; +#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) + HDC dc; + HPEN pen,oldpen; len=can->pa[0].length; color=can->color; pa=can->pa[0].pos; -#if defined(VISUAL) - HDC dc; - HPEN pen,oldpen; for(i=1;ipa[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])); @@ -224,7 +234,26 @@ void polar_print(DISPLAY *display,struct canvas *can){ } -void if_printOld(DISPLAY *display,double **tab,struct canvas *can){ +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; @@ -278,6 +307,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))) @@ -429,7 +459,7 @@ void plot_print(DISPLAY *display,struct canvas *can){ int len; POINT *pa; -#if defined(VISUAL) +#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) len = can->pa[0].length; pa = can->pa[0].pos; @@ -444,8 +474,9 @@ void plot_print(DISPLAY *display,struct canvas *can){ #endif } -void draw_point(DISPLAY *display,struct canvas *can,int x,int y,int color){ -#if defined(VISUAL) +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) || defined(__MINGW32__) || defined(__MINGW64__) HDC dc; SetPixel(can->pix,x,y,(COLORREF)color); @@ -461,8 +492,9 @@ 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){ -#if defined(VISUAL) + 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) || defined(__MINGW32__) || defined(__MINGW64__) HDC dc; HPEN pen,oldpen; @@ -494,8 +526,9 @@ void draw_line( } void draw_character_string( - DISPLAY *display,struct canvas *can,int x,int y,char *str,int color){ -#if defined(VISUAL) + 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) || defined(__MINGW32__) || defined(__MINGW64__) HDC dc; COLORREF oldcolor; @@ -573,7 +606,7 @@ void pline(DISPLAY *display,struct canvas *can,DRAWABL DRAWLINE(display,d,drawGC,x0,y,x0+D,y); sprintf(buf,"%g",n*e); if ( can->xmax <= 0 ) { -#if !defined(VISUAL) +#if !defined(VISUAL) && !defined(__MINGW32__) && !defined(__MINGW64__) xadj = TEXTWIDTH(sffs,buf,strlen(buf)); #else SIZE size; @@ -601,7 +634,7 @@ double adjust_scale(double e,double w){ } void initmarker(struct canvas *can,char *message){ -#if defined(VISUAL) +#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) can->real_can->percentage = 0; can->real_can->prefix = message; #else @@ -612,7 +645,7 @@ void initmarker(struct canvas *can,char *message){ } void marker(struct canvas *can,int dir,int p){ -#if defined(VISUAL) +#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) if ( dir == DIR_X ) can->real_can->percentage = (int)ceil((float)p/(float)can->real_can->width*100); else if ( dir == DIR_Y ) @@ -634,7 +667,7 @@ void marker(struct canvas *can,int dir,int p){ } void define_cursor(WINDOW w,CURSOR cur){ -#if !defined(VISUAL) +#if !defined(VISUAL) && !defined(__MINGW32__) && !defined(__MINGW64__) XDefineCursor(display,w,cur); flush(); #endif } @@ -647,14 +680,14 @@ static int flush_count; #endif void count_and_flush(){ -#if !defined(VISUAL) +#if !defined(VISUAL) && !defined(__MINGW32__) && !defined(__MINGW64__) if ( ++flush_count == MAX_COUNT ) flush(); #endif } void flush(){ -#if !defined(VISUAL) +#if !defined(VISUAL) && !defined(__MINGW32__) && !defined(__MINGW64__) flush_count = 0; XFlush(display); #endif