Index: /trunk/SophyaPI/PIext/basexecut.cc
===================================================================
--- /trunk/SophyaPI/PIext/basexecut.cc	(revision 1641)
+++ /trunk/SophyaPI/PIext/basexecut.cc	(revision 1642)
@@ -98,22 +98,52 @@
   }
 else if (kw == "addtext") {
-  if (tokens.size() < 4) { cout << "Usage: addtext x y colfontatt txt" << endl;  return(0); }
+  if (tokens.size() < 3) { cout << "Usage: addtext x y txt [colfontatt]" << endl;  return(0); }
   double xp = atof(tokens[0].c_str());
   double yp = atof(tokens[1].c_str());
-  bool fgsr = true;
-  string txt = tokens[3];
-  for(int k=4; k<(int)tokens.size(); k++) txt += (' ' + tokens[k]);
-  //int opt = mObjMgr->GetServiceObj()->DecodeDispOption(tokens[2], fgsr);
+  string txt = tokens[2];
+  bool fgsr = false;
+  if (tokens.size() > 3) 
+    mObjMgr->GetServiceObj()->DecodeDispOption(tokens[3], fgsr);
   mImgApp->AddText(txt, xp, yp);
   if (fgsr) mImgApp->RestoreGraphicAtt(); 
   }
+else if ((kw == "addline") || (kw == "addrect") || (kw == "addfrect")) {
+  if (tokens.size() < 4) { cout << "Usage: addline/addrect/addfrect x1 y1 x2 y2 [colatt]" << endl;  return(0); }
+  double xp1 = atof(tokens[0].c_str());
+  double yp1 = atof(tokens[1].c_str());
+  double xp2 = atof(tokens[2].c_str());
+  double yp2 = atof(tokens[3].c_str());
+  bool fgsr = false;
+  if (tokens.size() > 4) 
+   mObjMgr->GetServiceObj()->DecodeDispOption(tokens[4], fgsr);
+  if (kw == "addline") mImgApp->AddLine(xp1, yp1, xp2, yp2);
+  else {
+    bool fgfill = (kw == "addrect") ? false : true;
+    mImgApp->AddRectangle(xp1, yp1, xp2, yp2, fgfill);
+  }
+  if (fgsr) mImgApp->RestoreGraphicAtt(); 
+  }
+else if ((kw == "addcirc") || (kw == "addfcirc")) {
+  if (tokens.size() < 3) { cout << "Usage: addcirc/addfcirc xc yc r [colatt]" << endl;  return(0); }
+  double xc = atof(tokens[0].c_str());
+  double yc = atof(tokens[1].c_str());
+  double rad = atof(tokens[2].c_str());
+  bool fgsr = false;
+  if (tokens.size() > 3) 
+    mObjMgr->GetServiceObj()->DecodeDispOption(tokens[3], fgsr);
+  bool fgfill = (kw == "addcirc") ? false : true;
+  mImgApp->AddCircle(xc, yc, rad, fgfill);
+  if (fgsr) mImgApp->RestoreGraphicAtt(); 
+  }
+
+
 else if (kw == "settitle") {
-  if (tokens.size() < 2) { cout << "Usage: addtitle fontatt titleup " << endl;  return(0); }
+  if (tokens.size() < 1) { cout << "Usage: settitle TopTitle [BotTitle] [fontatt]" << endl;  return(0); }
   bool fgsr = true;
-  //int opt = mObjMgr->GetServiceObj()->DecodeDispOption(tokens[0], fgsr);
-  string txt = tokens[1];
-  for(int k=2; k<(int)tokens.size(); k++) txt += (' ' + tokens[k]);
-  string td = "";
-  mImgApp->SetTitle(txt, td);
+  if (tokens.size() > 2)
+    mObjMgr->GetServiceObj()->DecodeDispOption(tokens[2], fgsr);
+  if (tokens.size() < 2)
+    tokens.push_back("");
+  mImgApp->SetTitle(tokens[0], tokens[1]);
   if (fgsr) mImgApp->RestoreGraphicAtt(); 
   }
@@ -744,6 +774,7 @@
 usage += "att_list=def back to default values, Example: gratt red,circlemarker5";
 usage += "\n ------------------ Graphic attribute list ------------------ \n";
-usage += ">> Colors: defcol black white grey red blue green yellow magenta cyan \n";
-usage += "           turquoise navyblue orange siennared purple limegreen gold \n";
+usage += ">> Colors: defcol black white grey red blue green yellow \n";
+usage += "           magenta cyan turquoise navyblue orange siennared purple \n";
+usage += "           limegreen gold violet violetred blueviolet darkviolet \n";
 usage += ">> Lines:  defline normalline thinline thickline dashedline thindashedline \n";
 usage += "           thickdashedline dottedline thindottedline thickdottedline \n";
@@ -796,12 +827,61 @@
 kw = "addtext";
 usage = "Adds a text string to the current graphic object";
-usage += "\n at the specified position (Gr-Object Coordinate) with graphic attribute specification";
-usage += "\n  Usage: addtext x y ColFontAtt TextString";
-usage += "\n  Related commands: settitle graphicatt";  
+usage += "\n at the specified position (+ color and font attributes) ";
+usage += "\n The Base/AxesDrawer is used to handle added text strings" ;
+usage += "\n Alt<Z> to remove added elements";
+usage += "\n Font attribute is common with axes";
+usage += "\n  Usage: addtext x y TextString [ColFontAtt]";
+usage += "\n  (use quotes '' for multi word text strings) ";
+usage += "\n  Related commands: addline addrect addfrect addcirc addfcirc settitle graphicatt";  
 mpiac->RegisterCommand(kw, usage, this, "Graphics");
 
+kw = "addline";
+usage = "Adds a line to the current graphic object";
+usage += "\n at the specified position (+ color attribute)";
+usage += "\n The Base/AxesDrawer is used to handle added lines"; 
+usage += "\n Alt<Z> to remove added elements";
+usage += "\n  Usage: addline x1 y1 x2 y2 [ColAtt]";
+usage += "\n  Related commands: addtext addrect addfrect addcirc addfcirc graphicatt";  
+mpiac->RegisterCommand(kw, usage, this, "Graphics");
+
+kw = "addrect";
+usage = "Adds a rectangle to the current graphic object";
+usage += "\n between the specified positions (+ color attribute)";
+usage += "\n The Base/AxesDrawer is used to handle added rectangle"; 
+usage += "\n Alt<Z> to remove added elements";
+usage += "\n  Usage: addrect x1 y1 x2 y2 [ColAtt]";
+usage += "\n  Related commands: addtext addline addfrect addcirc addfcirc graphicatt";  
+mpiac->RegisterCommand(kw, usage, this, "Graphics");
+
+kw = "addfrect";
+usage = "Adds a filled rectangle to the current graphic object";
+usage += "\n between the specified positions (+ color attribute)";
+usage += "\n The Base/AxesDrawer is used to handle added rectangle"; 
+usage += "\n Alt<Z> to remove added elements";
+usage += "\n  Usage: addfrect x1 y1 x2 y2 [ColAtt]";
+usage += "\n  Related commands: addtext addline addrect addcirc addfcirc graphicatt";  
+mpiac->RegisterCommand(kw, usage, this, "Graphics");
+
+kw = "addcirc";
+usage = "Adds a circle to the current graphic object";
+usage += "\n with the specified center and radius (+ color attribute)";
+usage += "\n The Base/AxesDrawer is used to handle added circles"; 
+usage += "\n Alt<Z> to remove added elements";
+usage += "\n  Usage: addcirc xcenter ycenter radius [ColAtt]";
+usage += "\n  Related commands: addtext addline addfrect addfrect addfcirc graphicatt";  
+mpiac->RegisterCommand(kw, usage, this, "Graphics");
+
+kw = "addfcirc";
+usage = "Adds a filled circle to the current graphic object";
+usage += "\n with the specified center and radius (+ color attribute)";
+usage += "\n The Base/AxesDrawer is used to handle added circles"; 
+usage += "\n Alt<Z> to remove added elements";
+usage += "\n  Usage: addcirc xcenter ycenter radius [ColAtt]";
+usage += "\n  Related commands: addtext addline addfrect addfrect addcirc graphicatt";  
+mpiac->RegisterCommand(kw, usage, this, "Graphics");
+
 kw = "settitle";
-usage = "Set the title string (top title) for the current graphic object";
-usage += "\n  Usage: settitle FontAtt TopTitle";
+usage = "Set the title string (top title / bottom title) for the current graphic object";
+usage += "\n  Usage: settitle TopTitle [BottomTitle] [fontAtt]";
 usage += "\n  Related commands: addtext graphicatt";  
 mpiac->RegisterCommand(kw, usage, this, "Graphics");
Index: /trunk/SophyaPI/PIext/pistdimgapp.cc
===================================================================
--- /trunk/SophyaPI/PIext/pistdimgapp.cc	(revision 1641)
+++ /trunk/SophyaPI/PIext/pistdimgapp.cc	(revision 1642)
@@ -661,6 +661,80 @@
 void PIStdImgApp::AddText(string const & txt, double xp, double yp)
 {
-if (!mLastWdg)  return;
+PIElDrawer *eld=CurrentElDrawer();
+if (eld == NULL) return;
+
+if ( (mFSz != PI_NotDefFontSize) && (mFAtt != PI_NotDefFontAtt) ) 
+  eld->SetFontAtt(mFSz, mFAtt); 
+if ( mFName != PI_DefaultFont ) 
+  eld->SetFont(mFName, eld->GetFontSz(), eld->GetFontAtt());
+eld->ElAddText(xp,yp,txt.c_str(),mFCol);
+eld->Refresh();
+}
+
+/* --Methode-- */
+void PIStdImgApp::AddLine(double xp1, double yp1, double xp2, double yp2)
+{
+PIElDrawer *eld=CurrentElDrawer();
+if (eld == NULL) return;
+
+eld->ElAddLine(xp1, yp1, xp2, yp2, mFCol);
+eld->Refresh();
+}
+
+/* --Methode-- */
+void PIStdImgApp::AddRectangle(double xp1, double yp1, double xp2, double yp2, bool fgfill)
+{
+PIElDrawer *eld=CurrentElDrawer();
+if (eld == NULL) return;
+
+double xp,yp;
+double dx, dy;
+if (xp1 < xp2) {
+  xp = xp1; dx = xp2-xp1;
+}
+else {
+  xp = xp2; dx = xp1-xp2;
+}
+if (yp1 < yp2) {
+  yp = yp1; dy = yp2-yp1;
+}
+else {
+  yp = yp2; dy = yp1-yp2;
+}
+if (fgfill) eld->ElAddFRect(xp, yp, dx, dy, mFCol);
+else eld->ElAddRect(xp, yp, dx, dy, mFCol);
+eld->Refresh();
+}
+
+/* --Methode-- */
+void PIStdImgApp::AddCircle(double xc, double yc, double r, bool fgfill)
+{
+PIElDrawer *eld=CurrentElDrawer();
+if (eld == NULL) return;
+
+if (fgfill) eld->ElAddFCirc(xc, yc, r, mFCol);
+else eld->ElAddCirc(xc, yc, r, mFCol);
+eld->Refresh();
+}
+
+/* --Methode-- */
+void PIStdImgApp::SetTitle(string const & titletop, string const & titlebottom)
+{
+PIElDrawer *eld=CurrentElDrawer();
+if (eld == NULL) return;
+
+if ( (mFSz != PI_NotDefFontSize) && (mFAtt != PI_NotDefFontAtt) ) 
+  eld->SetFontAtt(mFSz, mFAtt); 
+if ( mFName != PI_DefaultFont ) 
+  eld->SetFont(mFName, eld->GetFontSz(), eld->GetFontAtt());
+eld->SetTitles(titletop, titlebottom);
+eld->Refresh();
+}
+
+/* --Methode-- */
+PIElDrawer* PIStdImgApp::CurrentElDrawer()
+{
 PIElDrawer *eld=NULL;
+if (!mLastWdg)  return(eld);
 PIScDrawWdg* sdw=NULL;
 PIDraw3DWdg* w3d=NULL;
@@ -677,44 +751,10 @@
   case PIImage::ClassId :
     imgw = dynamic_cast<PIImage *>(mLastWdg);
-    if (imgw) eld = imgw->MyElDrawer();
+    if (imgw) eld = imgw->BaseDrawer();
     break;
   default :
     break;
   }
-if (eld) { 
-  if ( (mFSz != PI_NotDefFontSize) && (mFAtt != PI_NotDefFontAtt) )     eld->SetFontAtt(mFSz, mFAtt); 
-  eld->ElAddText(xp,yp,txt.c_str(),mFCol);
-  eld->Refresh();
-  }
-}
-/* --Methode-- */
-void PIStdImgApp::SetTitle(string const & titletop, string const & titlebottom)
-{
-if (!mLastWdg)  return;
-PIElDrawer *eld=NULL;
-PIScDrawWdg* sdw=NULL;
-PIDraw3DWdg* w3d=NULL;
-PIImage* imgw;
-switch(mLastWdg->kind()) {
-  case PIScDrawWdg::ClassId :
-    sdw = dynamic_cast<PIScDrawWdg *>(mLastWdg);
-    if (sdw) eld = sdw->BaseDrawer();
-    break;
-  case PIDraw3DWdg::ClassId :
-    w3d = dynamic_cast<PIDraw3DWdg *>(mLastWdg);
-    if (w3d) eld = w3d->BaseDrawer();
-    break;
-  case PIImage::ClassId :
-    imgw = dynamic_cast<PIImage *>(mLastWdg);
-    if (imgw) eld = imgw->MyElDrawer();
-    break;
-  default :
-    break;
-  }
-if (eld) { 
-  if ( (mFSz != PI_NotDefFontSize) && (mFAtt != PI_NotDefFontAtt) )     eld->SetFontAtt(mFSz, mFAtt); 
-  eld->SetTitles(titletop, titlebottom);
-  eld->Refresh();
-  }
+return(eld);
 }
 
Index: /trunk/SophyaPI/PIext/pistdimgapp.h
===================================================================
--- /trunk/SophyaPI/PIext/pistdimgapp.h	(revision 1641)
+++ /trunk/SophyaPI/PIext/pistdimgapp.h	(revision 1642)
@@ -51,9 +51,16 @@
      int  Disp3DDrawer(PIDrawer3D* scd, string const & name, int opt, string title="", int oid=0);
 
-  //  Fonction d'ajout de texte (provisoire - Aout 99)
+  //  Fonction d'ajout de texte (provisoire - Aout 99) 
      void AddText(string const & txt, double xp, double yp);
+  //  Ajout de lignes, rectangles, cercles (provisoires - Aout 2001)
+     void AddLine(double xp1, double yp1, double xp2, double yp2);
+     void AddRectangle(double xp1, double yp1, double xp2, double yp2, bool fgfill=false);
+     void AddCircle(double xc, double yc, double r, bool fgfill=false);
+
   //  Fonction Ajout de titre de trace
      void SetTitle(string const & titleup, string const & titledown);
 
+  //  Acces au BaseDrawer (PIElDrawer) du PIBaseWdg courant
+     PIElDrawer* CurrentElDrawer();
 
      void CreateGraphWin(int nx=1, int ny=1, int sx=0, int sy = 0);
Index: /trunk/SophyaPI/PIext/servnobjm.cc
===================================================================
--- /trunk/SophyaPI/PIext/servnobjm.cc	(revision 1641)
+++ /trunk/SophyaPI/PIext/servnobjm.cc	(revision 1642)
@@ -1515,4 +1515,12 @@
 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
