Index: trunk/SophyaPI/PI/pi3ddrw.cc
===================================================================
--- trunk/SophyaPI/PI/pi3ddrw.cc	(revision 115)
+++ trunk/SophyaPI/PI/pi3ddrw.cc	(revision 116)
@@ -99,9 +99,9 @@
   cTeta = cPhi = 0.;  cUlen = 1.;
 
-  ActivateButton(1);    //  Pour pouvoir tourner la camera
-  ActivateMove(1);      
-  ActivateButton(2);    //  Pour deplacer la camera le long de son axe
-  ActivateMove(2);
-  ActivateButton(3);    //  Pour pouvoir tourner la camera
+  ActivateButton(2);    //  Pour pouvoir tourner la camera
+  ActivateMove(2);      
+  ActivateButton(3);    //  Pour deplacer la camera le long de son axe
+  ActivateMove(3);
+  ActivateButton(1);    
 
   mGr3d = new PIGraphic3D(mWGrC, 0, 0, sx, sy);
@@ -213,5 +213,5 @@
 
 /* --Methode-- */
-void PIDraw3DWdg::But1Press(int x, int y)
+void PIDraw3DWdg::But2Press(int x, int y)
 {
   mGr3d->SetBaseGraphic(mWGrC, 0, 0, XSize(), YSize());
@@ -220,5 +220,5 @@
   float dax, day, co, dco;
   mGr3d->Get3DCS(xc, yc, zc, xo, yo, zo, teta, phi, psi, dax, day, co, dco);
-//   puts("\n PIDraw3DWdg::But1Press() ");
+//   puts("\n PIDraw3DWdg::But2Press() ");
 //   mGr3d->PrintCS();
   lPx = x;  lPy = y;    
@@ -232,5 +232,5 @@
   {
   char buff[256];
-  sprintf(buff, "But1Press() C=%g %g %g  T,P=%g %g   ", xc, yc, zc, cTeta, cPhi); 
+  sprintf(buff, "But2Press() C=%g %g %g  T,P=%g %g   ", xc, yc, zc, cTeta, cPhi); 
   mWGrC->DrawOpaqueString(0,20,buff);
   }
@@ -241,5 +241,5 @@
 
 /* --Methode-- */
-void PIDraw3DWdg::Ptr1Move(int x, int y)
+void PIDraw3DWdg::Ptr2Move(int x, int y)
 {
   DrawXYZAxes();
@@ -251,5 +251,5 @@
 /*  {
   char buff[256];
-  sprintf(buff, "Ptr1Move() T,P=%g %g -> %g %g  ", cTeta, cPhi, teta, phi); 
+  sprintf(buff, "Ptr2Move() T,P=%g %g -> %g %g  ", cTeta, cPhi, teta, phi); 
   mWGrC->DrawOpaqueString(0,20,buff);
   }
@@ -260,8 +260,8 @@
 
 /* --Methode-- */
-void PIDraw3DWdg::But1Release(int x, int y)
-{
-  DrawXYZAxes();
-//  puts("\n PIDraw3DWdg::But1Release()");
+void PIDraw3DWdg::But2Release(int x, int y)
+{
+  DrawXYZAxes();
+//  puts("\n PIDraw3DWdg::But2Release()");
 //  mGr3d->PrintCS();
   SelPointerShape(PI_ArrowPointer);
@@ -273,5 +273,5 @@
 
 /* --Methode-- */
-void PIDraw3DWdg::But2Press(int x, int y)
+void PIDraw3DWdg::But3Press(int x, int y)
 {
   float xc, yc, zc, xo, yo, zo;
@@ -290,5 +290,5 @@
   {
   char buff[256];
-  sprintf(buff, "But2Press() C=%g %g %g  O= %g %g %g  L= %g   ", xc, yc, zc, xo, yo, zo, co); 
+  sprintf(buff, "But3Press() C=%g %g %g  O= %g %g %g  L= %g   ", xc, yc, zc, xo, yo, zo, co); 
   mWGrC->DrawOpaqueString(0,20,buff);
   }
@@ -299,5 +299,5 @@
 
 /* --Methode-- */
-void PIDraw3DWdg::Ptr2Move(int x, int y)
+void PIDraw3DWdg::Ptr3Move(int x, int y)
 {
   DrawXYZAxes();
@@ -315,5 +315,5 @@
   {
   char buff[256];
-  sprintf(buff, "Ptr2Move() Rap=%g %g -> %g %g %g     ", rapx, rapy, rapy*clCO, rapx*cDax, rapx*cDay);
+  sprintf(buff, "Ptr3Move() Rap=%g %g -> %g %g %g     ", rapx, rapy, rapy*clCO, rapx*cDax, rapx*cDay);
   mWGrC->DrawOpaqueString(0,20,buff);
   }
@@ -324,5 +324,5 @@
 
 /* --Methode-- */
-void PIDraw3DWdg::But2Release(int x, int y)
+void PIDraw3DWdg::But3Release(int x, int y)
 {
   DrawXYZAxes();
@@ -367,6 +367,8 @@
 
 /* --Methode-- */
-void PIDraw3DWdg::But3Press(int x, int y)
-{
+void PIDraw3DWdg::But1Press(int x, int y)
+{
+  Send(Msg(), PIMsg_Active);
+  if ( (x > 50) || ( y > 50) ) return; 
   list<int>::iterator it = m3DrIl.begin();
   if (it == m3DrIl.end())  return;
Index: trunk/SophyaPI/PI/pi3ddrw.h
===================================================================
--- trunk/SophyaPI/PI/pi3ddrw.h	(revision 115)
+++ trunk/SophyaPI/PI/pi3ddrw.h	(revision 116)
@@ -64,6 +64,4 @@
 
   virtual void		But1Press(int x, int y);
-  virtual void		But1Release(int x, int y);
-  virtual void		Ptr1Move(int x, int y);
 
   virtual void		But2Press(int x, int y);
@@ -72,4 +70,7 @@
 
   virtual void		But3Press(int x, int y);
+  virtual void		But3Release(int x, int y);
+  virtual void		Ptr3Move(int x, int y);
+
 
 protected :
Index: trunk/SophyaPI/PI/piimage.cc
===================================================================
--- trunk/SophyaPI/PI/piimage.cc	(revision 115)
+++ trunk/SophyaPI/PI/piimage.cc	(revision 116)
@@ -11,4 +11,5 @@
 
 #include "piimage.h"
+#include "piimgtools.h"
 
 // --------------------------------------------------------------------------------
@@ -387,5 +388,6 @@
 if (kmod == PIKM_Alt) {
   if (key == 'V' || key == 'v') RequestSelection();  // Pour coller (copier/coller)  
-  if (key == 'Z' || key == 'z') mdrw->ElDelAll();   // Pour supprimer tous les signes 
+  if (key == 'Z' || key == 'z') { mdrw->ElDelAll();  Refresh(); } // Pour supprimer tous les signes 
+  if (key == 'O' || key == 'o') PIImgLutWind::ShowPIImgLutWind();   // Fentre LUT et options 
   }
 
Index: trunk/SophyaPI/PI/piimgtools.cc
===================================================================
--- trunk/SophyaPI/PI/piimgtools.cc	(revision 115)
+++ trunk/SophyaPI/PI/piimgtools.cc	(revision 116)
@@ -12,4 +12,11 @@
 // ------ Menu des options et fenetre de dialogue pour changement de LUT --------
 
+PIImgLutWind* PIImgLutWind::curlutw = NULL;
+/* --Methode-- */
+void PIImgLutWind::ShowPIImgLutWind() 
+{
+if (curlutw == NULL)  curlutw = new PIImgLutWind(PIApplicationGetApp());
+curlutw->Show();
+}
 
 /* --Methode-- */
@@ -17,25 +24,41 @@
 : PIWindow((PIMsgHandler*)par, "PIImageTools", PIWK_dialog, 240, 240, 150, 150)
 {
-int bsx, bsy;
+int bsx, bsy, spx, spy;
 
 // On definit la taille a partir de la taille par defaut des composantes 
 // PIApplicationPrefCompSize(bsx, bsy);
 par->PrefCompSz(bsx, bsy);
-mLab[0] = new PILabel(this, "MinPixel", 60, 35, 30, 20); 
-mLab[1] = new PILabel(this, "MaxPixel", 60, 35, 30, 65); 
-
+spx = bsx/10;
+spy = bsy/4;
+
+int wszx = 8*spx+3*bsx+1.5*bsy; 
+int wszy = 10*spy+7*bsy;
+SetSize(wszx, wszy);
+
+int cpx = spx*2;
+int cpy = spy*2;
+int csx = cpx;
+int csy = cpy;
+mLab[0] = new PILabel(this, "MinPixel", bsx, bsy, cpx, cpy);
+cpy += spy+bsy; 
+mLab[1] = new PILabel(this, "MaxPixel", bsx, bsy, cpx, cpy);
 mLab[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
 mLab[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
 
-mText[0] = new PIText(this, "MinVal", 100, 35, 110, 20);
+cpy = spy*2;
+cpx += spx+bsx; 
+mText[0] = new PIText(this, "MinVal", 1.75*bsx, bsy, cpx, cpy);
 mText[0]->SetText("1");
-mText[1] = new PIText(this, "MaxVal", 100, 35, 110, 65);
+cpy += spy+bsy; 
+mText[1] = new PIText(this, "MaxVal", 1.75*bsx, bsy, cpx, cpy);
 mText[1]->SetText("32000");
 mText[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
 mText[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
-
-mOlb[0] = new PILabel(this, "LutType", 60, 30, 30, 110); 
+cpy += spy+bsy; 
+cpx = spx*2;
+mOlb[0] = new PILabel(this, "LutType", bsx, bsy, cpx, cpy);
 mOlb[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
-mOpt[0] = new PIOptMenu(this, "imglut-opt-1", 100, 30, 110, 110);
+cpx += spx+bsx; 
+mOpt[0] = new PIOptMenu(this, "imglut-opt-1", 1.75*bsx, bsy, cpx, cpy);
 mOpt[0]->AppendItem("Linear", 1100);
 mOpt[0]->AppendItem("Log.", 1101);
@@ -43,7 +66,10 @@
 mOpt[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
 
-mOlb[1] = new PILabel(this, "AutoLut", 60, 30, 30, 140); 
+cpy += spy+bsy; 
+cpx = spx*2;
+mOlb[1] = new PILabel(this, "AutoLut", bsx, bsy, cpx, cpy);
 mOlb[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
-mOpt[1] = new PIOptMenu(this, "imglut-opt-2", 100, 30, 110, 140);
+cpx += spx+bsx; 
+mOpt[1] = new PIOptMenu(this, "imglut-opt-2", 1.75*bsx, bsy, cpx, cpy);
 mOpt[1]->AppendItem("+3 Sig", 1203);
 mOpt[1]->AppendItem("+2 Sig", 1202);
@@ -56,8 +82,64 @@
 mOpt[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
 
-mBut[0] = new PIButton(this, "Apply", 1500, 70, 30, 30, 190);
-mBut[1] = new PIButton(this, "Dismiss", 1600, 70, 30, 140, 190);
+cpy += spy+bsy; 
+cpx = bsx/2;
+mBut[0] = new PIButton(this, "Apply", 2500, bsx*1.5, bsy, cpx, cpy);
+cpx += bsx*2;
+mBut[1] = new PIButton(this, "Dismiss", 2600,  bsx*1.5, bsy, cpx, cpy);
 mBut[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
 mBut[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
+
+int offy = cpy+bsy+spy*2;
+printf("-DBG- PIImgLutWind()  SzX,Y= %d %d , ButPos= %d %d (off=%d)\n", wszx, wszy, cpx, cpy, offy);
+
+cpx = 5*spx+2.5*bsx;
+cpy = 2*spy;
+mSc[0] = new PIScale(this, "offset-lut", 2700, false, bsy*0.75, 4.5*bsy, cpx, cpy); 
+cpx += 1.5*bsy;
+mSc[1] = new PIScale(this, "offset-lut", 2800, false, bsy*0.75, 4.5*bsy, cpx, cpy); 
+mSc[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
+mSc[0]->SetMinMax(-50, 50);
+mSc[0]->SetValue(0);
+mSc[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
+mSc[1]->SetMinMax(-50, 50);
+mSc[1]->SetValue(0);
+
+//  Option-Menu  Couleur/Zoom
+cpx = 2*spx;
+cpy = offy;
+mOptzc[0] = new PIOptMenu(this, "imglut-opt-3", 1.5*bsx, bsy, cpx, cpy);
+mOptzc[0]->AppendItem("Grey32", 201);
+mOptzc[0]->AppendItem("GreyInv32", 202);
+mOptzc[0]->AppendItem("ColRJ32", 203);
+mOptzc[0]->AppendItem("ColBR32", 204);
+mOptzc[0]->AppendItem("ColRV32", 205);
+mOptzc[0]->AppendItem("Grey128", 206);
+mOptzc[0]->AppendItem("GreyInv128", 207);
+mOptzc[0]->AppendItem("ColRJ128", 208);
+mOptzc[0]->AppendItem("ColBR128", 209);
+mOptzc[0]->AppendItem("Col16", 210);
+mOptzc[0]->SetValue(203);
+
+cpx += 1.5*bsx+2*spx;
+mOptzc[1] = new PIOptMenu(this, "imglut-opt-4", 1.5*bsx, bsy, cpx, cpy);
+mOptzc[1]->AppendItem("Agr. x10", 110);
+mOptzc[1]->AppendItem("Agr. x 8", 108);
+mOptzc[1]->AppendItem("Agr. x 6", 106);
+mOptzc[1]->AppendItem("Agr. x 5", 105);
+mOptzc[1]->AppendItem("Agr. x 4", 104);
+mOptzc[1]->AppendItem("Agr. x 3", 103);
+mOptzc[1]->AppendItem("Agr. x 2", 102);
+mOptzc[1]->AppendItem("Zoom x 1", 101);
+mOptzc[1]->AppendItem("Red. / 2", 98);
+mOptzc[1]->AppendItem("Red. / 3", 97);
+mOptzc[1]->AppendItem("Red. / 4", 96);
+mOptzc[1]->AppendItem("Red. / 5", 95);
+mOptzc[1]->AppendItem("Red. / 6", 94);
+mOptzc[1]->AppendItem("Red. / 8", 92);
+mOptzc[1]->AppendItem("Red. /10", 90);
+mOptzc[1]->SetValue(101);
+
+curlutw = this;
+
 }
 
@@ -65,4 +147,5 @@
 PIImgLutWind::~PIImgLutWind()
 {
+if (curlutw == this)  curlutw = NULL;
 for(int i=0; i<2; i++)
   {
@@ -72,4 +155,6 @@
   delete mOpt[i];
   delete mOlb[i];
+  delete mSc[i];
+  delete mOptzc[i];
   }
 }
@@ -92,4 +177,6 @@
 string s("NoAuto");
 mOpt[1]->SetValueStr(s);
+mSc[0]->SetValue(0);
+mSc[1]->SetValue(0);
 return;
 }
@@ -99,5 +186,5 @@
 void PIImgLutWind::Process(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/)
 {
-float min, max;
+float min, max, del;
 int lauto, typ;
 int typlut[2] = {kLutType_Lin, kLutType_Log} ; 
@@ -106,21 +193,56 @@
 switch (msg)
   {
-  case 1600:
+  case 2600:
     this->Hide();
     break;
-  case 1500:
+  case 2500:
+  case 2700 :
+  case 2800 :
+    {
     if (PIImage::CurrentPIImage() == NULL)  return;
     min = atof(mText[0]->GetText().c_str());
     max = atof(mText[1]->GetText().c_str());
+    if (msg == 2700) {
+      min += (float)mSc[0]->GetValue()/100*del;
+      max += (float)mSc[0]->GetValue()/100*del;
+    }
+    if (msg == 2800) {
+      min -= (float)mSc[0]->GetValue()/100*del*0.5;
+      max += (float)mSc[0]->GetValue()/100*del*0.5;
+    }
+    if ( (msg == 2700) || (msg == 2800) ) {
+      char buff[92];
+      sprintf(buff,"%g", min);
+      mText[0]->SetText(buff);
+      sprintf(buff,"%g", max);
+      mText[1]->SetText(buff);
+    }
     lauto = mOpt[1]->GetValue() - 1200;
     typ = mOpt[0]->GetValue() - 1100;
     if ( (typ < 0) || (typ > 1) )  typ = 0;
     (PIImage::CurrentPIImage())->SetLut(min, max, typlut[typ], lauto);
+    mSc[0]->SetValue(0);
+    mSc[1]->SetValue(0);
 //    ((PIImage::CurrentPIImage())->Lut())->Print();
-    break;
+    }
+    break;
+
   default:
 //    printf("PIImgLutWind::Process Msg %d received \n", (int)msg);
     break;
   }
+
+if (PIImage::CurrentPIImage() == NULL)  return;
+
+CMapId cmap[10] =  { CMAP_GREY32, CMAP_GREYINV32, CMAP_COLRJ32,
+                      CMAP_COLBR32, CMAP_COLRV32, CMAP_GREY128,
+                      CMAP_GREYINV128, CMAP_COLRJ128, CMAP_COLBR128,
+                      CMAP_COL16 };
+
+if ((msg <= 110) && (msg >= 90))  // Zoom
+  PIImage::CurrentPIImage()->SetZoom((int)(msg-100));
+else if ((msg > 200) && (msg < 206)) // Changement de couleur 
+  PIImage::CurrentPIImage()->SetColMap(cmap[msg-201]);
+
 }
 
@@ -140,12 +262,12 @@
 
 pdm[1] = new PIMenu(this, "Zoom");
-pdm[1]->AppendItem("Agr. *10", 110);
-pdm[1]->AppendItem("Agr. * 8", 108);
-pdm[1]->AppendItem("Agr. * 6", 106);
-pdm[1]->AppendItem("Agr. * 5", 105);
-pdm[1]->AppendItem("Agr. * 4", 104);
-pdm[1]->AppendItem("Agr. * 3", 103);
-pdm[1]->AppendItem("Agr. * 2", 102);
-pdm[1]->AppendItem("* 1", 101);
+pdm[1]->AppendItem("Agr. x10", 110);
+pdm[1]->AppendItem("Agr. x 8", 108);
+pdm[1]->AppendItem("Agr. x 6", 106);
+pdm[1]->AppendItem("Agr. x 5", 105);
+pdm[1]->AppendItem("Agr. x 4", 104);
+pdm[1]->AppendItem("Agr. x 3", 103);
+pdm[1]->AppendItem("Agr. x 2", 102);
+pdm[1]->AppendItem("Zoom x1", 101);
 pdm[1]->AppendItem("Red. / 2", 98);
 pdm[1]->AppendItem("Red. / 3", 97);
Index: trunk/SophyaPI/PI/piimgtools.h
===================================================================
--- trunk/SophyaPI/PI/piimgtools.h	(revision 115)
+++ trunk/SophyaPI/PI/piimgtools.h	(revision 116)
@@ -22,14 +22,27 @@
   virtual void  Show();
 
+  static PIImgLutWind* curlutw;
+  static void ShowPIImgLutWind();
 protected:
   virtual void  Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
 
 private:
-  PILabel * mLab[2];
-  PIButton * mBut[2];
-  PIText * mText[2];
-  PIOptMenu * mOpt[2];
-  PILabel * mOlb[2];
+// Pour changer la LUT
+  PILabel* mLab[2];
+  PIButton* mBut[2];
+  PIText* mText[2];
+  PIOptMenu* mOpt[2];
+  PILabel* mOlb[2];
+  PIScale* mSc[2];
+// Pour la couleur et le zoom
+  PIOptMenu* mOptzc[2];
+// Pour expand et compress
+  PIButton* mButsz[5];
+// Pour options d'affichage
+  PIButton* mButoa[6];
+// Config axes 
+  PIButton* mButcax[3];
 };
+
 
 class PIImgMenu : public PIMenu 
@@ -44,3 +57,4 @@
 };
 
+
 #endif
Index: trunk/SophyaPI/PI/pisurfdr.cc
===================================================================
--- trunk/SophyaPI/PI/pisurfdr.cc	(revision 115)
+++ trunk/SophyaPI/PI/pisurfdr.cc	(revision 116)
@@ -52,7 +52,7 @@
   float D = xmax-xmin;
   if (D < (ymax-ymin))  D = ymax-ymin;
-  D *= 1.4;
+  D *= 1.5;
   
-  Set3DView((xmin+xmax)/2., (ymin+ymax)/2, (zmin+zmax)/2., 
+  Set3DView((xmin+xmax)/2., (ymin+ymax)/2, (zmin+zmax)*0.4, 
             (xmin+xmax)/2.+D , (ymin+ymax)/2.+2.*D , zmin+(zmax-zmin)*0.1, 0.3, 0.3);  
 //  printf("PISurfaceDrawer::UpdateSize() : %g-%g  %g-%g  %g-%g (%g) \n", xmin,xmax,ymin,ymax,zmin,zmax,D);
