[BACK]Return to plotp.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / plot

Diff for /OpenXM_contrib2/asir2000/plot/plotp.c between version 1.16 and 1.17

version 1.16, 2013/12/19 05:48:25 version 1.17, 2014/05/12 16:54:41
Line 45 
Line 45 
  * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,   * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
  * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.   * 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.16 2013/12/19 05:48:25 saito Exp $
 */  */
 #include "ca.h"  #include "ca.h"
 #include "parse.h"  #include "parse.h"
Line 164  void if_print(DISPLAY *display,double **tab,struct can
Line 164  void if_print(DISPLAY *display,double **tab,struct can
         DRAWABLE pix;          DRAWABLE pix;
         width=can->width; height=can->height; pix=can->pix;          width=can->width; height=can->height; pix=can->pix;
         if(cond==0){          if(cond==0){
                 //MODE_IFPLOTB                  //IFPLOTB
                 for(iy=0;iy<height-1;iy++)for(ix=0;ix<width-1;ix++)                  for(iy=0;iy<height-1;iy++)for(ix=0;ix<width-1;ix++)
                         if(tab[ix][iy]==0.0) DRAWPOINT(display,pix,cdrawGC,ix,height-iy-1);                          if(tab[ix][iy]==0.0) DRAWPOINT(display,pix,cdrawGC,ix,height-iy-1);
         } else {          } else if(cond==1) {
                 //MODE_IFPLOT,MODE_IFPLOTD,MODE_IFPLOTQ                  //IFPLOT,IFPLOTD,IFPLOTQ
                 for(iy=0;iy<height-1;iy++)for(ix=0;ix<width-1;ix++){                  for(iy=0;iy<height-1;iy++)for(ix=0;ix<width-1;ix++){
                         if(tab[ix][iy]==0.0) DRAWPOINT(display,pix,cdrawGC,ix,height-iy-1);                          if(tab[ix][iy]==0.0) DRAWPOINT(display,pix,cdrawGC,ix,height-iy-1);
                         else if(tab[ix][iy]>0){                          else if(tab[ix][iy]>0){
Line 182  void if_print(DISPLAY *display,double **tab,struct can
Line 182  void if_print(DISPLAY *display,double **tab,struct can
         flush();          flush();
 }  }
   
   void polar_print(DISPLAY *display,struct canvas *can){
           int len,color,i,j,x,y;
           POINT *pa;
   
           len=can->pa[0].length;
           color=can->color;
           pa=can->pa[0].pos;
   #if defined(VISUAL)
           HDC dc;
           HPEN pen,oldpen;
           for(i=1;i<len;i++){
                   j=i-1;
                   if(color){
                           pen=CreatePen(PS_SOLID,1,color);
                           oldpen=SelectObject(can->pix,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
           for(i=1;i<len;i++){
                   j=i-1;
                   DRAWLINE(display,can->pix,cdrawGC,XC(pa[j]),YC(pa[j]),XC(pa[i]),YC(pa[i]));
           }
           XFlush(display);
   #endif
   }
   
   
 void if_printOld(DISPLAY *display,double **tab,struct canvas *can){  void if_printOld(DISPLAY *display,double **tab,struct canvas *can){
         int i,ix,iy,width,height;          int i,ix,iy,width,height;
         double *px,*px1,*px2;          double *px,*px1,*px2;
Line 190  void if_printOld(DISPLAY *display,double **tab,struct 
Line 232  void if_printOld(DISPLAY *display,double **tab,struct 
         POINT *pa,*pa1;          POINT *pa,*pa1;
         struct pa *parray;          struct pa *parray;
   
         if(can->mode==MODE_CONPLOT){          if(can->mode==modeNO(CONPLOT)){
                 width=can->width;height=can->height;pix=can->pix;                  width=can->width;height=can->height;pix=can->pix;
                 //con_print(display,tab,can);                  //con_print(display,tab,can);
           // calc all cell max,min value            // calc all cell max,min value
Line 245  void memory_if_print(double **tab,struct canvas *can,B
Line 287  void memory_if_print(double **tab,struct canvas *can,B
         double *px,*px1,*px2;          double *px,*px1,*px2;
         unsigned char *array;          unsigned char *array;
         int scan_len;          int scan_len;
         if ( can->mode == MODE_CONPLOT ){          if ( can->mode==modeNO(CONPLOT)){
                 memory_con_print(tab,can,bytes);                  memory_con_print(tab,can,bytes);
                 return;                  return;
         }          }
Line 358  void memory_print(struct canvas *can,BYTEARRAY *bytes)
Line 400  void memory_print(struct canvas *can,BYTEARRAY *bytes)
         /* scan_len = byte length of the scan line */          /* scan_len = byte length of the scan line */
         scan_len = (can->width+7)/8;          scan_len = (can->width+7)/8;
         MKBYTEARRAY(*bytes,scan_len*can->height);          MKBYTEARRAY(*bytes,scan_len*can->height);
         array = BDY(*bytes);          array = (char*)BDY(*bytes);
   
         len = can->pa[0].length;          len = can->pa[0].length;
         pa = can->pa[0].pos;          pa = can->pa[0].pos;
Line 490  void pline(DISPLAY *display,struct canvas *can,DRAWABL
Line 532  void pline(DISPLAY *display,struct canvas *can,DRAWABL
         double adjust_scale();          double adjust_scale();
   
         /* XXX : should be cleaned up */          /* XXX : should be cleaned up */
         if ( can->noaxis || (can->mode == MODE_PLOT && !can->pa) )          if ( can->noaxis || (can->mode==modeNO(PLOT)&& !can->pa) )
                 return;                  return;
         if ( can->mode == MODE_INTERACTIVE )          if ( can->mode==modeNO(INTERACTIVE))
                 return;                  return;
   
         xadj = yadj = 0;          xadj = yadj = 0;

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>