Changeset 2383 in Sophya for trunk/SophyaPI/PIext/pihisto.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/pihisto.cc

    r2232 r2383  
    3939  SetStats();
    4040  SetError();
     41  SetStatPosOffset();
    4142  SetName("HistoDrw");
    4243}
     
    173174    else if(opts=="noerr")    SetError(-1);
    174175    else if(opts=="autoerr")  SetError(0);
     176    else if(opts.substr(0,11) == "statposoff=") {
     177      float xo=0., yo=0.;
     178      sscanf(opts.substr(11).c_str(),"%g,%g",&xo, &yo);
     179      SetStatPosOffset(xo, yo);
     180    }
    175181    else {
    176182      ndec--;
     
    191197PIDrawer::GetOptionsHelpInfo(info);
    192198info += " ---- PIHisto options help info : \n" ;
    193 info += "- sta,stat,stats:            activate   statistic display\n";
     199info += "  sta,stat,stats:            activate   statistic display\n";
    194200info += "  nsta,nstat,nostat,nostats: deactivate statistic display\n";
    195 info += "- err / nerr : draw, do not draw error bars\n";
     201info += "  err / nerr : draw, do not draw error bars\n";
    196202info += "  autoerr : draw error bars if Marker drawing requested OR Profile histo\n";
     203info += "  statposoff=OffsetX,OffsetY : Position offset for Stats drawing \n";
     204info += "       as a fraction of total size \n";
    197205return;
    198206}
     
    221229  double cellWidth =  1.1 * (double)g->CalcStringWidth(label);
    222230
     231  double ofpx = spoX*(XMax()-XMin());
     232  double ofpy = spoY*(YMax()-YMin());
     233 
    223234  double xu, yu, cw;
    224235  // Les limites du cadre
    225236  xu = g->DeltaUCX(XMax(), -cellWidth);
    226237  yu = g->DeltaUCY(YMax(), -cellHeight);
    227   g->DrawLine(xu,YMax(),xu,yu);
    228   g->DrawLine(xu,yu,XMax(),yu);
     238  double recw = XMax()-xu;
     239  double rech = YMax()-yu;
     240  xu += ofpx;  yu += ofpy;
     241  g->DrawBox(xu, yu, recw, rech);
    229242
    230243  // L'ecriture des labels (attention aux inversions possibles des axes!)
     
    234247  cw = (g->isAxeYDirUpDown()) ? -0.15*cH : -1.15*cH;
    235248  yu = g->DeltaUCY(YMax(),cw);
     249  xu += ofpx;  yu += ofpy;
    236250  g->DrawString(xu, yu,label1);
    237     cw +=  -1.15*cH;
    238     yu = g->DeltaUCY(YMax(),cw);
    239     g->DrawString(xu, yu,label2);
    240       cw +=  -1.15*cH;
    241       yu = g->DeltaUCY(YMax(),cw);
    242       g->DrawString(xu, yu,label3);
     251  cw +=  -1.15*cH;
     252  yu = g->DeltaUCY(YMax(),cw);  yu += ofpy;
     253  g->DrawString(xu, yu,label2);
     254  cw +=  -1.15*cH;
     255  yu = g->DeltaUCY(YMax(),cw);  yu += ofpy;
     256  g->DrawString(xu, yu,label3);
    243257                       
    244258}
Note: See TracChangeset for help on using the changeset viewer.