Index: /trunk/SophyaPI/PI/Makefile
===================================================================
--- /trunk/SophyaPI/PI/Makefile	(revision 4069)
+++ /trunk/SophyaPI/PI/Makefile	(revision 4070)
@@ -78,5 +78,5 @@
   pimsghandler.h picolist.h pipixutils.h picmap.h picmapx.h picmapgen.h \
   pifontx.h pifontgen.h pigrcoord.h pilineatt.h pigratt.h pidrawer.h \
-  pibwdggen.h pigraphx.h pievthandler.h psfile.h
+  ucckprot.h pibwdggen.h pigraphx.h pievthandler.h psfile.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  piaxes.cc
  
Index: /trunk/SophyaPI/PI/piaxes.cc
===================================================================
--- /trunk/SophyaPI/PI/piaxes.cc	(revision 4069)
+++ /trunk/SophyaPI/PI/piaxes.cc	(revision 4070)
@@ -12,4 +12,5 @@
 #include "piaxes.h"
 #include "pidrawer.h"
+#include "ucckprot.h"
 
 //++
@@ -19,5 +20,5 @@
 //
 //	Classe gestionnaire de tracé d'axes. A utiliser dans
-//	un objet PIDrawer.
+//	un objet PIDrawer. Ajout trace d'axes polaires en Mai 2012.
 //--
 //++
@@ -44,4 +45,5 @@
   ConfigureAutoFontSize(true, PIDrawer::GetGlDefAutoFontSizeFrac());
   ConfigureAxesCenter();
+  ConfigurePolar();
   setupDone = false;
 }
@@ -120,6 +122,47 @@
   }
 
-  if (flags & kCentAxes) {
-
+  if (flags & kPolarAxes)  {  // axes polaires 
+    //    g->DrawLine(xMin, 0., xMax, 0.);
+    //    g->DrawLine(0., yMin, 0., yMax);
+    double rr=fabs(xMin); 
+    double rmin=0., rmax=rr;
+    rr=fabs(xMax);  if (rr>rmax) rmax=rr;   
+    rr=fabs(yMin);  if (rr>rmax) rmax=rr;   
+    rr=fabs(yMax);  if (rr>rmax) rmax=rr;
+    UC_CheckMinMaxDiff(rmin,rmax);
+    if (rmin<0.)  { rmax-=(2.*rmin);  rmin=0.; }
+    vector<double> lesradius,lesrad2; 
+    PIAxes::BestTicks(rmin,rmax,polNRadius,lesradius,lesrad2);
+    double delta_r=(rmax-rmin)/(double)polNRadius;
+    double delta_ang=M_PI/(double)polNAng;
+    double xa,ya,ang;
+    char sbuff[64];
+    for(size_t nn=0; nn<lesradius.size(); nn++) {
+      rr=lesradius[nn]; 
+      if (rr<1.e-3*rmax) continue;
+      //      cout << " *DBG*PIAxes* rmin,rmax=" << rmin << "," << rmax << " rr[" << nn << "]=" << rr << endl;
+      g->DrawCircle(0.,0.,rr);
+      sprintf(sbuff,"%g",rr);
+      rr+=0.1*delta_r;  
+      xa=cos(-0.2)*rr;  ya=sin(-0.2)*rr;
+      g->DrawString(xa,ya,sbuff,PI_HorizontalCenter|PI_VerticalCenter);
+      xa=cos(M_PI-0.2)*rr;  ya=sin(M_PI-0.2)*rr;
+      g->DrawString(xa,ya,sbuff,PI_HorizontalCenter|PI_VerticalCenter);
+    }
+    for(int nn=0; nn<polNAng; nn++) {
+      ang=(double)nn*delta_ang;
+      xa=cos(ang+polThetaOffset)*rmax*1.03;
+      ya=sin(ang+polThetaOffset)*rmax*1.03;
+      g->DrawLine(-xa, -ya, xa, ya);
+      sprintf(sbuff,"%g",ang*180./M_PI);
+      xa*=1.03;  ya*=1.03;
+      g->DrawString(xa,ya,sbuff,PI_HorizontalCenter|PI_VerticalCenter);
+      sprintf(sbuff,"%g",ang*180./M_PI+180.);
+      g->DrawString(-xa,-ya,sbuff,PI_HorizontalCenter|PI_VerticalCenter);
+    }
+    
+  }  // --- FIN trace d'axes polaires 
+
+  if (flags & kCentAxes)  {   // axes X-Y centres 
     // Les axes
     double x0axes = (xMin+xMax)/2.,  y0axes = (yMin+yMax)/2.;
@@ -140,23 +183,17 @@
     g->DrawArrowMarker(x0axes, yMax, x0axes, ym2, true);
     // La grille en pointilles
-
     if (flags & kGridOn) DrawGrid(g);
   
-    // Les ticks majeurs
-  
+    // Les ticks majeurs  
     if ((flags & kTicks) && (flags & kMajTicks)) {
         DrawHTicks(g, y0axes, xMajTickLen, xMajTickLen, xMajTicks);
         DrawVTicks(g, x0axes, yMajTickLen, yMajTickLen, yMajTicks);
     }
-    
-    // Les ticks mineurs
-  
+    // Les ticks mineurs  
     if ((flags & kTicks) && (flags & kMinTicks)) {
         DrawHTicks(g, y0axes, xMinTickLen, xMinTickLen, xMinTicks);
         DrawVTicks(g, x0axes, yMinTickLen, yMinTickLen, yMinTicks);
-    }
-    
-    // Les labels
-    
+    }    
+    // Les labels    
     if (flags & kLabelsH) {
       double declab = 2*xMajTickLen;
@@ -173,16 +210,12 @@
         DrawVLabels(g, x0axes+declab, yMajTicks, PI_HorizontalRight);
     }
-    
-  }
+  }   //--- FIN trace axes X-Y centres 
   
-  if (flags & kBoxAxes) {
-  
-    // La boite
-    
+  if (flags & kBoxAxes) {  
+    // La boite    
     g->DrawLine(xMin, yMin, xMax, yMin);
     g->DrawLine(xMax, yMin, xMax, yMax);
     g->DrawLine(xMax, yMax, xMin, yMax);
     g->DrawLine(xMin, yMax, xMin, yMin);
-
     // Longueur des ticks
     double extXMajTickLen = flags&kExtTicks ? xMajTickLen : 0;
@@ -194,11 +227,7 @@
     double extYMinTickLen = flags&kExtTicks ? yMinTickLen : 0;
     double intYMinTickLen = flags&kIntTicks ? yMinTickLen : 0;
-
     // La grille en pointilles
-
     if (flags & kGridOn) DrawGrid(g);
-
     // Les ticks majeurs
-  
     if ((flags & kTicks) && (flags & kMajTicks)) {
         DrawHTicks(g, yMin, intXMajTickLen, extXMajTickLen, xMajTicks);
@@ -207,7 +236,5 @@
         DrawVTicks(g, xMax, intYMajTickLen, extYMajTickLen, yMajTicks);
     }
-    
-    // Les ticks mineurs
-  
+    // Les ticks mineurs  
     if ((flags & kTicks) && (flags & kMinTicks)) {
         DrawHTicks(g, yMin, intXMinTickLen, extXMinTickLen, xMinTicks);
@@ -216,8 +243,5 @@
         DrawVTicks(g, xMax, intYMinTickLen, extYMinTickLen, yMinTicks);
     }
-
-
-    // Les labels
-    
+    // Les labels    
     if (flags & kLabelsH) {
       double declab = xMajTickLen;
@@ -240,6 +264,6 @@
       }
     }
-  }
-  g->Clip();
+  }   // --- FIN trace BoxAxes 
+  //  g->Clip();
   
 }
Index: /trunk/SophyaPI/PI/piaxes.h
===================================================================
--- /trunk/SophyaPI/PI/piaxes.h	(revision 4069)
+++ /trunk/SophyaPI/PI/piaxes.h	(revision 4070)
@@ -14,11 +14,12 @@
   kCentAxes    = 0x0001,
   kBoxAxes     = 0x0002,
-  kTicks       = 0x0004,
-  kGridOn      = 0x0008,
+  kPolarAxes   = 0x0004,
 
-  kIntTicks    = 0x0010,
-  kExtTicks    = 0x0020,
-  kMajTicks    = 0x0040,
-  kMinTicks    = 0x0080,
+  kTicks       = 0x0010,
+  kGridOn      = 0x0020,
+  kIntTicks    = 0x0100,
+  kExtTicks    = 0x0200,
+  kMajTicks    = 0x0400,
+  kMinTicks    = 0x0800,
 
   kLabelsH     = 0x1000,
@@ -52,4 +53,5 @@
     {   DrawXYAxes(g, gratt, xmin, xmax, ymin, ymax, flags, axesAFSz, fontSz); }
 
+
   virtual void      DrawXCaption(PIGraphicUC* g, PIGraphicAtt& att, unsigned int flags,
 				 string const& xLabel); 
@@ -60,4 +62,7 @@
   void  ConfigureTicks(int ntickx=10, int nticky=12, 
 		       double majtl=0.016, double mintl=0.01);
+  //  Nb de cercles et nb de droites theta=Cte traces en coordonnees polaires
+  inline void  ConfigurePolar(int nradius=5, int nang=6, double thetaoffset=0.)
+    { polNRadius=nradius; polNAng=nang; polThetaOffset=thetaoffset; }
   //  Choix de taille automatique de fontes 
   void  ConfigureAutoFontSize(bool afsz=true, double fszf=0.04);
@@ -107,6 +112,9 @@
   double xMajTickLen,  xMinTickLen;
   double yMajTickLen,  yMinTickLen;
-  bool axesCenter; double axesCentX0,axesCentY0;
-
+  bool axesCenter; 
+  double axesCentX0,axesCentY0;
+//--- PolarAxe   
+  int polNRadius, polNAng; // Nb de cercles et nb de droites theta=Cte
+  double polThetaOffset;   // Offset de l'angle 0 (en radian) par rapport au systeme de coordonnees x-y 
 };
 
Index: /trunk/SophyaPI/PI/piaxestools.cc
===================================================================
--- /trunk/SophyaPI/PI/piaxestools.cc	(revision 4069)
+++ /trunk/SophyaPI/PI/piaxestools.cc	(revision 4070)
@@ -131,8 +131,14 @@
 cpx = spx+0.25*bsx;
 cpy += spycb+bsycb;
-mCkb[5] = new PICheckBox(this,"Centerd-Axes", 2005, bsx*1.5, bsycb, cpx, cpy);
+// mCkb[5] = new PICheckBox(this,"Centerd-Axes", 2005, bsx*1.5, bsycb, cpx, cpy);
+mCkb[5] = NULL;
+mOpt[0] = new PIOptMenu(this,"TypeAxes",1.5*bsx,bsycb,cpx,cpy);
+mOpt[0]->AppendItem("BoxAxes",2021);  
+mOpt[0]->AppendItem("CenteredAxes",2022);  
+mOpt[0]->AppendItem("PolarAxes",2023);   
+
 cpx += bsx*1.5+3*spx;
 mCkb[2] = new PICheckBox(this,"Grid", 2002, bsx*1.5, bsycb, cpx, cpy);
-mCkb[5]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
+// mCkb[5]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
 mCkb[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
 
@@ -170,12 +176,12 @@
 mBut[5]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
  cpx += spx+0.5*bsx;
-mOpt = new PIOptMenu(this,"choix-action",1.5*bsx,bsy,cpx,cpy);
-mOpt->AppendItem("Transl X",2850);  // mTypAction=0
-mOpt->AppendItem("Transl Y",2851);  // mTypAction=1
-mOpt->AppendItem("Zoom X",2852);    // mTypAction=2
-mOpt->AppendItem("Zoom Y",2853);    // mTypAction=3
-mOpt->AppendItem("Zoom X-Y",2854);  // mTypAction=4
-mOpt->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
- string sdum="Transl X"; mOpt->SetValueStr(sdum); mTypAction=0;
+mOpt[1] = new PIOptMenu(this,"choix-action",1.5*bsx,bsy,cpx,cpy);
+mOpt[1]->AppendItem("Transl X",2850);  // mTypAction=0
+mOpt[1]->AppendItem("Transl Y",2851);  // mTypAction=1
+mOpt[1]->AppendItem("Zoom X",2852);    // mTypAction=2
+mOpt[1]->AppendItem("Zoom Y",2853);    // mTypAction=3
+mOpt[1]->AppendItem("Zoom X-Y",2854);  // mTypAction=4
+mOpt[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
+ string sdum="Transl X"; mOpt[1]->SetValueStr(sdum); mTypAction=0;
  cpx += spx+1.5*bsx;
 mBut[6] = new PIButton(this,">",2803,0.5*bsx,bsy,cpx,cpy);
@@ -196,6 +202,7 @@
 for(i=0;i<2;i++) delete mText[i];
 for(i=0;i<8;i++) delete mBut[i];
-for(i=0;i<8;i++) delete mCkb[i];
-delete mOpt;
+for(i=0;i<7;i++) 
+  if (mCkb[i]) delete mCkb[i];
+for(i=0;i<2;i++) delete mOpt[i];
 }
 
@@ -231,6 +238,9 @@
   if (scd->GetAxesFlags() & kGridOn) mCkb[2]->SetState(true);
   else mCkb[2]->SetState(false);
-  if (scd->GetAxesFlags() & kCentAxes) mCkb[5]->SetState(true);
-  else mCkb[5]->SetState(false);
+  //  if (scd->GetAxesFlags() & kCentAxes) mCkb[5]->SetState(true);
+  //  else mCkb[5]->SetState(false);
+  if (scd->GetAxesFlags() & kCentAxes) mOpt[0]->SetValue(2022);
+  else if (scd->GetAxesFlags() & kPolarAxes)  mOpt[0]->SetValue(2023);
+  else mOpt[0]->SetValue(2021);
   if (scd->GetAxesFlags() & kMinTicks) mCkb[6]->SetState(true);
   else mCkb[6]->SetState(false);
@@ -247,5 +257,6 @@
   mCkb[3]->SetState(false);
   mCkb[4]->SetState(false);
-  mCkb[5]->SetState(false);
+  //  mCkb[5]->SetState(false);
+  mOpt[0]->SetValue(2021);
   mCkb[6]->SetState(false);
   mCkb[7]->SetState(true);
@@ -304,6 +315,8 @@
   if (mCkb[2]->GetState()) flags |= kGridOn;
   else  flags &= ~kGridOn;
-  if (mCkb[5]->GetState()) { flags |= kCentAxes;  flags &= ~kBoxAxes; }
-  else { flags &= ~kCentAxes;  flags |= kBoxAxes; }
+  PIMessage typax=mOpt[0]->GetValue();
+  if (typax==2022)   { flags |= kCentAxes;  flags &= ~(kBoxAxes|kPolarAxes); }
+  else if (typax==2023)  { flags |= kPolarAxes;  flags &= ~(kBoxAxes|kCentAxes); }
+  else { flags |= kBoxAxes; flags &= ~(kCentAxes|kPolarAxes);}
   if (mCkb[6]->GetState()) flags |= kMinTicks;
   else  flags &= ~kMinTicks;
Index: /trunk/SophyaPI/PI/piaxestools.h
===================================================================
--- /trunk/SophyaPI/PI/piaxestools.h	(revision 4069)
+++ /trunk/SophyaPI/PI/piaxestools.h	(revision 4070)
@@ -41,5 +41,5 @@
   PIText* mText[2];
   PICheckBox* mCkb[8];
-  PIOptMenu * mOpt;
+  PIOptMenu * mOpt[2];
   unsigned short mTypAction;
   double mSclAction;
Index: /trunk/SophyaPI/PI/pieldrw.cc
===================================================================
--- /trunk/SophyaPI/PI/pieldrw.cc	(revision 4069)
+++ /trunk/SophyaPI/PI/pieldrw.cc	(revision 4070)
@@ -552,4 +552,14 @@
     else if (opts == "finecenteredaxesgrid")
       SetAxesFlags(kCentAxes | kTicks | kMajTicks | kMinTicks | kLabels | kGridOn);
+    else if (opts == "polaraxes") 
+      SetAxesFlags(kPolarAxes);
+    else if (opts.substr(0,10) == "polaraxes=") {
+      SetAxesFlags(kPolarAxes);
+      int nradius=5,nang=6;
+      int thetaoffdeg=0;
+      sscanf(opts.substr(10).c_str(),"%d,%d,%d",&nradius,&nang,&thetaoffdeg);
+      double thetaoffset=(double)thetaoffdeg*M_PI/180.;
+      axeDr.ConfigurePolar(nradius,nang,thetaoffset);
+    }
     else if (opts == "axesnone")
       SetAxesFlags(kAxesNone);
Index: /trunk/SophyaPI/PI/smakefile
===================================================================
--- /trunk/SophyaPI/PI/smakefile	(revision 4069)
+++ /trunk/SophyaPI/PI/smakefile	(revision 4070)
@@ -78,5 +78,5 @@
   pimsghandler.h picolist.h pipixutils.h picmap.h picmapx.h picmapgen.h \
   pifontx.h pifontgen.h pigrcoord.h pilineatt.h pigratt.h pidrawer.h \
-  pibwdggen.h pigraphx.h pievthandler.h psfile.h
+  ucckprot.h pibwdggen.h pigraphx.h pievthandler.h psfile.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  piaxes.cc
  
