Changeset 2523 in Sophya for trunk/SophyaPI/PIext


Ignore:
Timestamp:
Mar 19, 2004, 2:06:08 PM (22 years ago)
Author:
cmv
Message:

OptionToString cmv 19/03/04

Location:
trunk/SophyaPI/PIext
Files:
4 edited

Legend:

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

    r2517 r2523  
    196196           || opts=="nostat" || opts=="nostats") SetStats(false);
    197197    else if(opts=="err")      SetError(1);
    198     else if(opts=="noerr")    SetError(-1);
     198    else if(opts=="noerr" || opts=="nerr")    SetError(-1);
    199199    else if(opts=="autoerr")  SetError(0);
    200200    else if(opts=="fill")     SetFilled(true);
    201     else if(opts=="nofill")   SetFilled(false);
     201    else if(opts=="nofill" || opts=="nfill")   SetFilled(false);
    202202    else if(opts.substr(0,11) == "statposoff=") {
    203203      float xo=0., yo=0.;
     
    217217}
    218218
     219int
     220PIHisto::OptionToString(vector<string> & opt) const
     221{
     222 PIDrawer::OptionToString(opt);
     223
     224 if(stats) opt.push_back("stat"); else opt.push_back("nstat");
     225 if(error==-1) opt.push_back("noerr");
     226   else if(error==0) opt.push_back("autoerr");
     227     else if(error==1) opt.push_back("err");
     228 if(filled) opt.push_back("fill"); else opt.push_back("nofill");
     229
     230 char str[256]; sprintf(str,"statposoff=%g,%g",spoX,spoY);
     231 opt.push_back(str);
     232
     233 return 1;
     234}
     235
    219236void
    220237PIHisto::GetOptionsHelpInfo(string& info)
     
    223240info += "  sta,stat,stats:            activate   statistic display\n";
    224241info += "  nsta,nstat,nostat,nostats: deactivate statistic display\n";
    225 info += "  err / nerr : draw, do not draw error bars\n";
     242info += "  err / noerr,nerr : draw, do not draw error bars\n";
    226243info += "  autoerr : draw error bars if Marker drawing requested OR Profile histo\n";
    227 info += "  fill / nofill : fill, do not fill bars with selected color\n";
     244info += "  fill / nofill,nfill : fill, do not fill bars with selected color\n";
    228245info += "  statposoff=OffsetX,OffsetY : Position offset for Stats drawing \n";
    229246info += "       as a fraction of total size \n";
  • trunk/SophyaPI/PIext/pihisto.h

    r2517 r2523  
    1616  inline  void       SetStats(bool fg=true) {stats=fg;}
    1717  inline  void       SetStatPosOffset(float ofx=-0.01, float ofy=-0.01)
    18           {spoX=ofx; spoY=ofy; }
     18                                     {spoX=ofx; spoY=ofy; }
    1919  // fg=-1 pas de barre d'erreur, 1=barres d'erreurs,
    2020  // 0=barres d'erreurs automatiques: trace si HProf ou markeur demande
     
    2525//   Methode de decodage des options
    2626  virtual int        DecodeOptionString(vector<string> & opt, bool rmdecopt=true);
     27  virtual int        OptionToString(vector<string> & opt) const;
    2728  virtual void       GetOptionsHelpInfo(string& info);
    2829
  • trunk/SophyaPI/PIext/pihisto2d.cc

    r2388 r2523  
    576576}
    577577
     578int PIHisto2D::OptionToString(vector<string> & opt) const
     579{
     580 PIDrawer::OptionToString(opt);
     581 char str[256];
     582
     583 if(stats) opt.push_back("stat"); else opt.push_back("nstat");
     584
     585 sprintf(str,"statposoff=%f,%f",spoX,spoY);
     586 opt.push_back(str);
     587
     588 if(mTypDisp==0) sprintf(str,"h2disp=var");
     589  else if(mTypDisp==1) sprintf(str,"h2disp=pts,%g",mFPoints);
     590    else if(mTypDisp==2) sprintf(str,"h2disp=hbk");
     591      else if(mTypDisp==3) sprintf(str,"h2disp=img");
     592 opt.push_back(str);
     593
     594 if(mTypScal==0) sprintf(str,"h2scale=lin");
     595   else if(mTypScal==1) sprintf(str,"h2disp=log,%g",mLogScale);
     596 opt.push_back(str);
     597
     598 sprintf(str,"h2dyn=%g,%g",mHMin,mHMax);
     599 opt.push_back(str);
     600
     601 sprintf(str,"h2frac=%g,%g",mFracMin,mFracMax);
     602 opt.push_back(str);
     603
     604 if(mRevCmap) opt.push_back("revcmap");
     605
     606 return 1;
     607}
     608
     609
    578610//++
    579611void PIHisto2D::GetOptionsHelpInfo(string& info)
  • trunk/SophyaPI/PIext/pihisto2d.h

    r2383 r2523  
    5252  //   Methode de decodage des options
    5353  virtual int  DecodeOptionString(vector<string> & opt, bool rmdecopt=true);
     54  virtual int  OptionToString(vector<string> & opt) const;
    5455  virtual void GetOptionsHelpInfo(string& info);
    5556
Note: See TracChangeset for help on using the changeset viewer.