IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17530 for trunk/Ohana


Ignore:
Timestamp:
May 5, 2008, 11:06:05 AM (18 years ago)
Author:
eugene
Message:

adding line weight and color to box frames

Location:
trunk/Ohana/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/kapa2/include/structures.h

    r16810 r17530  
    138138  char isaxis, areticks, islabel, islog;
    139139  double fx, dfx, fy, dfy;  /* axis location on graphic */
     140  double lweight;
     141  int color;
    140142} Axis;
    141143
  • trunk/Ohana/src/kapa2/src/DrawFrame.c

    r17466 r17530  
    88 
    99  int i, fx, fy, dfx, dfy, P, IsLabel, IsMajor;
    10   double range, major, minor, first, next;
     10  double range, major, minor, first, next, lweight;
    1111
    1212  graphic = GetGraphic();
    13 
    14   // XXX why is this called for every redraw?
    15   DrawRotTextInit (graphic->display, graphic->window, graphic->gc, graphic->fore, graphic->back);
    1613
    1714  /* each axis is drawn independently, but ticks and labels are placed according to
     
    2320    dfy = graph[0].axis[i].dfy;
    2421    P = hypot ((double)graph[0].axis[(i+1)%2].dfx, (double)graph[0].axis[(i+1)%2].dfy);
     22
     23    lweight = MAX (0, MIN (10, graph[0].axis[i].lweight));
     24    XSetLineAttributes (graphic->display, graphic->gc, lweight, LineSolid, CapNotLast, JoinMiter);
     25    XSetForeground (graphic->display, graphic->gc, graphic->color[graph[0].axis[i].color]);
     26    DrawRotTextInit (graphic->display, graphic->window, graphic->gc, graphic->color[graph[0].axis[i].color], graphic->back);
    2527
    2628    if (graph[0].axis[i].isaxis) {
  • trunk/Ohana/src/kapa2/src/LoadFrame.c

    r14590 r17530  
    33int LoadFrame (int sock) {
    44 
    5   int i;
     5  int i, color;
    66  char Axis[16], Labels[16], Ticks[16];
     7  double lweight;
    78  Section *section;
    89  KapaGraphWidget *graph;
     
    2425  graph[0].axis[2].max = graph[0].axis[0].max;
    2526 
     27  KiiScanMessage (sock, "%lf %d", &lweight, &color);
     28
    2629  KiiScanMessage (sock, "%s %s %s", Axis, Labels, Ticks);
    2730
    2831  for (i = 0; i < 4; i++) {
     32    graph[0].axis[i].lweight = lweight;
     33    graph[0].axis[i].color = color;
     34
    2935    switch (Axis[i]) {
    3036    case '0':
  • trunk/Ohana/src/libkapa/src/KapaWindow.c

    r14401 r17530  
    2323  KiiSendMessage (fd, "%12.6g %12.6g %12.6g %12.6g",
    2424                    graphdata[0].xmin, graphdata[0].xmax, graphdata[0].ymin, graphdata[0].ymax);
     25
     26  KiiSendMessage (fd, "%lf %d", graphdata[0].lweight, graphdata[0].color);
    2527
    2628  KiiSendMessage (fd, "%s %s %s", graphdata[0].axis, graphdata[0].labels, graphdata[0].ticks);
  • trunk/Ohana/src/opihi/cmd.data/box.c

    r13479 r17530  
    1515  if (!GetGraph (&graphmode, &kapa, name)) return (FALSE);
    1616  FREE (name);
     17
     18  graphmode.lweight = 1;
     19  if ((N = get_argument (argc, argv, "-lw"))) {
     20    remove_argument (N, &argc, argv);
     21    graphmode.lweight = atof(argv[N]);
     22    remove_argument (N, &argc, argv);
     23  }
     24
     25  graphmode.color = KapaColorByName ("black");
     26  if ((N = get_argument (argc, argv, "-c"))) {
     27    remove_argument (N, &argc, argv);
     28    graphmode.color = KapaColorByName (argv[N]);
     29    if (graphmode.color == -1) return (FALSE);
     30    remove_argument (N, &argc, argv);
     31  }
    1732
    1833  strcpy (graphmode.ticks, "2222");
Note: See TracChangeset for help on using the changeset viewer.