Index: trunk/SophyaPI/PIext/basexecut.cc
===================================================================
--- trunk/SophyaPI/PIext/basexecut.cc	(revision 2241)
+++ trunk/SophyaPI/PIext/basexecut.cc	(revision 2243)
@@ -13,4 +13,5 @@
 #include "nobjmgr.h"
 #include "servnobjm.h"
+#include "piyfxdrw.h"
 
 #include "histos.h"
@@ -70,9 +71,14 @@
 else if (kw == "newwin") {
   int nx=1, ny=1;
+  int sx=0, sy=0;
   //if(tokens.size() < 2) { cout << "Usage: newwin nx ny" << endl;  return(0); }
   if(tokens.size() > 0) nx = atoi(tokens[0].c_str());
   if(tokens.size() > 1) ny = atoi(tokens[1].c_str());
-  if (mImgApp) mImgApp->CreateGraphWin(nx, ny);
-  }  
+  if(tokens.size() > 3) { 
+    sx = atoi(tokens[2].c_str());
+    sy = atoi(tokens[3].c_str());
+  }
+  if (mImgApp) mImgApp->CreateGraphWin(nx, ny, sx, sy);
+}  
 else if (kw == "stacknext") mImgApp->StackWinNext(); 
 else if (kw == "graphicatt") {
@@ -98,4 +104,22 @@
   mImgApp->SetInsetLimits(xmin, xmax, ymin, ymax);
   }
+else if (kw == "drpanel") {
+  if (tokens.size() < 4) { 
+    cout << "Usage: drpanel xmin xmax ymin ymax [gratt] [name]" << endl;  
+    return(0); 
+  }
+  double xmin = atof(tokens[0].c_str());
+  double xmax = atof(tokens[1].c_str());
+  double ymin = atof(tokens[2].c_str());
+  double ymax = atof(tokens[3].c_str());
+  char buff[128];
+  sprintf(buff, "axesnone xylimits=%g,%g,%g,%g", xmin, xmax, ymin, ymax);
+  string sop = buff;
+  if (tokens.size() > 4) sop += tokens[4];
+  string name;
+  if (tokens.size() > 5) sop += tokens[5];
+  PIFuncDrawer* gdr = new PIFuncDrawer(NULL);
+  mImgApp->DispScDrawer(gdr, name, sop); 
+}
 else if (kw == "addtext") {
   if (tokens.size() < 3) { cout << "Usage: addtext x y txt [colfontatt]" << endl;  return(0); }
@@ -107,5 +131,6 @@
   mImgApp->AddText(txt, xp, yp, sop);
   }
-else if ((kw == "addline") || (kw == "addrect") || (kw == "addfrect")) {
+else if ((kw == "addline") || (kw == "addrect") || (kw == "addfrect") ||
+	 (kw == "addarrow") ) {
   if (tokens.size() < 4) { cout << "Usage: addline/addrect/addfrect x1 y1 x2 y2 [colatt]" << endl;  return(0); }
   double xp1 = atof(tokens[0].c_str());
@@ -115,10 +140,11 @@
   string sop;
   if (tokens.size() > 4) sop = tokens[4];
-  if (kw == "addline") mImgApp->AddLine(xp1, yp1, xp2, yp2, sop);
+  if (kw == "addline") mImgApp->AddLine(xp1, yp1, xp2, yp2, sop, false);
+  else if (kw == "addarrow") mImgApp->AddLine(xp1, yp1, xp2, yp2, sop, true);
   else {
     bool fgfill = (kw == "addrect") ? false : true;
     mImgApp->AddRectangle(xp1, yp1, xp2, yp2, sop, fgfill);
   }
-  }
+}
 else if ((kw == "addcirc") || (kw == "addfcirc")) {
   if (tokens.size() < 3) { cout << "Usage: addcirc/addfcirc xc yc r [colatt]" << endl;  return(0); }
@@ -131,4 +157,31 @@
   mImgApp->AddCircle(xc, yc, rad, sop, fgfill);
   }
+else if (kw == "addmarker") {
+  if (tokens.size() < 2) { 
+    cout << "Usage: addmarker x y [gratt]" << endl;  
+    return(0); 
+  }
+  double xm = atof(tokens[0].c_str());
+  double ym = atof(tokens[1].c_str());
+  string sop;
+  if (tokens.size() > 2) sop = tokens[2];
+  mImgApp->AddCircle(xm, ym, -1, sop, false);
+}
+else if ((kw == "addarc") || (kw == "addfarc") ) {
+  if (tokens.size() < 6) { 
+    cout << "Usage: addarc/addfarc x1 y1 x2 y2 x3 y3 [gratt]" << endl;  
+    return(0); 
+  }
+  double x1 = atof(tokens[0].c_str());
+  double y1 = atof(tokens[1].c_str());
+  double x2 = atof(tokens[2].c_str());
+  double y2 = atof(tokens[3].c_str());
+  double x3 = atof(tokens[4].c_str());
+  double y3 = atof(tokens[5].c_str());
+  string sop;
+  if (tokens.size() > 6) sop = tokens[6];
+  bool fgfill = (kw == "addarc") ? false : true;
+  mImgApp->AddArc(x1, y1, x2, y2, x3, y3, sop, fgfill);
+}
 
 
@@ -775,5 +828,7 @@
 mpiac->RegisterCommand(kw, usage, this, "Graphics");
 kw = "newwin";
-usage = "To Create a New Graphic window, with zones \n  Usage: newwin nx ny";
+usage = "To Create a New Graphic window, with zones \n";
+usage += "  Window size can be specified \n";
+usage += "    Usage: newwin [nx ny [sizeX sizeY]] ";
 usage += "\n  Related commands: zone";  
 mpiac->RegisterCommand(kw, usage, this, "Graphics");
@@ -819,4 +874,6 @@
 usage += ">> LogScale : linx liny logx logy -> Lin/Log Scales for 2D plots \n";
 usage += ">> xylimits=xmin,xmax,ymin,ymax  -> Forces X-Y limits in 2-D plots \n";
+usage += ">> defdrrect=xmin,xmax,ymin,ymax -> Defines drawing rectangle 2-D plots \n";
+ usage += "          The rectangle is defined as a fraction of the widget size\n";
 usage += ">> stat/nostat or stats/nostats -> Toggle statistic display flag \n";
 usage += ">> title/notitle or tit/notit -> Toggle Auto AddTitle flag \n";
@@ -846,58 +903,113 @@
 mpiac->RegisterCommand(kw, usage, this, "Graphics");
 
+kw = "drpanel";
+usage = "Creates a new 2D drawing zone for addtext, addline \n";
+usage += " Usage: drpanel xmin xmax ymin ymax [GrAtt] [Name]";
+usage += "\n  Related commands: addtext addline addrect addcirc ...";  
+mpiac->RegisterCommand(kw, usage, this, "Graphics");
+
 kw = "addtext";
 usage = "Adds a text string to the current graphic object";
-usage += "\n at the specified position (+ color and font attributes) ";
+usage += "\n at the specified position (+ color/font/pos/dir 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  Usage: addtext x y TextString [ColFontPosAtt]";
 usage += "\n  (use quotes '' for multi word text strings) ";
-usage += "\n  Related commands: addline addrect addfrect addcirc addfcirc settitle graphicatt";  
+usage += "\n Text position/direction attribute: "; 
+usage += "\n      horizleft horizcenter horizright";
+usage += "\n      vertbottom vertcenter verttop ";
+usage += "\n      textdirhoriz textdirvertup textdirvertdown ";
+usage += "\n  Related commands: addline addarrow addrect addfrect";
+usage += "\n      addcirc addfcirc addarc addfrac 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 at the specified position (+ graphic 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";  
+usage += "\n  Usage: addline x1 y1 x2 y2 [GraphicAtt]";
+usage += "\n  Related commands: addarrow addtext addrect addfrect ";
+usage += "\n       addmarker addcirc addfcirc addarc addfarc graphicatt";  
+mpiac->RegisterCommand(kw, usage, this, "Graphics");
+
+kw = "addarrow";
+usage = "Adds an arrow to the current graphic object";
+usage += "\n at the specified position (+ graphic attribute)";
+usage += "\n The Base/AxesDrawer is used to handle added lines"; 
+usage += "\n Alt<Z> to remove added elements";
+usage += "\n  Usage: addarrow x1 y1 x2 y2 [GraphicAtt]";
+usage += "\n  Related commands: addline addtext addrect addfrect ";
+usage += "\n       addmarker addcirc addfcirc addarc addfarc 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 between the specified positions (+ graphic 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";  
+usage += "\n  Usage: addrect x1 y1 x2 y2 [GraphicAtt]";
+usage += "\n  Related commands: addtext addline addarrow addfrect";
+usage += "\n       addcirc addfcirc addarc addfarc 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 between the specified positions (+ graphic 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";  
+usage += "\n  Usage: addfrect x1 y1 x2 y2 [GraphicAtt]";
+usage += "\n  Related commands: addtext addline addarrow addrect";
+usage += "\n       addcirc addfcirc graphicatt";  
+mpiac->RegisterCommand(kw, usage, this, "Graphics");
+
+kw = "addmarker";
+usage = "Adds a marker to the current graphic object";
+usage += "\n at the specified position (+ graphic attribute)";
+usage += "\n The Base/AxesDrawer is used to handle added circles"; 
+usage += "\n Alt<Z> to remove added elements";
+usage += "\n  Usage: addmarker xpos ypos [GraphicAtt]";
+usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
+usage += "\n       addcirc addfcirc addarc addfarc 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 with the specified center and radius (+ graphic 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";  
+usage += "\n  Usage: addcirc xcenter ycenter radius [GraphicAtt]";
+usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
+usage += "\n       addfcirc addarc addfarc 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 with the specified center and radius (+ graphic 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";  
+usage += "\n  Usage: addcirc xcenter ycenter radius [GraphicAtt]";
+usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
+usage += "\n       addcirc addarc addfarc graphicatt";  
+mpiac->RegisterCommand(kw, usage, this, "Graphics");
+
+kw = "addarc";
+usage = "Adds an arc to the current graphic object";
+usage += "\n defined by 3 points (+ graphic attribute)";
+usage += "\n The Base/AxesDrawer is used to handle added arcs"; 
+usage += "\n Alt<Z> to remove added elements";
+usage += "\n  Usage: addarc x1 y1 x2 y2 x3 y3 [GraphicAtt]";
+usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
+usage += "\n       addcirc addfcirc addfarc graphicatt";  
+mpiac->RegisterCommand(kw, usage, this, "Graphics");
+
+kw = "addfarc";
+usage = "Adds a filled arc to the current graphic object";
+usage += "\n defined by 3 points (+ graphic attribute)";
+usage += "\n The Base/AxesDrawer is used to handle added arcs"; 
+usage += "\n Alt<Z> to remove added elements";
+usage += "\n  Usage: addarc x1 y1 x2 y2 x3 y3 [GraphicAtt]";
+usage += "\n  Related commands: addtext addline addarrow addfrect addfrect";
+usage += "\n       addcirc addfcirc addfarc graphicatt";  
 mpiac->RegisterCommand(kw, usage, this, "Graphics");
 
Index: trunk/SophyaPI/PIext/piaversion.h
===================================================================
--- trunk/SophyaPI/PIext/piaversion.h	(revision 2241)
+++ trunk/SophyaPI/PIext/piaversion.h	(revision 2243)
@@ -2,5 +2,5 @@
 #define PIAPPVERSION_H_SEEN
 
-#define PIAPP_VERSIONNUMBER  3.62
+#define PIAPP_VERSIONNUMBER  3.65
 
 #endif
Index: trunk/SophyaPI/PIext/pistdimgapp.cc
===================================================================
--- trunk/SophyaPI/PIext/pistdimgapp.cc	(revision 2241)
+++ trunk/SophyaPI/PIext/pistdimgapp.cc	(revision 2243)
@@ -811,10 +811,13 @@
 ParseDisplayOption(sop, opts);
 PIGraphicAtt gratt(opts);
-elmgr->ElAddText(xp,yp,txt.c_str(), gratt);
+unsigned long tpd = 0;
+gratt.DecodeTextPosDirAtt(opts, tpd, false);
+elmgr->ElAddText(xp,yp,txt.c_str(), gratt, tpd);
 eld->Refresh();
 }
 
 /* --Methode-- */
-void PIStdImgApp::AddLine(double xp1, double yp1, double xp2, double yp2, string const& sop)
+void PIStdImgApp::AddLine(double xp1, double yp1, double xp2, double yp2, 
+			  string const& sop, bool fgarrow)
 {
 PIDrawer *eld=CurrentElDrawer();
@@ -831,5 +834,7 @@
 ParseDisplayOption(sop, opts);
 PIGraphicAtt gratt(opts);
-elmgr->ElAddLine(xp1, yp1, xp2, yp2, gratt);
+if (fgarrow) 
+  elmgr->ElAddArrow(xp1, yp1, xp2, yp2, gratt);
+else elmgr->ElAddLine(xp1, yp1, xp2, yp2, gratt);
 eld->Refresh();
 }
@@ -887,7 +892,33 @@
 ParseDisplayOption(sop, opts);
 PIGraphicAtt gratt(opts);
-
-if (fgfill) elmgr->ElAddFCirc(xc, yc, r, gratt);
-else elmgr->ElAddCirc(xc, yc, r, gratt);
+if (r < -0.5)
+  elmgr->ElAddMarker(xc, yc, gratt);
+else {
+  if (fgfill) elmgr->ElAddFCirc(xc, yc, r, gratt);
+  else elmgr->ElAddCirc(xc, yc, r, gratt);
+}
+eld->Refresh();
+}
+
+/* --Methode-- */
+void PIStdImgApp::AddArc(double x1, double y1, double x2, double y2,
+			 double x3, double y3, string const& sop, bool fgfill)
+{
+PIDrawer *eld=CurrentElDrawer();
+if (eld == NULL) return;
+PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld);
+PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld);
+if ((eld2 == NULL) && (eld3 == NULL)) return;
+PIElDrwMgr* elmgr = NULL;
+if (eld2) elmgr = &(eld2->ElDrwMgr());
+else if (eld3) elmgr = &(eld3->ElDrwMgr());
+if (elmgr == NULL) return;
+
+vector<string> opts;
+ParseDisplayOption(sop, opts);
+PIGraphicAtt gratt(opts);
+if (fgfill) 
+  elmgr->ElAddFArc(x1, y1, x2, y2, x3, y3, gratt);
+else  elmgr->ElAddArc(x1, y1, x2, y2, x3, y3, gratt);
 eld->Refresh();
 }
Index: trunk/SophyaPI/PIext/pistdimgapp.h
===================================================================
--- trunk/SophyaPI/PIext/pistdimgapp.h	(revision 2241)
+++ trunk/SophyaPI/PIext/pistdimgapp.h	(revision 2243)
@@ -68,9 +68,12 @@
      void AddText(string const & txt, double xp, double yp, string const& opt);
   //  Ajout de lignes, rectangles, cercles (provisoires - Aout 2001)
-     void AddLine(double xp1, double yp1, double xp2, double yp2, string const& opt);
+     void AddLine(double xp1, double yp1, double xp2, double yp2, 
+		  string const& opt, bool fgarrow=false);
      void AddRectangle(double xp1, double yp1, double xp2, double yp2, string const& opt, 
 		       bool fgfill=false);
      void AddCircle(double xc, double yc, double r, string const& opt, 
 		    bool fgfill=false);
+     void AddArc(double x1, double y1, double x2, double y2,
+		 double x3, double y3, string const& opt, bool fgfill=false);
 
   //  Fonction Ajout de titre de trace
