Index: trunk/SophyaPI/PI/pieldrw.h
===================================================================
--- trunk/SophyaPI/PI/pieldrw.h	(revision 2242)
+++ trunk/SophyaPI/PI/pieldrw.h	(revision 2262)
@@ -27,121 +27,148 @@
 
   // ---- Ajout de lignes
-  inline int    ElAddLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2)
-    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Line, x1, y1, x2, y2, NULL, gatt) ); }  
-  inline int    ElAddLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2, 
-			  PIGraphicAtt const & gatt)
-    { return( ElAdd(PIDEL_Line, x1, y1, x2, y2, NULL, gatt) ); }  
+  inline int    ElAddLine(double x1, double y1, double x2, double y2, bool fgsc=false)
+    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Line, x1, y1, x2, y2, NULL, gatt, 0, fgsc) ); }  
+  inline int    ElAddLine(double x1, double y1, double x2, double y2, 
+			  PIGraphicAtt const & gatt, bool fgsc=false)
+    { return( ElAdd(PIDEL_Line, x1, y1, x2, y2, NULL, gatt, 0, fgsc) ); }  
 
   // ---- Ajout de fleches 
-  inline int    ElAddArrow(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2)
-    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Arrow, x1, y1, x2, y2, NULL, gatt) ); }  
-  inline int    ElAddArrow(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2, 
-			   PIGraphicAtt const & gatt)
-    { return( ElAdd(PIDEL_Arrow, x1, y1, x2, y2, NULL, gatt) ); }  
+  inline int    ElAddArrow(double x1, double y1, double x2, double y2, bool fgsc=false)
+    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Arrow, x1, y1, x2, y2, NULL, gatt, 0, fgsc) ); }  
+  inline int    ElAddArrow(double x1, double y1, double x2, double y2, 
+			   PIGraphicAtt const & gatt, bool fgsc=false)
+    { return( ElAdd(PIDEL_Arrow, x1, y1, x2, y2, NULL, gatt, 0, fgsc) ); }  
 
   // ---- Ajout de marker 
-  inline int    ElAddMarker(PIGrCoord x, PIGrCoord y)
-    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Circ, x, y, 0, 0, NULL, gatt) ); }  
-  inline int    ElAddMarker(PIGrCoord x, PIGrCoord y, PIGraphicAtt const & gatt)
-    { return( ElAdd(PIDEL_Mark, x, y, 0, 0, NULL, gatt) ); }  
+  inline int    ElAddMarker(double x, double y, bool fgsc=false)
+    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Circ, x, y, 0, 0, NULL, gatt, 0, fgsc) ); }  
+  inline int    ElAddMarker(double x, double y, PIGraphicAtt const & gatt, bool fgsc=false)
+    { return( ElAdd(PIDEL_Mark, x, y, 0, 0, NULL, gatt, 0, fgsc) ); }  
 
   // ---- Ajout de texte
-  inline int    ElAddText(PIGrCoord x, PIGrCoord y, const char* s)
-    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Text, x, y, 0, 0, s, gatt) ); }  
-  inline int    ElAddText(PIGrCoord x, PIGrCoord y, const char* s, 
-			  PIGraphicAtt const & gatt, unsigned long tpd)
-    { return( ElAdd(PIDEL_Text, x, y, 0, 0, s, gatt, tpd) ); }  
-  inline int    ElAddText(PIGrCoord x, PIGrCoord y, string const & s)
-    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Text, x, y, 0, 0, s.c_str(), gatt) ); }  
-  inline int    ElAddText(PIGrCoord x, PIGrCoord y, string const & s, 
-			  PIGraphicAtt const & gatt, unsigned long tpd)
-    { return( ElAdd(PIDEL_Text, x, y, 0, 0, s.c_str(), gatt, tpd) ); }  
+  inline int    ElAddText(double x, double y, const char* s, bool fgsc=false)
+    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Text, x, y, 0, 0, s, gatt, 0, fgsc) ); }  
+  inline int    ElAddText(double x, double y, const char* s, 
+			  PIGraphicAtt const & gatt, unsigned long tpd, bool fgsc=false)
+    { return( ElAdd(PIDEL_Text, x, y, 0, 0, s, gatt, tpd, fgsc) ); }  
+  inline int    ElAddText(double x, double y, string const & s, bool fgsc=false)
+    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Text, x, y, 0, 0, s.c_str(), gatt, 0, fgsc) ); }  
+  inline int    ElAddText(double x, double y, string const & s, 
+			  PIGraphicAtt const & gatt, unsigned long tpd, bool fgsc=false)
+    { return( ElAdd(PIDEL_Text, x, y, 0, 0, s.c_str(), gatt, tpd, fgsc) ); }  
+
+  // ---- Ajout de texte composite avec exposant - indice
+  inline int    ElAddCompText(double x, double y, string const& s, string const& s_up,
+			      string const& s_dn, unsigned long tpd=0, bool fgsc=false)
+    { PIGraphicAtt gatt; 
+      return( ElAdd(x, y, s.c_str(), gatt, s_up.c_str(), s_dn.c_str(), NULL, tpd, fgsc) ); } 
+  inline int    ElAddCompText(double x, double y, string const& s, PIGraphicAtt const & gatt,
+			      string const& s_up, string const& s_dn, 
+			      unsigned long tpd=0, bool fgsc=false)
+    { return( ElAdd(x, y, s.c_str(), gatt, s_up.c_str(), s_dn.c_str(), NULL, tpd, fgsc) ); } 
+  inline int    ElAddCompText(double x, double y, string const& s, PIGraphicAtt const & gatt,
+			      string const& s_up, string const& s_dn, PIGraphicAtt const & attss,
+			      unsigned long tpd=0, bool fgsc=false)
+    { return( ElAdd(x, y, s.c_str(), gatt, s_up.c_str(), s_dn.c_str(), &attss, tpd, fgsc) ); } 
+  
 
   // ---- Ajout de rectangles 
-  inline int    ElAddRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy)
-    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Rect, x, y, dx, dy, NULL, gatt) ); }  
-  inline int    ElAddRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy, 
-			  PIGraphicAtt const & gatt)
-    { return( ElAdd(PIDEL_Rect, x, y, dx, dy, NULL, gatt) ); }  
-
-  inline int    ElAddFRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy)
-    { PIGraphicAtt gatt; return( ElAdd(PIDEL_FRect, x, y, dx, dy, NULL, gatt) ); }  
-  inline int    ElAddFRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy, 
-			   PIGraphicAtt const & gatt)
-    { return( ElAdd(PIDEL_FRect, x, y, dx, dy, NULL, gatt) ); }  
+  inline int    ElAddRect(double x, double y, double dx, double dy, bool fgsc=false)
+    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Rect, x, y, dx, dy, NULL, gatt, 0, fgsc) ); }  
+  inline int    ElAddRect(double x, double y, double dx, double dy, 
+			  PIGraphicAtt const & gatt, bool fgsc=false)
+    { return( ElAdd(PIDEL_Rect, x, y, dx, dy, NULL, gatt, 0, fgsc) ); }  
+
+  inline int    ElAddFRect(double x, double y, double dx, double dy, bool fgsc=false)
+    { PIGraphicAtt gatt; return( ElAdd(PIDEL_FRect, x, y, dx, dy, NULL, gatt, 0, fgsc) ); }  
+  inline int    ElAddFRect(double x, double y, double dx, double dy, 
+			   PIGraphicAtt const & gatt, bool fgsc=false)
+    { return( ElAdd(PIDEL_FRect, x, y, dx, dy, NULL, gatt, 0, fgsc) ); }  
 
   // ---- Ajout de cercles
-  inline int    ElAddCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r)
-    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Circ, x, y, r, r, NULL, gatt) ); }  
-  inline int    ElAddCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r, PIGraphicAtt const & gatt)
-    { return( ElAdd(PIDEL_Circ, x, y, r, r, NULL, gatt) ); }  
-
-  inline int    ElAddFCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r)
-    { PIGraphicAtt gatt; return( ElAdd(PIDEL_FCirc, x, y, r, r, NULL, gatt) ); }  
-  inline int    ElAddFCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r, PIGraphicAtt const & gatt)
-    { return( ElAdd(PIDEL_FCirc, x, y, r, r, NULL, gatt) ); }  
+  inline int    ElAddCirc(double x, double y, double r, bool fgsc=false)
+    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Circ, x, y, r, r, NULL, gatt, 0, fgsc) ); }  
+  inline int    ElAddCirc(double x, double y, double r, 
+			  PIGraphicAtt const & gatt, bool fgsc=false)
+    { return( ElAdd(PIDEL_Circ, x, y, r, r, NULL, gatt, 0, fgsc) ); }  
+
+  inline int    ElAddFCirc(double x, double y, double r, bool fgsc=false)
+    { PIGraphicAtt gatt; return( ElAdd(PIDEL_FCirc, x, y, r, r, NULL, gatt, 0, fgsc) ); }  
+  inline int    ElAddFCirc(double x, double y, double r, 
+			   PIGraphicAtt const & gatt, bool fgsc=false)
+    { return( ElAdd(PIDEL_FCirc, x, y, r, r, NULL, gatt, 0, fgsc) ); }  
 
   // ---- Ajout d' arcs 
-  inline int    ElAddArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2,
-			 PIGrCoord x3, PIGrCoord y3)
-    { PIGraphicAtt gatt; PIGrCoord x[3], y[3]; 
-      x[0] = x1; x[1] = x2; x[2] = x3; 
-      y[0] = y1; y[1] = y2; y[2] = y3; 
-      return( ElAdd(PIDEL_Arc, x, y, 3, gatt) ); }  
-
-  inline int    ElAddArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2,
-			 PIGrCoord x3, PIGrCoord y3, PIGraphicAtt const & gatt)
-    { PIGrCoord x[3], y[3]; 
-      x[0] = x1; x[1] = x2; x[2] = x3; 
-      y[0] = y1; y[1] = y2; y[2] = y3; 
-      return( ElAdd(PIDEL_Arc, x, y, 3, gatt) ); }  
-
-  inline int    ElAddFArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2,
-			  PIGrCoord x3, PIGrCoord y3)
-    { PIGraphicAtt gatt; PIGrCoord x[3], y[3]; 
-      x[0] = x1; x[1] = x2; x[2] = x3; 
-      y[0] = y1; y[1] = y2; y[2] = y3; 
-      return( ElAdd(PIDEL_FArc, x, y, 3, gatt) ); }  
-
-  inline int    ElAddFArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2,
-			  PIGrCoord x3, PIGrCoord y3, PIGraphicAtt const & gatt)
-    { PIGrCoord x[3], y[3]; 
-      x[0] = x1; x[1] = x2; x[2] = x3; 
-      y[0] = y1; y[1] = y2; y[2] = y3; 
-      return( ElAdd(PIDEL_FArc, x, y, 3, gatt) ); }  
+  inline int    ElAddArc(double x1, double y1, double x2, double y2,
+			 double x3, double y3, bool fgsc=false)
+    { PIGraphicAtt gatt; double x[3], y[3]; 
+      x[0] = x1; x[1] = x2; x[2] = x3; 
+      y[0] = y1; y[1] = y2; y[2] = y3; 
+      return( ElAdd(PIDEL_Arc, x, y, 3, gatt, fgsc) ); }  
+
+  inline int    ElAddArc(double x1, double y1, double x2, double y2,
+			 double x3, double y3, PIGraphicAtt const & gatt, bool fgsc=false)
+    { double x[3], y[3]; 
+      x[0] = x1; x[1] = x2; x[2] = x3; 
+      y[0] = y1; y[1] = y2; y[2] = y3; 
+      return( ElAdd(PIDEL_Arc, x, y, 3, gatt, fgsc) ); }  
+
+  inline int    ElAddFArc(double x1, double y1, double x2, double y2,
+			  double x3, double y3, bool fgsc=false)
+    { PIGraphicAtt gatt; double x[3], y[3]; 
+      x[0] = x1; x[1] = x2; x[2] = x3; 
+      y[0] = y1; y[1] = y2; y[2] = y3; 
+      return( ElAdd(PIDEL_FArc, x, y, 3, gatt, fgsc) ); }  
+
+  inline int    ElAddFArc(double x1, double y1, double x2, double y2,
+			  double x3, double y3, PIGraphicAtt const & gatt, bool fgsc=false)
+    { double x[3], y[3]; 
+      x[0] = x1; x[1] = x2; x[2] = x3; 
+      y[0] = y1; y[1] = y2; y[2] = y3; 
+      return( ElAdd(PIDEL_FArc, x, y, 3, gatt, fgsc) ); }  
 
   // ---- Ajout de polygones 
-  inline int    ElAddPoly(vector<PIGrCoord>& x, vector<PIGrCoord>& y)
-    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Poly, x, y, gatt) ); }  
-  inline int    ElAddPoly(vector<PIGrCoord>& x, vector<PIGrCoord>& y, PIGraphicAtt const & gatt)
-    { return( ElAdd(PIDEL_Poly, x, y, gatt) ); } 
+  inline int    ElAddPoly(vector<double>& x, vector<double>& y, bool fgsc=false)
+    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Poly, x, y, gatt, fgsc) ); }  
+  inline int    ElAddPoly(vector<double>& x, vector<double>& y, 
+			  PIGraphicAtt const & gatt, bool fgsc=false)
+    { return( ElAdd(PIDEL_Poly, x, y, gatt, fgsc) ); } 
  
-  inline int    ElAddFPoly(vector<PIGrCoord>& x, vector<PIGrCoord>& y)
-    { PIGraphicAtt gatt; return( ElAdd(PIDEL_FPoly, x, y, gatt) ); }  
-  inline int    ElAddFPoly(vector<PIGrCoord>& x, vector<PIGrCoord>& y, PIGraphicAtt const & gatt)
-
-    { return( ElAdd(PIDEL_FPoly, x, y, gatt) ); }  
+  inline int    ElAddFPoly(vector<double>& x, vector<double>& y, bool fgsc=false)
+    { PIGraphicAtt gatt; return( ElAdd(PIDEL_FPoly, x, y, gatt, fgsc) ); }  
+  inline int    ElAddFPoly(vector<double>& x, vector<double>& y, 
+			   PIGraphicAtt const & gatt, bool fgsc=false)
+
+    { return( ElAdd(PIDEL_FPoly, x, y, gatt, fgsc) ); }  
 
   void               ElDel(int id);
+  inline void        ElDelLast() { ElDel(mEn); }
   void               ElDelAll();
 
 protected:
-  int                ElAdd(int typ, PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy, 
+  int                ElAdd(int typ, double x, double y, double dx, double dy, 
                            const char* s, PIGraphicAtt const & att,
-			   unsigned long txtposdir=0);
-  int                ElAdd(int typ, vector<PIGrCoord>& x, vector<PIGrCoord>& y, 
-			   PIGraphicAtt const & att);
-  int                ElAdd(int typ, PIGrCoord* x, PIGrCoord* y, int n,
-			   PIGraphicAtt const & att);
+			   unsigned long txtposdir, bool fgsc);
+  int		     ElAdd(double x, double y, const char* s, PIGraphicAtt const & att, 
+			   const char* s_up, const char* s_dn, PIGraphicAtt const * gass, 
+			   unsigned long tpd, bool fgsc);
+
+  int                ElAdd(int typ, vector<double>& x, vector<double>& y, 
+			   PIGraphicAtt const & att, bool fgsc);
+  int                ElAdd(int typ, double* x, double* y, int n,
+			   PIGraphicAtt const & att, bool fgsc);
 
   struct TxtEl {
     string txt;
     unsigned long txtpd;
+    string* txt_up;
+    string* txt_dn;
+    PIGraphicAtt* attss;
   };
 
   struct DrwEl{
     int eid, etyp;
-    PIGrCoord ex,ey;
-    PIGrCoord edx,edy;
+    double ex,ey;
+    double edx,edy;
     PIGraphicAtt gatt;
     TxtEl* es;
@@ -149,4 +176,5 @@
     PIGrCoord* ypol;
     int npol;
+    bool scc;  // true -> scale coordinate (user-coord : 0..1 1
   };
 
@@ -160,5 +188,5 @@
 {
 public:
-                     PIElDrawer();
+                     PIElDrawer(bool fgclip=true);
   virtual           ~PIElDrawer();
 
@@ -184,7 +212,8 @@
 // -- Pour compatibilite avec l'interface precedente , Reza 08/2002 
   inline void        ElDel(int id) { eltsMgr.ElDel(id); }
+  inline void        ElDelLast()   { eltsMgr.ElDelLast(); }
   inline void        ElDelAll()    { eltsMgr.ElDelAll(); }
   
-  inline int	     ElAddText(PIGrCoord x, PIGrCoord y, const char* s)
+  inline int	     ElAddText(double x, double y, const char* s)
                                    { return eltsMgr.ElAddText(x, y, s); }
 
@@ -197,5 +226,5 @@
   PIGraphicAtt labelAtt;       // Attributs graphiques de trace de label d'axes
   bool showAxesLabels;         // Affichage des labels d'axes si true
-
+  bool fgClip;                 // Si true, appel a PIGraphicUC::Clip() ds Draw()
 };
 
