IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 27, 2005, 5:06:32 AM (21 years ago)
Author:
eugene
Message:

converting to use libkapa commands instead of raw graph commands

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/vcontour.c

    r3693 r5846  
    4242
    4343# define DUMP { \
    44 sprintf (&buffer[Nline*128], "%14s %20.10f %20.10f %20.10f %20.10f \0", "LINE", Npix*x, Npix*y, Npix*dx, Npix*dy); \
    45 Nline ++; \
    46 if (Nline == 512) { \
    47   SendGraphCommand (Ximage, 16, "NLINES  %7d \0", Nline); \
    48   write (Ximage, buffer, Nline*128); \
    49   bzero (buffer, 65536); \
    50   Nline = 0; \
    51 } \
    52 continue; }
    53 
    54 # define NUMP { \
    55 sprintf (&buffer[Nline*128], "%14s %20.10f %20.10f %20.10f %20.10f \0", "LINE", Npix*x, Npix*y, Npix*dx, Npix*dy); \
    56 Nline ++; \
    57 if (Nline == 512) { \
    58   SendGraphCommand (Ximage, 16, "NLINES  %7d \0", Nline); \
    59   write (Ximage, buffer, Nline*128); \
    60   bzero (buffer, 65536); \
    61   Nline = 0; \
    62 } }
     44overlay[Noverlay].type = KII_OVERLAY_LINE; \
     45overlay[Noverlay].x = Npix*x; \
     46overlay[Noverlay].y = Npix*y; \
     47overlay[Noverlay].dx = Npix*dx; \
     48overlay[Noverlay].dy = Npix*dy; \
     49Noverlay ++; \
     50CHECK_REALLOCATE (overlay, KiiOverlay, NOVERLAY, Noverlay, 1000); \
     51}
    6352
    6453int vcontour (int argc, char **argv) {
     
    11099  /* not really finished */
    111100
     101  Noverlay = 0;
     102  NOVERLAY = 1000;
     103  ALLOCATE (overlay, KiiOverlay, NOVERLAY);
     104
    112105  v01 = matrix + 1;
    113106  v10 = matrix + Nx;
     
    132125          LL;
    133126          DUMP;
     127          continue;
    134128        }
    135129        if ((d01 > 0) && (d11 <= 0)) { /* -  */
    136130          HZ;
    137131          DUMP;
     132          continue;
    138133        }
    139134        if ((d01 > 0) && (d11 > 0)) { /* /  */
    140135          UL;
    141136          DUMP;
     137          continue;
    142138        }
    143139        if ((d01 <= 0) && (d11 > 0)) { /* \\  */
    144140          LL;
    145           NUMP;
     141          DUMP;
    146142          UR;
    147143          DUMP;
     144          continue;
    148145        }
    149146      }
     
    153150          LL;
    154151          DUMP;
     152          continue;
    155153        }
    156154        if ((d01 <= 0) && (d11 > 0)) { /* -  */
    157155          HZ;
    158156          DUMP;
     157          continue;
    159158        }
    160159        if ((d01 <= 0) && (d11 <= 0)) { /* /  */
    161160          UL;
    162161          DUMP;
     162          continue;
    163163        }
    164164        if ((d01 > 0) && (d11 <= 0)) { /* //  */
    165165          UL;
    166           NUMP;
     166          DUMP;
    167167          LR;
    168168          DUMP;
     169          continue;
    169170        }
    170171      }
     
    175176          LR;
    176177          DUMP;
     178          continue;
    177179        }
    178180        if ((d01 <= 0) && (d11 > 0)) {
    179181          UR;
    180182          DUMP;
     183          continue;
    181184        }
    182185        if ((d01 > 0) && (d11 > 0)) {
    183186          VT;
    184187          DUMP;
     188          continue;
    185189        }
    186190      }
     
    190194          LR;
    191195          DUMP;
     196          continue;
    192197        }
    193198        if ((d01 > 0) && (d11 <= 0)) {
    194199          UR;
    195200          DUMP;
     201          continue;
    196202        }
    197203        if ((d01 <= 0) && (d11 <= 0)) {
    198204          VT;
    199205          DUMP;
     206          continue;
    200207        }
    201208      }
     
    217224    if (((*v00 > level) && (*v01 <= level)) || ((*v00 <= level) && (*v01 > level))) {
    218225      x = i + (level - *v01)/(*v01 - *v00);
    219       NUMP;
     226      DUMP;
     227      continue;
    220228    }
    221229  }
     
    230238    if (((*v00 > level) && (*v01 <= level)) || ((*v00 <= level) && (*v01 > level))) {
    231239      x = i + (level - *v01)/(*v01 - *v00);
    232       NUMP;
     240      DUMP;
     241      continue;
    233242    }
    234243  }
     
    243252    if (((*v00 > level) && (*v01 <= level)) || ((*v00 <= level) && (*v01 > level))) {
    244253      y = j + (level - *v01)/(*v01 - *v00);
    245       NUMP;
     254      DUMP;
     255      continue;
    246256    }
    247257  }
     
    256266    if (((*v00 > level) && (*v01 <= level)) || ((*v00 <= level) && (*v01 > level))) {
    257267      y = j + (level - *v01)/(*v01 - *v00);
    258       NUMP;
     268      DUMP;
     269      continue;
    259270    }
    260271  }
    261272 
    262   if (Nline > 0) {
    263     SendGraphCommand (Ximage, 16, "NLINES  %7d \0", Nline);
    264     write (Ximage, buffer, Nline*128);
    265   }
    266 
    267   free (buffer);
    268   SendGraphCommand (Ximage, 16, "DONE");
     273  KiiLoadOverlay (Ximage, overlay, Noverlay, argv[2]);
     274  free (overlay);
     275
    269276  if (Npix != 1) free (matrix);
    270277  fprintf (stderr, "\n");
Note: See TracChangeset for help on using the changeset viewer.