Changeset 2383 in Sophya for trunk/SophyaPI/PIext/pintuple.cc


Ignore:
Timestamp:
May 16, 2003, 5:15:55 PM (22 years ago)
Author:
ansari
Message:

Ajout methode GetInfoString() aux ObjAdapter + attributs de gestion de position de stat pour PINtuple/PIHisto + positionnement par defaut de stat (statposoff=) lors de disp same - Reza 16/5/2003

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/pintuple.cc

    r2373 r2383  
    4646  mAdDO = ad;
    4747  SetStats(true);
     48  SetStatPosOffset();
    4849  ConnectPoints(false);
    4950  UseSizeScale(true, 5);
     
    237238  // Les labels et leurs longueurs -> largeur de la cellule
    238239  char label[64];
    239   sprintf(label, "Nd= %d / Ntot= %d", nok, mNT->NbLines());
     240  sprintf(label, "N=%d (/%d)", nok, mNT->NbLines());
    240241  double cellWidth =   1.1 * (double)g->CalcStringWidth(label);
    241242  double xu, yu, cw;
     243  double ofpx = spoX*(XMax()-XMin());
     244  double ofpy = spoY*(YMax()-YMin());
    242245  // Les limites du cadre
    243246  xu = g->DeltaUCX(XMax(), - cellWidth);
    244247  yu = g->DeltaUCY(YMax(), - cellHeight);
    245   g->DrawLine(xu, YMax(), xu, yu);
    246   g->DrawLine(xu, yu, XMax(), yu);
     248  double recw = XMax()-xu;
     249  double rech = YMax()-yu;
     250  xu += ofpx;  yu += ofpy;
     251  g->DrawBox(xu, yu, recw, rech);
    247252  // L'ecriture des labels (attention aux inversions possibles des axes!)
    248253  cw = (g->isAxeXDirRtoL()) ? -0.05*cellWidth : -0.95*cellWidth;
     
    250255  cw = (g->isAxeYDirUpDown()) ? -0.1*cH : -1.1*cH;
    251256  yu = g->DeltaUCY(YMax(),cw);
     257  xu += ofpx;  yu += ofpy;
    252258  g->DrawString(xu,yu,label);
    253259}
     
    313319    else if(  opts=="nsta"   || opts=="nstat"
    314320           || opts=="nostat" || opts=="nostats") SetStats(false);
     321    else if(opts.substr(0,11) == "statposoff=") {
     322      float xo=0., yo=0.;
     323      sscanf(opts.substr(11).c_str(),"%g,%g",&xo, &yo);
     324      SetStatPosOffset(xo, yo);
     325    }
    315326    else if (opts == "connectpoints") ConnectPoints(true);
    316327    else if (opts == "noconnectpoints") ConnectPoints(false);
     
    323334      UseSizeScale(true, nbn);
    324335    }
     336
    325337    else {
    326338      // Si option non decode
     
    350362info += "  sta,stat,stats:            activate   statistic display\n";
    351363info += "  nsta,nstat,nostat,nostats: deactivate statistic display\n";
     364info += "  statposoff=OffsetX,OffsetY : Position offset for Stats drawing \n";
     365info += "      as a fraction of total size \n";
    352366info += "  connectpoints: The points are connected by a line \n";
    353367info += "  noconnectpoints (this is the default) \n";
    354368info += "  colorscale/nocolorscale (Use color scale for weight) \n";
    355369info += "  sizescale/sizescale=nbins/nosizescale (Use marker size for weight) \n";
    356 info += "  and usual color/line/marker/... attribute decoding  \n";
     370info += "   (and usual color/line/marker/... attribute decoding)  \n";
    357371return;
    358372}
Note: See TracChangeset for help on using the changeset viewer.