Index: /trunk/SophyaPI/PIext/pintup3d.cc
===================================================================
--- /trunk/SophyaPI/PIext/pintup3d.cc	(revision 2399)
+++ /trunk/SophyaPI/PIext/pintup3d.cc	(revision 2400)
@@ -48,6 +48,8 @@
   mNT = nt;
   mAdDO = ad; 
+  mAutoScaleXY = mAutoScaleZ = true;
   UseSizeScale(true, 5);
   UseColorScale(true);
+  ConnectPoints(false);
   SelectXYZ(NULL, NULL, NULL);
   SelectWt(NULL);
@@ -139,4 +141,12 @@
   mNT->GetMinMax(zK, zmin, zmax);
 
+  ComputeScaleFactor(xmin, xmax, ymin, ymax, zmin, zmax, 
+		     mAutoScaleXY, mAutoScaleZ, mScy, mScz);
+  
+  // cout << " DEBUG - NTup3D X:" << XMin3() << "-" << XMax3() " s=" << mScx
+  //     <<  " Y:" YMin3() << "-" << YMax3() << " 
+  xmin *= mScx;  xmax *= mScx; 
+  ymin *= mScy;  ymax *= mScy; 
+  zmin *= mScz;  zmax *= mScz; 
 // Centre du champ en C = (xmin+xmax)/2., (ymin+ymax)/2  (zmin+zmax)*0.5
 // Distance D = Max(xmax-xmin,ymin-ymax)*2
@@ -149,4 +159,6 @@
             (xmin+xmax)/2.+D , (ymin+ymax)/2.-2.5*D , zmin+(zmax-zmin)*0.85, 0.25, 0.25);  
 
+  Set3DBox(xmin, xmax, ymin, ymax, zmin, zmax, mScx, mScy, mScz);
+
   /*
   x3Min = xmin;  // - PERC_GARDE*(xmax-xmin);
@@ -158,5 +170,4 @@
   */
 
-  Set3DBox(xmin, xmax, ymin, ymax, zmin, zmax);
 
 //  printf("PINTuple3D::UpdateLimits() : %g .. %g  %g .. %g  %g .. %g (%g) \n", xmin,xmax,ymin,ymax,zmin,zmax,D);
@@ -241,22 +252,24 @@
 
   if ( (i > 0) && connectPts ) // On relie les points ...
-    g3->DrawLine3D(xl, yl, zl, xp, yp, zp);
+    g3->DrawLine3D(xl*mScx, yl*mScy, zl*mScz, xp*mScx, yp*mScy, zp*mScz);
   nok++;
   if ( xebK >= 0 ) {
     xer = mNT->GetCell(i, xebK);
-    g3->DrawLine3D(xp-xer, yp, zp, xp+xer, yp, zp);
+    g3->DrawLine3D((xp-xer)*mScx, yp*mScy, zp*mScz, (xp+xer)*mScx, yp*mScy, zp*mScz);
   }
   if ( yebK >= 0 ) {
     yer = mNT->GetCell(i, yebK);
-    g3->DrawLine3D(xp, yp-yer, zp, xp, yp+yer, zp);
+    g3->DrawLine3D(xp*mScx, (yp-yer)*mScy, zp*mScz, xp*mScx, (yp+yer)*mScy, zp*mScz);
   }
   if ( zebK >= 0 ) {
     zer = mNT->GetCell(i, zebK);
-    g3->DrawLine3D(xp, yp, zp-zer, xp, yp, zp+zer);
+    g3->DrawLine3D(xp*mScx, yp*mScy, (zp-zer)*mScz, xp*mScx, yp*mScy, (zp+zer)*mScz);
   }
   // Trace du marker
-  if ((wK >= 0)||(lK < 0)||(mmrk != PI_NotDefMarker))  g3->DrawMarker3D(xp, yp, zp); 
+  if ((wK >= 0)||(lK < 0)||(mmrk != PI_NotDefMarker))  
+    g3->DrawMarker3D(xp*mScx, yp*mScy, zp*mScz); 
   // Trace eventuel du label
-  if (lK >= 0) g3->DrawString3D(xp, yp, zp, mNT->GetCelltoString(i, lK).c_str());
+  if (lK >= 0) g3->DrawString3D(xp*mScx, yp*mScy, zp*mScz, 
+				mNT->GetCelltoString(i, lK).c_str());
 }
 
@@ -303,4 +316,8 @@
       UseSizeScale(true, nbn);
     }
+    else if (opts == "rescalexy") mAutoScaleXY = true;
+    else if (opts == "norescalexy") mAutoScaleXY = false;
+    else if (opts == "rescalez") mAutoScaleZ = true;
+    else if (opts == "norescalez") mAutoScaleZ = false;
     else {
       // Si option non decode
@@ -325,6 +342,4 @@
 void PINTuple3D::GetOptionsHelpInfo(string& info)
 {
-// On recupere d'abord la chaine info de la classe de base
-PIDrawer::GetOptionsHelpInfo(info);
 info += " ---- PINTuple3D options help info : \n" ;
 info += "  connectpoints: The points are connected by a line \n";
@@ -332,5 +347,8 @@
 info += "  colorscale/nocolorscale (Use color scale for weight) \n";
 info += "  sizescale/sizescale=nbins/nosizescale (Use marker size for weight) \n";
+info += "  rescalexy / norescalexy   rescalez / norescalez \n";
 info += "  and usual color/line/marker/... attribute decoding  \n";
+// On recupere ensuite la chaine info de la classe de base
+PIDrawer::GetOptionsHelpInfo(info);
 return;
 }
Index: /trunk/SophyaPI/PIext/pintup3d.h
===================================================================
--- /trunk/SophyaPI/PIext/pintup3d.h	(revision 2399)
+++ /trunk/SophyaPI/PIext/pintup3d.h	(revision 2400)
@@ -37,4 +37,5 @@
   NTupleInterface* mNT;
   bool mAdDO;
+  bool mAutoScaleXY, mAutoScaleZ;
   int xK, yK, zK;           // Index du nom de variable en X/Y/Z ds le ntuple
   int xebK, yebK, zebK;     // Index du nom de variable en ErrBarX/Y/Z ds le ntuple
