Changeset 2524 in Sophya


Ignore:
Timestamp:
Mar 23, 2004, 10:24:36 AM (22 years ago)
Author:
cmv
Message:

OptionToString dans NTuple et NTuple3D cmv 23/03/04

Location:
trunk/SophyaPI/PIext
Files:
4 edited

Legend:

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

    r2400 r2524  
    282282    de string fourni en entree - ce qui permet l'enchainement eventuel
    283283    de plusieurs decodages de string.
    284     Les options peuvent etre sous forme de flag : "stat" "nostat"
     284    Les options peuvent etre sous forme de flag : "connectpoints" "noconnectpoints"
    285285    ou plus complexes, par exemple "dynamic=-3,3"
    286286    Rc: La methode renvoie le nombre d'options decodees
     
    291291{
    292292  int optsz1 = opt.size();
    293   if(optsz1<1)  return(0); 
     293  if(optsz1<1)  return(0);
    294294  // On appelle d'abord le decodage de la classe PIDrawer de laquelle
    295295  // on herite. (Pas obligatoire) on decode donc ici les attributs de
     
    303303  for( k=0; k<opt.size(); k++ ) {
    304304    string opts = opt[k];
    305     //    if(opts=="sta" || opts=="stat" || opts=="stats") SetStats(true);
    306     //    else if(  opts=="nsta"   || opts=="nstat"
    307     //           || opts=="nostat" || opts=="nostats") SetStats(false);
    308305    if (opts == "connectpoints") ConnectPoints(true);
    309306    else if (opts == "noconnectpoints") ConnectPoints(false);
     
    333330}
    334331
     332int PINTuple3D::OptionToString(vector<string> & opt) const
     333{
     334 PIDrawer::OptionToString(opt);
     335
     336 if(connectPts) opt.push_back("connectpoints");
     337   else opt.push_back("noconnectpoints");
     338
     339 if(colorScale) opt.push_back("colorscale");
     340   else opt.push_back("nocolorscale");
     341
     342 if(mrkSzScale) {
     343   char str[256];
     344   if(nWbins>0) {sprintf(str,"sizescale=%d",nWbins); opt.push_back(str);}
     345     else opt.push_back("sizescale");
     346 } else opt.push_back("nosizescale");
     347
     348 if(mAutoScaleXY) opt.push_back("rescalexy");
     349   else opt.push_back("norescalexy");
     350
     351 if(mAutoScaleZ) opt.push_back("rescalez");
     352   else opt.push_back("norescalez");
     353
     354 return 1;
     355}
     356
    335357/* La methode GetOptionsHelpInfo(string& info) renvoie une chaine
    336358   avec la description des options comprises par ce drawer 
  • trunk/SophyaPI/PIext/pintup3d.h

    r2400 r2524  
    3131//   Methode de decodage des options
    3232  virtual int        DecodeOptionString(vector<string> & opt, bool rmdecopt=true);
     33  virtual int        OptionToString(vector<string> & opt) const;
    3334//   Texte d'aide des options disponibles
    3435  virtual void       GetOptionsHelpInfo(string& info);
     
    5253
    5354#endif
    54 
    55 
    56 
    57 
  • trunk/SophyaPI/PIext/pintuple.cc

    r2517 r2524  
    373373}
    374374
     375int PINTuple::OptionToString(vector<string> & opt) const
     376{
     377 PIDrawer::OptionToString(opt);
     378
     379 char str[256];
     380
     381 if(stats) opt.push_back("stat"); else opt.push_back("nstat");
     382
     383 sprintf(str,"statposoff=%g,%g",spoX,spoY); opt.push_back(str);
     384
     385 if(connectPts) opt.push_back("connectpoints");
     386   else opt.push_back("noconnectpoints");
     387
     388 if(colorScale) opt.push_back("colorscale");
     389   else opt.push_back("nocolorscale");
     390
     391 if(mrkSzScale) {
     392   if(nWbins>0) {sprintf(str,"sizescale=%d",nWbins); opt.push_back(str);}
     393     else opt.push_back("sizescale");
     394 } else opt.push_back("nosizescale");
     395
     396 return 1;
     397}
     398
    375399/* La methode GetOptionsHelpInfo(string& info) renvoie une chaine
    376400   avec la description des options comprises par ce drawer 
  • trunk/SophyaPI/PIext/pintuple.h

    r2517 r2524  
    4242//   Methode de decodage des options
    4343  virtual int        DecodeOptionString(vector<string> & opt, bool rmdecopt=true);
     44  virtual int        OptionToString(vector<string> & opt) const;
    4445//   Texte d'aide des options disponibles
    4546  virtual void       GetOptionsHelpInfo(string& info);
Note: See TracChangeset for help on using the changeset viewer.