Index: /trunk/SophyaPI/PI/pigraphgen.cc
===================================================================
--- /trunk/SophyaPI/PI/pigraphgen.cc	(revision 2256)
+++ /trunk/SophyaPI/PI/pigraphgen.cc	(revision 2257)
@@ -317,8 +317,8 @@
 int PIGraphicGen::ComputeArcFrom3Pt(double x1, double y1, double x2, double y2,
 				    double x3, double y3, double& x0, double& y0, 
-				    double& dx, double& dy, double& degdeb, double& degfin)
+				    double& dx, double& dy, double& degdeb, double& deltadeg)
 {
   x0 = y0 = dx = dy = 0.;
-  degdeb = degfin = 0.;
+  degdeb = deltadeg = 0.;
   double px[2], py[2];
   cout << "DBG - Arc3Pt" << x1 << "," << y1 << " - "
@@ -389,14 +389,41 @@
   double r = sqrt(delx*delx+dely*dely);
   double ang1 = atan2(dely, delx);
-  delx = x3-xc; 
-  dely = y3-yc; 
-  double ang2 = atan2(dely, delx);
+  double delx2 = x3-xc; 
+  double dely2 = y3-yc; 
+  double ang2 = atan2(dely2, delx2);
+  // angle M1-O-M3 : Produit scalaire OM1 . OM3 
+  double cda = (delx*delx2+dely*dely2)/sqrt(delx*delx+dely*dely)/sqrt(delx2*delx2+dely2*dely2);
+  double dang = acos(cda);
+  // angle M1-O-M3 : Produit vectoriel OM1 X OM3 - Signe de l'angle deltaAngle
+  double sda = (delx*dely2-dely*delx2);
+  // Produit scalaire (OM1 + OM3) . OM2 : deltaAngle ou 2*PI-DeltaAngle
+  delx = (x1+x3)-xc; 
+  dely = (y1+y3)-yc;
+  double daopi = (delx*delx2+dely*dely2)/sqrt(delx*delx+dely*dely)/sqrt(delx2*delx2+dely2*dely2);
+  if (sda >= 0.) {
+    if (daopi < 0.) { 
+      degdeb = ang2*180./M_PI;    
+      deltadeg = (360.-dang*180./M_PI);
+    }
+    else {
+      degdeb = ang1*180./M_PI;    
+      deltadeg = dang*180./M_PI;
+    }
+  }
+  else {
+    if (daopi < 0.) { 
+      degdeb = ang1*180./M_PI;    
+      deltadeg = (360.-dang*180./M_PI);
+    }
+    else {
+      degdeb = ang2*180./M_PI;    
+      deltadeg = dang*180./M_PI;
+    }
+  }
   x0 = (xc-r);
   y0 = (yc-r);
   dx = dy = 2.*r;
-  degdeb = -ang1*180./M_PI;
-  degfin = -ang2*180./M_PI;
   cout << "DBG - Arc3Pt-2  " << xc << "," << yc << " R=" << r << " deg= "
-       << degdeb << " :: " << degfin << endl;
+       << degdeb << " Delta= " << deltadeg << endl;
   return(0);
 }
Index: /trunk/SophyaPI/PI/pigraphgen.h
===================================================================
--- /trunk/SophyaPI/PI/pigraphgen.h	(revision 2256)
+++ /trunk/SophyaPI/PI/pigraphgen.h	(revision 2257)
@@ -100,7 +100,7 @@
   virtual void       DrawFPolygon(PIGrCoord *x, PIGrCoord *y, int n, bool cinc=true)   = 0;  
   virtual void       DrawArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy,
-                             double degdeb, double degfin)                             = 0;
+                             double degdeb, double deltadeg)                           = 0;
   virtual void       DrawFArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy, 
-                              double degdeb, double degfin)                            = 0;
+                              double degdeb, double deltadeg)                          = 0;
 
   virtual void       Draw3PtArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2,
Index: /trunk/SophyaPI/PI/pigraphmac.cc
===================================================================
--- /trunk/SophyaPI/PI/pigraphmac.cc	(revision 2256)
+++ /trunk/SophyaPI/PI/pigraphmac.cc	(revision 2257)
@@ -164,5 +164,5 @@
 /* --Methode-- */
 void PIGraphicMac::DrawArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy, 
-                         double degdeb, double degfin)
+                         double degdeb, double deltadeg)
 {
   if (mPane->FocusDraw()) {
@@ -170,5 +170,5 @@
     if (rr.top  > rr.bottom) swap(rr.top,  rr.bottom);
     if (rr.left > rr.right)  swap(rr.left, rr.right);
-    ::FrameArc(&rr, degdeb, degfin-degdeb);
+    ::FrameArc(&rr, degdeb, deltadeg);
   }
 }
@@ -176,5 +176,5 @@
 /* --Methode-- */
 void PIGraphicMac::DrawFArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy, 
-                         double degdeb, double degfin)
+                         double degdeb, double deltadeg)
 {
   if (mPane->FocusDraw()) {
@@ -182,5 +182,5 @@
     if (rr.top  > rr.bottom) swap(rr.top,  rr.bottom);
     if (rr.left > rr.right)  swap(rr.left, rr.right);
-    ::PaintArc(&rr, degdeb, degfin-degdeb);
+    ::PaintArc(&rr, degdeb, deltadeg);
   }
 }
Index: /trunk/SophyaPI/PI/pigraphmac.h
===================================================================
--- /trunk/SophyaPI/PI/pigraphmac.h	(revision 2256)
+++ /trunk/SophyaPI/PI/pigraphmac.h	(revision 2257)
@@ -30,7 +30,7 @@
   virtual void       DrawFPolygon(PIGrCoord *x, PIGrCoord *y, int n, bool cinc=true);  
   virtual void       DrawArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy,
-                             double degdeb, double degfin);
+                             double degdeb, double deltadeg);
   virtual void       DrawFArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy, 
-                              double degdeb, double degfin);
+                              double degdeb, double deltadeg);
   virtual void       DrawMarker(PIGrCoord x0, PIGrCoord y0);
   virtual void       DrawMarkers(PIGrCoord *x, PIGrCoord *y, int n);
Index: /trunk/SophyaPI/PI/pigraphps.cc
===================================================================
--- /trunk/SophyaPI/PI/pigraphps.cc	(revision 2256)
+++ /trunk/SophyaPI/PI/pigraphps.cc	(revision 2257)
@@ -197,5 +197,5 @@
 {
 if(mPSOut)
-  mPSOut->DrawFCircle((double)x0,(double)y0,(double)r,mFCol,mFCol,mLAtt);
+  mPSOut->DrawFCircle((double)x0,(double)y0,(double)r,mFCol,mFCol);
 return;
 }
@@ -204,5 +204,7 @@
 void PIGraphicPS::DrawOval(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy)
 {
-// $CHECK$ Reza/ Nicolas  12 Nov 98 - A faire
+if(mPSOut)
+  mPSOut->DrawArc((double)x0,(double)y0,(double)dx,(double)dy,0.,360.,mFCol,mLAtt);
+return;
 }
 
@@ -210,5 +212,8 @@
 void PIGraphicPS::DrawFOval(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy)
 {
-// $CHECK$ Reza/ Nicolas  12 Nov 98 - A faire
+if(mPSOut)
+  mPSOut->DrawFArc((double)x0,(double)y0,(double)dx,(double)dy,0.,360.,mFCol,mFCol);
+return;
+
 }
 
@@ -271,13 +276,17 @@
 
 /* --Methode-- */
-void PIGraphicPS::DrawArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy,double degdeb, double degfin)
-{
-// $CHECK$ Reza/ Nicolas  12 Nov 98 - A faire
-}
-
-/* --Methode-- */
-void PIGraphicPS::DrawFArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy,double degdeb, double degfin)
-{
-// $CHECK$ Reza/ Nicolas  12 Nov 98 - A faire
+void PIGraphicPS::DrawArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy,double degdeb, double deltadeg)
+{
+if(mPSOut)
+  mPSOut->DrawArc((double)x0,(double)y0,(double)dx,(double)dy,degdeb,deltadeg,mFCol,mLAtt);
+return;
+}
+
+/* --Methode-- */
+void PIGraphicPS::DrawFArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy,double degdeb, double deltadeg)
+{
+if(mPSOut)
+  mPSOut->DrawFArc((double)x0,(double)y0,(double)dx,(double)dy,degdeb,deltadeg,mFCol,mFCol);
+return;
 }
 
@@ -287,18 +296,4 @@
 if(mPSOut)
   mPSOut->DrawMarker((double)x0,(double)y0,mMrk,mFCol,mMrkSz);
-// $CHECK$ Ajouter starmarker
-// /* Coordonnees pour une etoile a 5 branches */
-// double pio5 = M_PI/2.5;  
-// double pio52 = pio5/2.;
-// double cpi2 = M_PI/2.-pio5;  
-// double re = 1.2;  // Rayon externe
-// double ri = 0.5; //  rayon interne pour rext=1.2
-// for(int k=0; k<5; k++) {
-//  starcoordx[2*k] = cos(k*pio5+cpi2)*re;
-//  starcoordy[2*k] = -sin(k*pio5+cpi2)*re;
-//  starcoordx[2*k+1] = cos(k*pio5+pio52+cpi2)*ri;
-//  starcoordy[2*k+1] = -sin(k*pio5+pio52+cpi2)*ri;
-//  }
-
 return;
 }
Index: /trunk/SophyaPI/PI/pigraphps.h
===================================================================
--- /trunk/SophyaPI/PI/pigraphps.h	(revision 2256)
+++ /trunk/SophyaPI/PI/pigraphps.h	(revision 2257)
@@ -33,7 +33,7 @@
   virtual void       DrawFPolygon(PIGrCoord *x, PIGrCoord *y, int n, bool cinc=true);  
   virtual void       DrawArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy,
-                             double degdeb, double degfin);
+                             double degdeb, double deltadeg);
   virtual void       DrawFArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy, 
-                              double degdeb, double degfin);
+                              double degdeb, double deltadeg);
   virtual void       DrawMarker(PIGrCoord x0, PIGrCoord y0);
   virtual void       DrawMarkers(PIGrCoord *x, PIGrCoord *y, int n);
Index: /trunk/SophyaPI/PI/pigraphuc.cc
===================================================================
--- /trunk/SophyaPI/PI/pigraphuc.cc	(revision 2256)
+++ /trunk/SophyaPI/PI/pigraphuc.cc	(revision 2257)
@@ -631,5 +631,5 @@
 /* --Methode-- */
 void PIGraphicUC::DrawArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy,
-                          double degdeb, double degfin)
+                          double degdeb, double deltadeg)
 {
   if (!mGrC) return;
@@ -638,9 +638,9 @@
   UC2GrC(x0, y0, xf, yf);
   DUC2GrC(dx, dy, dxf, dyf);
-  mGrC->DrawArc(xf, yf, dxf, dyf, degdeb, degfin);
+  mGrC->DrawArc(xf, yf, dxf, dyf, degdeb, deltadeg);
 }
 /* --Methode-- */
 void PIGraphicUC::DrawFArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy,
-                           double degdeb, double degfin)
+                           double degdeb, double deltadeg)
 {
   if (!mGrC) return;
@@ -649,5 +649,5 @@
   UC2GrC(x0, y0, xf, yf);
   DUC2GrC(dx, dy, dxf, dyf);
-  mGrC->DrawFArc(xf, yf, dxf, dyf, degdeb, degfin);
+  mGrC->DrawFArc(xf, yf, dxf, dyf, degdeb, deltadeg);
 }
 
Index: /trunk/SophyaPI/PI/pigraphuc.h
===================================================================
--- /trunk/SophyaPI/PI/pigraphuc.h	(revision 2256)
+++ /trunk/SophyaPI/PI/pigraphuc.h	(revision 2257)
@@ -65,17 +65,11 @@
   virtual void       DrawFPolygon(PIGrCoord *x, PIGrCoord *y, int n, bool cinc=true); 
   virtual void       DrawArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy,
-                             double degdeb, double degfin);
+                             double degdeb, double deltadeg);
   virtual void       DrawFArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy, 
-                              double degdeb, double degfin);
+                              double degdeb, double deltadeg);
   virtual void       Draw3PtArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2,
 				PIGrCoord x3, PIGrCoord y3);
   virtual void       Draw3PtFArc(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2,
 				 PIGrCoord x3, PIGrCoord y3);
-  static  int        ComputeArcFrom3Pt(PIGrCoord& x1, PIGrCoord& y1, 
-				       PIGrCoord& x2, PIGrCoord& y2,
-				       PIGrCoord& x3, PIGrCoord& y3,
-				       PIGrCoord& x0, PIGrCoord& y0, 
-				       PIGrCoord& dx, PIGrCoord& dy,
-				       double& degdeb, double& degfin);
  
   virtual void       DrawMarker(PIGrCoord x0, PIGrCoord y0);
Index: /trunk/SophyaPI/PI/pigraphx.cc
===================================================================
--- /trunk/SophyaPI/PI/pigraphx.cc	(revision 2256)
+++ /trunk/SophyaPI/PI/pigraphx.cc	(revision 2257)
@@ -261,8 +261,10 @@
 /* --Methode-- */
 void PIGraphicX::DrawArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy, 
-                         double degdeb, double degfin)
-{
+                         double degdeb, double deltadeg)
+{
+// Convention X est ds le sens trigo inverse
+degdeb = 360. - (degdeb+deltadeg);
 XDrawArc(mDisp, mWId, DefGC(),
-         (int)x0, (int)y0, (int)dx, (int)dy, (int)(degdeb*64.), (int)(degfin*64.));
+         (int)x0, (int)y0, (int)dx, (int)dy, (int)(degdeb*64.), (int)(deltadeg*64.));
 return;
 }
@@ -270,8 +272,9 @@
 /* --Methode-- */
 void PIGraphicX::DrawFArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy, 
-                         double degdeb, double degfin)
-{
+                         double degdeb, double deltadeg)
+{
+degdeb = 360. - (degdeb+deltadeg);
 XFillArc(mDisp, mWId, DefGC(),
-         (int)x0, (int)y0, (int)dx, (int)dy, (int)(degdeb*64.), (int)(degfin*64.));
+         (int)x0, (int)y0, (int)dx, (int)dy, (int)(degdeb*64.), (int)(deltadeg*64.));
 return;
 }
Index: /trunk/SophyaPI/PI/pigraphx.h
===================================================================
--- /trunk/SophyaPI/PI/pigraphx.h	(revision 2256)
+++ /trunk/SophyaPI/PI/pigraphx.h	(revision 2257)
@@ -33,7 +33,7 @@
   virtual void       DrawFPolygon(PIGrCoord *x, PIGrCoord *y, int n, bool cinc=true);  
   virtual void       DrawArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy,
-                             double degdeb, double degfin);
+                             double degdeb, double deltadeg);
   virtual void       DrawFArc(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy, 
-                              double degdeb, double degfin);
+                              double degdeb, double deltadeg);
   virtual void       DrawMarker(PIGrCoord x0, PIGrCoord y0);
   virtual void       DrawMarkers(PIGrCoord *x, PIGrCoord *y, int n);
Index: /trunk/SophyaPI/PI/psfile.cc
===================================================================
--- /trunk/SophyaPI/PI/psfile.cc	(revision 2256)
+++ /trunk/SophyaPI/PI/psfile.cc	(revision 2257)
@@ -1112,4 +1112,53 @@
 }
 
+void  PSFile::DrawArc (double x0, double y0, double dx, double dy,
+		       double degdeb, double deltadeg,
+		       PIColors DrawColor,
+		       PILineAtt LineAtt) {
+
+    /* Line Att */  
+    if ( (LineAtt != PI_NotDefLineAtt) && (LineAtt != mLineAtt) ) 
+      SelectLine(LineAtt);
+
+    /* Couleurs */
+    if ( (DrawColor != PI_NotDefColor) || (DrawColor != mDrawColor) ) {
+	mDrawColor = DrawColor;
+	fprintf(mPSFile, "C%d ", mDrawColor); 
+    }
+
+
+    /* Dessin */
+    fprintf(mPSFile, "gs n %.2f Ux %.2f Uy %.2f Ux %.2f Uy %.2f %.2f ellipse s gr\n",
+	    x0+dx/2, y0+dy/2, dx/2, dy/2, degdeb, deltadeg) ;
+}
+
+
+void  PSFile::DrawFArc (double x0, double y0, double dx, double dy,
+			double degdeb, double deltadeg,
+			PIColors DrawColor,
+			PIColors FillColor, 
+			PILineAtt LineAtt) {
+
+    /* Line Att */  
+    if ( (LineAtt != PI_NotDefLineAtt) && (LineAtt != mLineAtt) ) 
+      SelectLine(LineAtt);
+
+    /* Dessin du fond */
+    if ( (FillColor != PI_NotDefColor) || (FillColor != mDrawColor) ){
+	mDrawColor = FillColor;
+	fprintf(mPSFile, "C%d ", mDrawColor) ;
+    }
+    fprintf(mPSFile, "gs n %.2f Ux %.2f Uy %.2f Ux %.2f Uy %.2f %.2f ellipse f gr\n",
+	    x0+dx/2, y0+dy/2, dx/2, dy/2, degdeb, deltadeg);
+
+    /* Dessin du contour (s'il y a lieu) */
+    if ( (DrawColor != PI_NotDefColor) && (FillColor != DrawColor) ) {
+	mDrawColor = DrawColor;
+	fprintf(mPSFile, "C%d ", mDrawColor); 
+	fprintf(mPSFile, "gs n %.2f Ux %.2f Uy %.2f Ux %.2f Uy %.2f %.2f ellipse s gr\n",
+		x0+dx/2, y0+dy/2, dx/2, dy/2, degdeb, deltadeg) ;
+    }
+}
+
 
 // Les coordonnees sont supposees etre en mode incremental .
Index: /trunk/SophyaPI/PI/psfile.h
===================================================================
--- /trunk/SophyaPI/PI/psfile.h	(revision 2256)
+++ /trunk/SophyaPI/PI/psfile.h	(revision 2257)
@@ -134,4 +134,13 @@
 			       PIColors FillColor  = PI_NotDefColor, 
 			       PILineAtt LineAtt   = PI_NotDefLineAtt);
+    virtual void  DrawArc     (double x0, double y0, double dx, double dy,
+			       double degdeb, double deltadeg,
+			       PIColors DrawColor  = PI_NotDefColor,
+			       PILineAtt LineAtt   = PI_NotDefLineAtt);
+    virtual void  DrawFArc    (double x0, double y0, double dx, double dy,
+			       double degdeb, double deltadeg,
+			       PIColors DrawColor  = PI_NotDefColor,
+			       PIColors FillColor  = PI_NotDefColor, 
+			       PILineAtt LineAtt   = PI_NotDefLineAtt);
     virtual void  DrawPolygon (double *x, double *y, int n,
 			       PIColors DrawColor  = PI_NotDefColor, 
