Index: trunk/SophyaPI/PIext/servnobjm.cc
===================================================================
--- trunk/SophyaPI/PIext/servnobjm.cc	(revision 1931)
+++ trunk/SophyaPI/PIext/servnobjm.cc	(revision 1971)
@@ -53,5 +53,4 @@
 mOmg = omg;
 dynlink = NULL;
-InitGrAttNames();
 }
   
@@ -235,9 +234,6 @@
   vya->DefineXCoordinate(xmin, (xmax-xmin)/np);
   PIYfXDrawer* dr = new   PIYfXDrawer(vya, NULL, true) ; 
-  bool fgsr = true;
-  dopt = "thinline," + dopt;
-  int opt = DecodeDispOption(dopt, fgsr);
-  int rsid = mImgapp->DispScDrawer(dr, titre, opt);
-  if (fgsr) mImgapp->RestoreGraphicAtt(); 
+  dopt = "thinline " + dopt;
+  int rsid = mImgapp->DispScDrawer(dr, titre, dopt);
   if (nom.length() > 0) { 
     mOmg->AddObj(vpy, nom);
@@ -245,5 +241,4 @@
     }
   }
-
 return;
 }
@@ -304,11 +299,8 @@
     }
   else titre = nom;
-  bool fgsr = true;
-  int opt = DecodeDispOption(dopt, fgsr);
   P2DArrayAdapter* arr = new POMatrixAdapter(mtx, false);
   arr->DefineXYCoordinates(xmin, ymin, dx, dy);
   PISurfaceDrawer* sdr = new PISurfaceDrawer(arr, true, true, true);
-  int rsid = mImgapp->Disp3DDrawer(sdr, titre, opt);
-  if (fgsr) mImgapp->RestoreGraphicAtt();
+  int rsid = mImgapp->Disp3DDrawer(sdr, titre, dopt);
   if (nom.length() > 0)  { 
     mOmg->AddObj(mtx, nom);
@@ -352,14 +344,10 @@
 // nt->Print(0,10);
 PINTuple* pin = new PINTuple(nt, true);
-pin->SetStats(Services2NObjMgr::GetStatsOption(dopt));
 pin->SelectXY(ntn[0], ntn[1]);
 if ( haserr ) pin->SelectErrBar(ntn[2], ntn[3]);
 
-bool fgsr = true;
-dopt = "defline," + dopt;
-int opt = DecodeDispOption(dopt, fgsr);
+dopt = "defline " + dopt;
 string titre =  nom + ":" + expy + "%" + expx;
-mImgapp->DispScDrawer( (PIDrawer*)pin, titre, opt);
-if (fgsr) mImgapp->RestoreGraphicAtt();
+mImgapp->DispScDrawer( (PIDrawer*)pin, titre, dopt);
 return;
 }
@@ -392,7 +380,5 @@
 PINTuple3D* pin = new PINTuple3D(nt, true);
 pin->SelectXYZ(ntn[0], ntn[1], ntn[2]);
-bool fgsr = true;
-dopt = "defline," + dopt;
-int opt = DecodeDispOption(dopt, fgsr);
+dopt = "defline " + dopt;
 
 // Pour plot a partir de DispScDrawer
@@ -401,7 +387,6 @@
 // Pour plot a partir de Disp3DDrawer
 string titre =  nom + ":" + expy + "%" + expx;
-mImgapp->Disp3DDrawer(pin, titre, opt);
-
-if (fgsr) mImgapp->RestoreGraphicAtt();
+mImgapp->Disp3DDrawer(pin, titre, dopt);
+
 return;
 }
@@ -432,13 +417,9 @@
 
 PINTuple* pin = new PINTuple(nt, true);
-pin->SetStats(Services2NObjMgr::GetStatsOption(dopt));
 pin->SelectXY(ntn[0], ntn[1]);
 pin->SelectWt(ntn[2]);
 
-bool fgsr = true;
-int opt = DecodeDispOption(dopt, fgsr);
 string titre =  nom + ":" + expwt + "_" + expy + "%" + expx ;
-mImgapp->DispScDrawer( (PIDrawer*)pin, titre, opt);
-if (fgsr) mImgapp->RestoreGraphicAtt();
+mImgapp->DispScDrawer( (PIDrawer*)pin, titre, dopt);
 return;
 }
@@ -1315,385 +1296,4 @@
 
 
-// Variable pour stocker l'option de stat des drawers
-static bool stats_option = true;
-/* --Methode-- */
-void Services2NObjMgr::SetDefaultStatsOption(bool opt)
-{
-  stats_option = opt;
-}
-
-typedef vector<string> GraTok;
-
-/* --Methode-- */
-bool Services2NObjMgr::GetStatsOption(string& gratt)
-{
-int ropt = Disp_Next;
-for(int i=0; i<gratt.length(); i++) gratt[i] = tolower(gratt[i]);
-// On separe en mots separes par des virgules 
-gratt = ","+gratt;
-size_t p = 0;
-size_t q = 0;
-size_t l = gratt.length();
-string token;
-
-GraTok grt;
-
-while (q < l)  {
-  p = gratt.find_first_not_of(" ,",q+1); // au debut d'un token
-  if (p>=l) break;
-  q = gratt.find_first_of(" ,",p); // la fin du token;
-  token = gratt.substr(p,q-p);
-  grt.push_back(token);
-  }
-int k;
-bool fgsame = false;
-int option = 0; 
-for(k=0; k<grt.size(); k++) {
-  if ( (grt[k] == "same") || (grt[k] == "s") )  option = 1;
-  else if ( (grt[k] == "stat") || (grt[k] == "stats") ) option = 2;
-  else if ( (grt[k] == "nostat") || (grt[k] == "nostats") ) option = 3;
-}
-
-if (option == 0)  return(stats_option);
-else if ( (option == 1) || (option == 3) )  return(false);
-else return(true);
-}
-
-/* --Methode-- */
-int Services2NObjMgr::DecodeDispOption(string& gratt, bool& fgsrgr)
-{
-int ropt = Disp_Next;
-if (!mImgapp)  return(ropt); 
-
-for(int i=0; i<gratt.length(); i++) gratt[i] = tolower(gratt[i]);
-
-if (fgsrgr) mImgapp->SaveGraphicAtt();
-
-if ( (gratt == "def") || (gratt == "default") )  {  // Remise aux valeurs par defaut = non defini
-  mImgapp->SetColAtt();
-  mImgapp->SetLineAtt();
-  mImgapp->SetFontName();
-  mImgapp->SetFontAtt();
-  mImgapp->SetMarkerAtt();
-  mImgapp->SetColMapId();
-  mImgapp->SetReverseColMapFlag();
-  mImgapp->SetZoomAtt();
-  mImgapp->SetAxesAtt();
-  mImgapp->SetXYLimits();
-  mImgapp->UseXYLimits();
-  mImgapp->SetImageCenterPosition();
-  mImgapp->UseImageCenter();
-  mImgapp->SetXLogScale();
-  mImgapp->SetYLogScale();
-  mImgapp->SetAutoAddTitle();
-  stats_option = true;
-  return(ropt);
-  }
-
-// On separe en mots separes par des virgules 
-gratt = ","+gratt;
-size_t p = 0;
-size_t q = 0;
-size_t l = gratt.length();
-string token;
-
-GraTok grt;
-
-while (q < l)  {
-  p = gratt.find_first_not_of(" ,",q+1); // au debut d'un token
-  if (p>=l) break;
-  q = gratt.find_first_of(" ,",p); // la fin du token;
-  token = gratt.substr(p,q-p);
-  grt.push_back(token);
-  }
-
-
-static GrAttNames::iterator it;
-
-int k; 
-bool fgcont = true;
-fgsrgr = false;
-
-for(k=0; k<grt.size(); k++) {
-//  cout << "--DBG--SetGraphicAttributes() " << grt[k] << endl;
-
- // Decodage option affichage (win, next, etc 
-  fgcont = true;
-  if ( (grt[k] == "win") || (grt[k] == "w") )  ropt =  Disp_Win;
-  else if ( (grt[k] == "same") || (grt[k] == "s") )  ropt = Disp_Same;
-  else if ( (grt[k] == "inset") || (grt[k] == "ins") )  ropt = Disp_Inset;
-  else  if ( (grt[k] == "stack") || (grt[k] == "st") )  ropt = Disp_Stack;
-  else fgcont = false;
-  if (fgcont)   continue;
-
-  // Utilisation limites X-Y
-  if ( grt[k] == "xylimits" ) { mImgapp->UseXYLimits(true);  fgsrgr = true;  continue; }
-  if ( grt[k] == "centerimg" ) { mImgapp->UseImageCenter(true);  fgsrgr = true;  continue; }
-  // Echelle logarithmique d'axe
-  if ( grt[k] == "logx" )  { mImgapp->SetXLogScale(true); fgsrgr = true;  continue; }
-  if ( grt[k] == "linx" )  { mImgapp->SetXLogScale(false); fgsrgr = true;  continue; }
-  if ( grt[k] == "logy" )  { mImgapp->SetYLogScale(true); fgsrgr = true;  continue; }
-  if ( grt[k] == "liny" )  { mImgapp->SetYLogScale(false); fgsrgr = true;  continue; }
-  // Ajout automatique de titre
-  if ( ( grt[k] == "tit" ) || ( grt[k] == "title" ) )
-    { mImgapp->SetAutoAddTitle(true); fgsrgr = true;  continue; }
-  if ( ( grt[k] == "notit" ) || ( grt[k] == "notitle" ) )
-    { mImgapp->SetAutoAddTitle(false); fgsrgr = true;  continue; }
-
-  // Inversion d'indexage de ColorMap
-  if (grt[k] == "revcmap") 
-    { mImgapp->SetReverseColMapFlag(true); fgsrgr = true;  continue; }
-
-  // Si c'est une couleur
-  it = GrAcolors.find(grt[k]);
-  if (it != GrAcolors.end())  { mImgapp->SetColAtt((PIColors)((*it).second.a1)); fgsrgr = true; continue; }
-  // Si c'est un attribut de lignes
-  it = GrAlines.find(grt[k]);
-  if (it != GrAlines.end())  { mImgapp->SetLineAtt(PILineAtt((PILineTypes)((*it).second.a1)));  fgsrgr = true; continue; }
-  // Si c'est un attribut de fontes
-  it = GrAfonts.find(grt[k]);
-  if (it != GrAfonts.end())  { mImgapp->SetFontAtt((PIFontSize)((*it).second.a2), (PIFontAtt)((*it).second.a1) ); 
-                               fgsrgr = true;  continue; }
-  // Si c'est un nom de fontes
-  it = GrAfontNames.find(grt[k]);
-  if (it != GrAfontNames.end()) { mImgapp->SetFontName((PIFontName)((*it).second.a1));
-                                 fgsrgr = true;  continue; }
-  // Si c'est un attribut de markers
-  it = GrAmarkers.find(grt[k]);
-  if (it != GrAmarkers.end())  { mImgapp->SetMarkerAtt((*it).second.a2, (PIMarker)((*it).second.a1) ); 
-                                 fgsrgr = true;  continue; }
-  // Si c'est un colormap
-  it = GrAcmap.find(grt[k]);
-  if (it != GrAcmap.end())  { mImgapp->SetColMapId( (CMapId)((*it).second.a1) ); fgsrgr = true; continue; }  
-  // Si c'est un facteur de zoom
-  it = GrAzoom.find(grt[k]);
-  if (it != GrAzoom.end())  { mImgapp->SetZoomAtt( (*it).second.a1 );  fgsrgr = true; continue; }  
-  // Si c'est un attribut d'axe
-  it = GrAaxes.find(grt[k]);
-  if (it != GrAaxes.end())  { mImgapp->SetAxesAtt( (*it).second.a1 );  fgsrgr = true; continue; }  
-  
-  }  
-
-return(ropt);
-}
-
-
-// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-// Initialisation des chaines de caracteres designant les attributs graphiques 
-
-/* --Methode-- */
-void Services2NObjMgr::InitGrAttNames()
-{
-gratt_item gi;
-// Les couleurs
-gi.a2 = 0;
-gi.a1 = PI_NotDefColor;
-GrAcolors["defcol"] = gi;
-gi.a1 = PI_Black;
-GrAcolors["black"] = gi;
-gi.a1 = PI_White;
-GrAcolors["white"] = gi;
-gi.a1 = PI_Grey;
-GrAcolors["grey"] = gi;
-gi.a1 = PI_Red;
-GrAcolors["red"] = gi;
-gi.a1 = PI_Blue;
-GrAcolors["blue"] = gi;
-gi.a1 = PI_Green;
-GrAcolors["green"] = gi;
-gi.a1 = PI_Yellow;
-GrAcolors["yellow"] = gi;
-gi.a1 = PI_Magenta;
-GrAcolors["magenta"] = gi;
-
-gi.a1 = PI_Cyan;
-GrAcolors["cyan"] = gi;
-gi.a1 = PI_Turquoise;
-GrAcolors["turquoise"] = gi;
-gi.a1 = PI_NavyBlue;
-GrAcolors["navyblue"] = gi;
-gi.a1 = PI_Orange;
-GrAcolors["orange"] = gi;
-gi.a1 = PI_SiennaRed;
-GrAcolors["siennared"] = gi;
-gi.a1 = PI_Purple;
-GrAcolors["purple"] = gi;
-gi.a1 = PI_LimeGreen;
-GrAcolors["limegreen"] = gi;
-gi.a1 = PI_Gold;
-GrAcolors["gold"] = gi;
-gi.a1 = PI_Violet;
-GrAcolors["violet"] = gi;
-gi.a1 = PI_VioletRed;
-GrAcolors["violetred"] = gi;
-gi.a1 = PI_BlueViolet;
-GrAcolors["blueviolet"] = gi;
-gi.a1 = PI_DarkViolet;
-GrAcolors["darkviolet"] = gi;
-
-// Les attributs de lignes
-gi.a2 = 0;
-gi.a1 = PI_NotDefLineAtt;
-GrAlines["defline"] = gi;
-gi.a1 = PI_NormalLine;
-GrAlines["normalline"] = gi;
-gi.a1 = PI_ThinLine;
-GrAlines["thinline"] = gi;
-gi.a1 = PI_ThickLine;
-GrAlines["thickline"] = gi;
-gi.a1 = PI_DashedLine;
-GrAlines["dashedline"] = gi;
-gi.a1 = PI_ThinDashedLine;
-GrAlines["thindashedline"] = gi;
-gi.a1 = PI_ThickDashedLine;
-GrAlines["thickdashedline"] = gi;
-gi.a1 = PI_DottedLine;
-GrAlines["dottedline"] = gi;
-gi.a1 = PI_ThinDottedLine;
-GrAlines["thindottedline"] = gi;
-gi.a1 = PI_ThickDottedLine;
-GrAlines["thickdottedline"] = gi;
-gi.a1 = PI_DashDottedLine;
-GrAlines["dashdottedline"] = gi;
-gi.a1 = PI_ThinDashDottedLine;
-GrAlines["thindashdottedline"] = gi;
-gi.a1 = PI_ThickDashDottedLine;
-GrAlines["thickdashdottedline"] = gi;
-
-// Noms de fontes
-gi.a2 = 0;
-gi.a1 = PI_DefaultFont;
-GrAfontNames["deffont"] = gi;
-gi.a1 = PI_CourierFont;
-GrAfontNames["courierfont"] = gi;
-gi.a1 = PI_HelveticaFont;
-GrAfontNames["helveticafont"] = gi;
-gi.a1 = PI_TimesFont;
-GrAfontNames["timesfont"] = gi;
-gi.a1 = PI_SymbolFont;
-GrAfontNames["symbolfont"] = gi;
-
-// Attributs de fontes 
-gi.a2 = PI_NotDefFontSize;
-gi.a1 = PI_NotDefFontAtt;
-GrAfontNames["deffontatt"] = gi;
-gi.a2 = PI_NormalSizeFont;
-gi.a1 = PI_RomanFont;
-GrAfonts["normalfont"] = gi;
-gi.a1 = PI_BoldFont;
-GrAfonts["boldfont"] = gi;
-gi.a1 = PI_ItalicFont;
-GrAfonts["italicfont"] = gi;
-gi.a1 = PI_BoldItalicFont;
-GrAfonts["bolditalicfont"] = gi;
-gi.a2 = PI_SmallSizeFont;
-gi.a1 = PI_RomanFont;
-GrAfonts["smallfont"] = gi;
-gi.a1 = PI_BoldFont;
-GrAfonts["smallboldfont"] = gi;
-gi.a1 = PI_ItalicFont;
-GrAfonts["smallitalicfont"] = gi;
-gi.a1 = PI_BoldItalicFont;
-GrAfonts["smallbolditalicfont"] = gi;
-gi.a2 = PI_LargeSizeFont;
-gi.a1 = PI_RomanFont;
-GrAfonts["bigfont"] = gi;
-GrAfonts["largefont"] = gi;
-gi.a1 = PI_BoldFont;
-GrAfonts["bigboldfont"] = gi;
-gi.a1 = PI_ItalicFont;
-GrAfonts["bigitalicfont"] = gi;
-GrAfonts["largeitalicfont"] = gi;
-gi.a1 = PI_BoldItalicFont;
-GrAfonts["bigbolditalicfont"] = gi;
-GrAfonts["largebolditalicfont"] = gi;
-gi.a2 = PI_HugeSizeFont;
-gi.a1 = PI_RomanFont;
-GrAfonts["hugefont"] = gi;
-gi.a1 = PI_BoldFont;
-GrAfonts["hugeboldfont"] = gi;
-gi.a1 = PI_ItalicFont;
-GrAfonts["hugeitalicfont"] = gi;
-gi.a1 = PI_BoldItalicFont;
-GrAfonts["hugebolditalicfont"] = gi;
-
-
-// Les markers 
-const char* mrkn[11] = { "dotmarker", "plusmarker", "crossmarker", 
-                         "circlemarker", "fcirclemarker", "boxmarker", "fboxmarker", 
-                         "trianglemarker", "ftrianglemarker", "starmarker", "fstarmarker"};
-PIMarker mrk[11] = { PI_DotMarker, PI_PlusMarker, PI_CrossMarker, 
-                     PI_CircleMarker, PI_FCircleMarker, PI_BoxMarker, PI_FBoxMarker, 
-                     PI_TriangleMarker, PI_FTriangleMarker, PI_StarMarker, PI_FStarMarker};
-
-gi.a2 = 0;
-gi.a1 = PI_NotDefMarker;
-GrAmarkers["defmarker"] = gi;
- 
-for(int j=0; j<11; j++) {
-  string smrk;
-  char buff[16];
-  for(int m=1; m<10; m+=2) {
-    sprintf(buff,"%d",m);
-    smrk = (string)mrkn[j] + (string)buff;
-    gi.a1 = mrk[j];  gi.a2 = m;
-    GrAmarkers[smrk] = gi;
-    }
-  }
-
-// Les tables de couleurs 
-gi.a2 = 0;
-gi.a1 = CMAP_OTHER;
-GrAcmap["defcmap"] = gi;
-for(int kcc=0; kcc<PIColorMap::NumberStandardColorMaps(); kcc++) {
-  gi.a1 = PIColorMap::GetStandardColorMapId(kcc);
-  string colname = PIColorMap::GetStandardColorMapName(kcc);
-  for(int jll=0; jll<colname.length(); jll++)
-    colname[jll] = tolower(colname[jll]);
-  GrAcmap[colname] = gi;
-}
-
-
-// La valeur de zoom
-gi.a2 = 0;
-gi.a1 = 0;
-GrAzoom["defzoom"] = gi;
-gi.a1 = 1;
-GrAzoom["zoomx1"] = gi;
-gi.a1 = 2;
-GrAzoom["zoomx2"] = gi;
-gi.a1 = 3;
-GrAzoom["zoomx3"] = gi;
-gi.a1 = 4;
-GrAzoom["zoomx4"] = gi;
-gi.a1 = 5;
-GrAzoom["zoomx5"] = gi;
-gi.a1 = -2;
-GrAzoom["zoom/2"] = gi;
-gi.a1 = -3;
-GrAzoom["zoom/3"] = gi;
-gi.a1 = -4;
-GrAzoom["zoom/4"] = gi;
-gi.a1 = -5;
-GrAzoom["zoom/5"] = gi;
-
-// Attributs d'axes
-gi.a2 = 0;
-gi.a1 = (int)(kBoxAxes | kExtTicks | kLabels);
-GrAaxes["stdaxes"] = gi;
-GrAaxes["defaxes"] = gi;
-GrAaxes["boxaxes"] = gi;
-gi.a1 = (int)kAxesDflt;
-GrAaxes["simpleaxes"] = gi;
-gi.a1 = (int)(kBoxAxes | kExtTicks | kLabels | kGridOn);
-GrAaxes["boxaxesgrid"] = gi;
-
-gi.a1 = (int)(kBoxAxes | kTicks | kLabels | kMinTicks | kMajTicks);
-GrAaxes["fineaxes"] = gi;
- gi.a1 = (int)(kBoxAxes | kTicks | kLabels | kMinTicks | kMajTicks | kGridOn);
-GrAaxes["grid"] = gi;
-GrAaxes["fineaxesgrid"] = gi;
-                
-}
 
 
