Index: /trunk/SophyaPI/PI/picmapview.cc
===================================================================
--- /trunk/SophyaPI/PI/picmapview.cc	(revision 129)
+++ /trunk/SophyaPI/PI/picmapview.cc	(revision 130)
@@ -13,5 +13,6 @@
 
 {
-  cmap = NULL; 
+  cmap = NULL;
+  vmin = 1.;   vmax = -1.; 
 }
 
@@ -25,14 +26,19 @@
  
 /* --Methode-- */
-void PICMapView::SetColMap(PIColorMap* cmp, bool refr)
+void PICMapView::SetColMap(PIColorMap* cmp, float min, float max, bool refr)
 {
   if (cmp == NULL)   { 
     if (cmap) delete cmap;
     cmap = NULL;
+    vmin = 1.;  vmax = -1.;
+    if (refr)  Refresh();  
     return;
     }
-  if ( cmap && (cmp->Type() == cmap->Type()) && (cmp->Type() != CMAP_OTHER) ) return;
+  if ( cmap && (cmp->Type() == cmap->Type()) && (cmp->Type() != CMAP_OTHER) 
+       && ((vmin-min) < 1.e-19) &&  ((vmin-min) > -1.e-19) &&
+       ((vmax-max) < 1.e-19) &&  ((vmax-max) > -1.e-19) )  return;
   if (cmap) delete cmap;
   cmap = new PIColorMap(*cmp);
+  vmin = min;  vmax = max;
   if (refr)  Refresh();  
   return;
@@ -40,9 +46,12 @@
 
 /* --Methode-- */
-void PICMapView::SetColMapId(CMapId cmapid, bool refr)
+void PICMapView::SetColMapId(CMapId cmapid, float min, float max, bool refr)
 {
-  if (cmap && (cmap->Type() == cmapid) && (cmapid != CMAP_OTHER) )  return;
+  if ( cmap && (cmapid == cmap->Type()) && (cmapid != CMAP_OTHER) 
+       && ((vmin-min) < 1.e-19) &&  ((vmin-min) > -1.e-19) &&
+       ((vmax-max) < 1.e-19) &&  ((vmax-max) > -1.e-19) )  return;
   if (cmap) delete cmap;
   cmap = new PIColorMap(cmapid);
+  vmin = min;  vmax = max;
   if (refr)  Refresh();  
   return;
@@ -85,4 +94,30 @@
   }
   
+  if (vmin > vmax)   return;
+  if ( (cmap->Type() == CMAP_GREY32) || (cmap->Type() == CMAP_GREYINV32) ||
+       (cmap->Type() == CMAP_GREY128) || (cmap->Type() == CMAP_GREYINV128) )  g->SelForeground(PI_Red);
+  else if ( (cmap->Type() == CMAP_COLRJ32) || (cmap->Type() == CMAP_COLRJ128) ) g->SelForeground(PI_Magenta);
+  else g->SelForeground(PI_White);
+
+  if (sx > sy) {    // horizontal
+    int fsz = (sy < 20) ? sy-8 : 12;
+    g->SelFontSzPt(fsz);
+    char buff[32];
+    sprintf(buff, "%.2f", vmin);
+    g->DrawString(4, sy-4, buff);
+    sprintf(buff, "%.2f", vmax);
+    g->DrawString(sx-4-(int)g->CalcStringWidth(buff), sy-4, buff);
+    } 
+  else {   // vertical 
+    int fsz = (sx < 40) ? sx/4 : 12;
+    g->SelFontSzPt(fsz);
+    char buff[32];
+    sprintf(buff, "%.2f", vmin);
+    g->DrawString(4, sy-4, buff);
+    sprintf(buff, "%.2f", vmax);
+    int fa, fd;
+    g->DrawString(4, g->GetFontHeight(fa,fd)+4, buff);
+    } 
+    
   return;
 }
Index: /trunk/SophyaPI/PI/picmapview.h
===================================================================
--- /trunk/SophyaPI/PI/picmapview.h	(revision 129)
+++ /trunk/SophyaPI/PI/picmapview.h	(revision 130)
@@ -23,6 +23,6 @@
   virtual long	  kind() {return ClassId; }
 
-  void            SetColMap(PIColorMap* cmp=NULL, bool refr=true);
-  void            SetColMapId(CMapId cmapid, bool refr=true);
+  void            SetColMap(PIColorMap* cmp=NULL, float min=1., float max=-1., bool refr=true);
+  void            SetColMapId(CMapId cmapid, float min=1., float max=-1., bool refr=true);
 
 // Traitement des evenements   
@@ -33,4 +33,5 @@
 protected:
   PIColorMap* cmap;
+  float vmin, vmax;
 };
 
Index: /trunk/SophyaPI/PI/pigraphps.cc
===================================================================
--- /trunk/SophyaPI/PI/pigraphps.cc	(revision 129)
+++ /trunk/SophyaPI/PI/pigraphps.cc	(revision 130)
@@ -65,4 +65,5 @@
 void PIGraphicPS::Erase(PIGrCoord, PIGrCoord, PIGrCoord, PIGrCoord)
 {
+// A Faire ??? $CHECK$ 
 return;
 }
@@ -137,13 +138,15 @@
 xtmp = new float[n];
 ytmp = new float[n];
-
-float xoff,yoff;
-if (cinc) { xoff=yoff=0.; }   // Coord en mode incremental
-else { xoff = (float)x[0];  yoff = (float)y[0]; }   //   Coord en mode absolu
-for(i=0;i<n;i++) {
-  xtmp[i] = (float)x[i]-xoff;
-  ytmp[i] = (float)y[i]-yoff;
-}
-mPSOut->DrawPolygon(xtmp,ytmp,n,mFCol,mLAtt);
+for(int i = 0 ; i < n ; i++) {xtmp[i] = (float)x[i] ; ytmp[i] = (float)y[i] ; }
+//float xoff,yoff;
+//if (cinc) { xoff=yoff=0.; }   // Coord en mode incremental
+//else { xoff = (float)x[0];  yoff = (float)y[0]; }   //   Coord en mode absolu
+//xtmp[0] = (float)x[0];
+//ytmp[0] = (float)y[0];
+//for(i=1;i<n;i++) {
+//  xtmp[i] = (float)x[i]-xoff;
+//  ytmp[i] = (float)y[i]-yoff;
+//}
+mPSOut->DrawPolygon(xtmp,ytmp,n,mFCol,mLAtt,cinc);
 delete[] xtmp;
 delete[] ytmp;
@@ -164,13 +167,15 @@
 xtmp = new float[n];
 ytmp = new float[n];
-
-float xoff,yoff;
-if (cinc) { xoff=yoff=0.; }   // Coord en mode incremental
-else { xoff = (float)x[0];  yoff = (float)y[0]; }   //   Coord en mode absolu
-for(i=0;i<n;i++) {
-  xtmp[i] = (float)x[i]-xoff;
-  ytmp[i] = (float)y[i]-yoff;
-}
-mPSOut->DrawFPolygon(xtmp,ytmp,n,mFCol,mFCol,mLAtt);
+for(int i = 0 ; i < n ; i++) {xtmp[i] = (float)x[i] ; ytmp[i] = (float)y[i] ; }
+//float xoff,yoff;
+//if (cinc) { xoff=yoff=0.; }   // Coord en mode incremental
+//else { xoff = (float)x[0];  yoff = (float)y[0]; }   //   Coord en mode absolu
+//xtmp[0] = (float)x[0];
+//ytmp[0] = (float)y[0];
+//for(i=1;i<n;i++) {
+//  xtmp[i] = (float)x[i]-xoff;
+//  ytmp[i] = (float)y[i]-yoff;
+//}
+mPSOut->DrawFPolygon(xtmp,ytmp,n,mFCol,mFCol,mLAtt,cinc);
 delete[] xtmp;
 delete[] ytmp;
@@ -215,5 +220,5 @@
 {
 if ( (sx < 1) || (sy < 1) )  return;
-if ((pix == NULL) || (cmap == NULL)) return; 
+if ((pix == NULL) || (cmap == NULL)) return;
 if(mPSOut) 
   mPSOut->Image((float)x, (float)y, (float)sx, (float)sy, sx, sy, pix, cmap);
@@ -238,6 +243,8 @@
 void PIGraphicPS::SelForeground(PIColorMap& cmap, int cid)
 {
+// A Faire Voir Nicolas  
 mFCfMap = cmap.GetColor(cid);
 mFCol = PI_ColorFromMap;
+mPSOut->SelForeground(cmap, cid) ; 
 return;
 }
@@ -246,4 +253,5 @@
 void PIGraphicPS::SelBackground(PIColorMap& cmap, int cid)
 {
+// A Faire Voir Nicolas  
 mBCfMap = cmap.GetColor(cid);
 mBCol = PI_ColorFromMap;
@@ -385,5 +393,5 @@
 PIGrCoord PIGraphicPS::CalcStringWidth(char const* s)
 {
-return((float)(mFSize*strlen(s)));   /*  $CHECK$  Voir Nicolas ! */
+return((float)(mFSize*strlen(s)*0.5));   /*  facteur 0.5 ad'hoc $CHECK$  Voir Nicolas ! */
 }
 
Index: /trunk/SophyaPI/PI/piimage.cc
===================================================================
--- /trunk/SophyaPI/PI/piimage.cc	(revision 129)
+++ /trunk/SophyaPI/PI/piimage.cc	(revision 130)
@@ -114,5 +114,5 @@
   gvw->SetUserData(NULL, 0); 
   }
-if (cmvw)  cmvw->SetColMap(NULL, true);
+if (cmvw)  cmvw->SetColMap(NULL, 1., -1., true);
 if (lut) delete lut;
 delete mdrw;
@@ -201,5 +201,5 @@
 {
 cmvw = cw;
-if (cmvw && refr) cmvw->SetColMap(cmap, true);
+if (cmvw && refr) cmvw->SetColMap(cmap, Lut()->Min(), Lut()->Max(), true);
 }
 
@@ -352,5 +352,5 @@
 if (zow)  zow->SetColMap(cmp, refr);
 if (gvw)  gvw->SetColMap(cmp, refr);
-if (cmvw) cmvw->SetColMap(cmp, refr);
+if (cmvw) cmvw->SetColMap(cmap, Lut()->Min(), Lut()->Max(), refr);
 return;
 }
@@ -365,5 +365,5 @@
 if (zow)  zow->SetColMapId(cmapid, refr);
 if (gvw)  gvw->SetColMapId(cmapid, refr);
-if (cmvw) cmvw->SetColMapId(cmapid, refr);
+if (cmvw) cmvw->SetColMapId(cmapid, Lut()->Min(), Lut()->Max(), refr);
 return;
 }
@@ -392,5 +392,5 @@
 if (gvw != NULL)
   if ( (gvw->UserData() != this) || (mw) )  SetGloVPixmap();
-if (cmvw) cmvw->SetColMap(cmap, true);
+if (cmvw) cmvw->SetColMap(cmap, Lut()->Min(), Lut()->Max(), true);
   
 return;
@@ -849,5 +849,6 @@
 
 g->SelGOMode(PI_GOCopy);
-if ( (GetColMapId() == CMAP_GREY32) || (GetColMapId() == CMAP_GREYINV32) )  g->SelForeground(PI_Red);
+if ( (GetColMapId() == CMAP_GREY32) || (GetColMapId() == CMAP_GREYINV32) ||
+     (GetColMapId() == CMAP_GREY128) || (GetColMapId() == CMAP_GREYINV128) )  g->SelForeground(PI_Red);
 else  g->SelForeground(PI_White);
 
@@ -855,5 +856,5 @@
 else g->SelLine(PI_ThickLine);
 
-if ((xcurs>=0) && (ycurs>=0)) {
+if ((xcurs>=0) && (ycurs>=0) && (g->kind() != PI_PSFileGraphics ) ) {
   PIPixmap::Draw(g, xcurs-3, ycurs-CURSHSIZE, 6, CURSHSIZE*2); 
   PIPixmap::Draw(g, xcurs-CURSHSIZE, ycurs-3, CURSHSIZE*2, 6); 
@@ -893,5 +894,5 @@
   int a,d,h;
   h = g->GetFontHeight(a, d);
-  PIPixmap::Draw(g, 0, YSize()-10-h, XSize(), h+10); 
+  if (g->kind() != PI_PSFileGraphics )   PIPixmap::Draw(g, 0, YSize()-10-h, XSize(), h+10); 
   }
 return;
Index: /trunk/SophyaPI/PI/pipodrw.cc
===================================================================
--- /trunk/SophyaPI/PI/pipodrw.cc	(revision 129)
+++ /trunk/SophyaPI/PI/pipodrw.cc	(revision 130)
@@ -1,2 +1,6 @@
+//  Adaptateurs et Drawers divers pour Outils PEIDA++
+//                             R. Ansari  06-08/98
+// LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA
+
 #include "pipodrw.h"
 #include "generalfit.h"
@@ -83,5 +87,8 @@
 }
 
+// ----------------------------------------------------------
 // Adaptateur de vecteurs Peida++ a P1DArrayAdapter
+// ----------------------------------------------------------
+
 /* --Methode-- */
 POVectorAdapter::POVectorAdapter(Vector* v, bool ad)
@@ -103,5 +110,8 @@
 }
 
+// ----------------------------------------------------------
 // Adaptateur d'Histo-2D Peida++ a P2DArrayAdapter
+// ----------------------------------------------------------
+
 /* --Methode-- */
 POH2DAdapter::POH2DAdapter(Histo2D* h2d, bool ad)
@@ -123,2 +133,29 @@
 return((*mH2d)(ix, iy));
 }
+
+// ----------------------------------------------------------
+// Adaptateur de matrice Peida++ a P2DArrayAdapter
+// Attention  Y: Lignes (rows)  X: Colonnes
+// ----------------------------------------------------------
+
+/* --Methode-- */
+POMatrixAdapter::POMatrixAdapter(Matrix* mtx, bool ad)
+        : P2DArrayAdapter(mtx->NCol(), mtx->NRows())
+{
+aDel = ad; mMtx = mtx;
+}
+
+/* --Methode-- */
+POMatrixAdapter::~POMatrixAdapter()
+{
+if (aDel)  delete mMtx;
+}
+
+/* --Methode-- */
+float POMatrixAdapter::Value(int ix, int iy)
+{
+// Attention MatrixAdapter(X=Colonne, Y= Row) = Matrix(row, col)  
+return((*mMtx)(iy, ix));
+}
+
+
Index: /trunk/SophyaPI/PI/pipodrw.h
===================================================================
--- /trunk/SophyaPI/PI/pipodrw.h	(revision 129)
+++ /trunk/SophyaPI/PI/pipodrw.h	(revision 130)
@@ -10,4 +10,5 @@
 #include "parradapter.h"
 #include "cvector.h"
+#include "matrix.h"
 #include "histos2.h"
 
@@ -63,3 +64,18 @@
 };
 
+// Adaptateur de matrice Peida++ a P2DArrayAdapter
+// Attention MatrixAdapter(X=Colonne, Y= Row) = Matrix(row, col)  
+class POMatrixAdapter :  public P2DArrayAdapter {
+public :
+                  POMatrixAdapter(Matrix* mtx, bool ad=false);
+  virtual         ~POMatrixAdapter();
+
+  virtual float   Value(int ix, int iy);   
+
+protected:
+  bool aDel;
+  Matrix* mMtx;
+};
+
+
 #endif
Index: /trunk/SophyaPI/PI/piscdrawwdg.cc
===================================================================
--- /trunk/SophyaPI/PI/piscdrawwdg.cc	(revision 129)
+++ /trunk/SophyaPI/PI/piscdrawwdg.cc	(revision 130)
@@ -241,5 +241,9 @@
 
 
+// ----------------------------------------------------------
 //  Classe de trace de points/fonctions Y=f(X)
+//  Trace Y=ay->Value() = f(X= ax->Value()) si ax et ay != NULL
+//  Trace Y=ax->Value() = f(X= ax->X())  si ay == NULL
+// ----------------------------------------------------------
 
 /* --Methode-- */
@@ -250,6 +254,9 @@
   mAx = ax;
   mAy = ay;
-  if ((mAx == NULL) || (mAy == NULL))  mSz = 0;
-  else mSz = (mAx->Size() < mAy->Size()) ? mAx->Size() :  mAy->Size();
+  if ((mAx == NULL))  mSz = 0;
+  else {
+    if (!mAy)  mSz = mAx->Size();
+    else   mSz = (mAx->Size() < mAy->Size()) ? mAx->Size() :  mAy->Size();
+    }
 } 
 
@@ -270,5 +277,5 @@
   ymin = ymax = mAy->Value(i);
   float cv;
-  for(i=0; i<mSz; i++) {
+  if (mAy) for(i=0; i<mSz; i++) {
     cv = mAx->Value(i); 
     if (cv < xmin)  xmin = cv;
@@ -277,5 +284,14 @@
     if (cv < ymin)  ymin = cv;
     if (cv > ymax)  ymax = cv;
-  } 
+    }
+  else  for(i=0; i<mSz; i++) {
+    cv = mAx->X(i); 
+    if (cv < xmin)  xmin = cv;
+    if (cv > xmax)  xmax = cv;
+    cv = mAx->Value(i); 
+    if (cv < ymin)  ymin = cv;
+    if (cv > ymax)  ymax = cv;
+    }
+
   float dx, dy;
   dx = 0.02*(xmax-xmin);
@@ -298,6 +314,6 @@
   if ( (mMrk != PI_NotDefMarker) ||  (mLAtt == PI_NotDefLineAtt) ) {
     for(i=0; i<mSz; i++) {
-      xp = mAx->Value(i);
-      yp = mAy->Value(i);
+      if (mAy) { xp = mAx->Value(i); yp = mAy->Value(i); }
+      else { xp = mAx->X(i);  yp = mAx->Value(i); }
       if ( (xp < xmin) || (xp > xmax) || (yp < ymin) || (yp > ymax) )  continue;
       g->DrawMarker(xp, yp);
@@ -309,9 +325,9 @@
 // Trace des lignes 
   float xp2, yp2;
-  xp = mAx->Value(0);
-  yp = mAy->Value(0);
+  if (mAy) { xp = mAx->Value(0); yp = mAy->Value(0); }
+  else { xp = mAx->X(0);  yp = mAx->Value(0); }
   for(i=1; i<mSz; i++) {
-    xp2 = mAx->Value(i);
-    yp2 = mAy->Value(i);
+    if (mAy) { xp2 = mAx->Value(i); yp2 = mAy->Value(i); }
+    else { xp2 = mAx->X(i);  yp2 = mAx->Value(i); }
     if ( ((xp < xmin) || (xp > xmax) || (yp < ymin) || (yp > ymax)) &&
          ((xp2 < xmin) || (xp2 > xmax) || (yp2 < ymin) || (yp2 > ymax)) )  continue;
Index: /trunk/SophyaPI/PI/piscdrawwdg.h
===================================================================
--- /trunk/SophyaPI/PI/piscdrawwdg.h	(revision 129)
+++ /trunk/SophyaPI/PI/piscdrawwdg.h	(revision 130)
@@ -1,3 +1,4 @@
-// Module PI : Peida Interactive     PIScDrawWdg
+// This may look like C code, but it is really -*- C++ -*-
+// Module PI : Peida Interactive  PIScDrawWdg PIYfXDrawer
 // Gestionnaire Drawer-2D  E.Aubourg, R. Ansari  96-98
 // LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA
@@ -81,6 +82,9 @@
 
 
+// ----------------------------------------------------------
 // Classe de traceur de points/fonction Y=F(x)
-
+// Trace Y=ay->Value() = f(X= ax->Value()) si ax et ay != NULL
+// Trace Y=ax->Value() = f(X= ax->X())  si ay == NULL
+ 
 class P1DArrayAdapter;
 class PIYfXDrawer : public PIDrawer {
Index: /trunk/SophyaPI/PI/psfile.cc
===================================================================
--- /trunk/SophyaPI/PI/psfile.cc	(revision 129)
+++ /trunk/SophyaPI/PI/psfile.cc	(revision 130)
@@ -29,5 +29,5 @@
   PI_Landscape, PI_Portrait,\
   \
-  PI_Black, PI_White, PI_Grey, PI_Red, PI_Blue,\
+  PI_ColorFromMap, PI_Black, PI_White, PI_Grey, PI_Red, PI_Blue,\
   PI_Green, PI_Yellow, PI_Magenta, PI_NotDefColor,\
   \
@@ -41,4 +41,5 @@
 $PIDict begin $PIDict /mtrx matrix put /Landscape %d def /Portrait %d def\n\
 %% Couleurs et fontes courantes\n\
+/C%-2d  {ur    ug    ub    setrgbcolor} bind def %% PI_ColorFromMap\n\
 /C%-2d  {0.0   0.0   0.0   setrgbcolor} bind def %% PI_Black\n\
 /C%-2d  {0.996 0.996 0.996 setrgbcolor} bind def %% PI_White\n\
@@ -50,7 +51,7 @@
 /C%-2d  {0.996 0.0   0.996 setrgbcolor} bind def %% PI_Magenta\n\
 /C%-2d  {}                              bind def %% PI_NotDefColor\n\
-/F%-2d  {/Times-Roman   findfont} bind def       %% PI_RomanFont\n\
-/F%-2d  {/Times-Bold    findfont} bind def       %% PI_BoldFont\n\
-/F%-2d  {/Times-Italic  findfont} bind def       %% PI_ItalicFont\n\
+/F%-2d  {/Courier   findfont} bind def       %% PI_RomanFont\n\
+/F%-2d  {/Courier-Bold    findfont} bind def       %% PI_BoldFont\n\
+/F%-2d  {/Courier-Italic  findfont} bind def       %% PI_ItalicFont\n\
 /F%-2d  {}\
                         bind def       %% PI_NotDefFontAtt\n\
@@ -616,4 +617,20 @@
 }
 
+void PSFile::SelForeground(PIColorMap& cmap, int cid)
+{
+  mDrawColor = PI_ColorFromMap ; 
+  PIColor tmp = cmap.GetColor(cid) ; 
+  fprintf(mPSFile, "/ur %.3f def /ug %.3f def /ub %.3f def \n", 
+          (float)(tmp.red)/65535., 
+          (float)(tmp.green)/65535., 
+          (float)(tmp.blue)/65535.) ; 
+}
+
+
+void PSFile::SelBackground(PIColorMap& cmap, int cid)
+{
+  mDrawColor = PI_ColorFromMap ; 
+}
+
 
 void  PSFile::DrawString  (float x,  float y, char *s, 
@@ -646,8 +663,24 @@
 		   PILineAtt LineAtt) {
 
+  int lw = 0 ; 
+
+  switch(LineAtt) {
+    case PI_NotDefLineAtt:
+      break ; 
+    case PI_NormalLine:
+      lw = 2. ; 
+      break ; 
+    case PI_ThinLine:
+      lw = 1 ; 
+      break ; 
+    case PI_ThickLine:
+      lw = 4 ;
+      break ; 
+  } 
+
     /* Line Att */
     if ( (LineAtt != PI_NotDefLineAtt) || (LineAtt != mLineAtt) ) {
         mLineAtt = LineAtt;
-	fprintf(mPSFile, "%d slw ", mLineAtt) ; 
+	fprintf(mPSFile, "%d slw ", lw) ; 
     }
 
@@ -767,7 +800,8 @@
 
 
+// Les coordonnees sont supposees etre en mode incremental .
 void  PSFile::DrawPolygon (float *x, float *y, int n,
 		   PIColors DrawColor, 
-		   PILineAtt LineAtt) {
+		   PILineAtt LineAtt, bool cinc) {
 
     /* Line Att */
@@ -785,7 +819,11 @@
     /* On dessine ; ici*/
     fprintf(mPSFile, "%.2f Ux %.2f Uy m\n", x[0], y[0]);
-    for(int i = 0; i<n; i++) 
-	fprintf(mPSFile, "%.2f Ux %.2f Uy %.2f Ux %.2f Uy l\n",
-		x[i+1], y[i+1], x[i], y[i]);
+
+    char* cmd ; 
+    if(cinc == true) cmd = "%.2f Ux %.2f Uy rl\n" ; 
+    else             cmd = "%.2f Ux %.2f Uy l\n" ; 
+
+    for(int i = 1; i<n; i++) 
+      fprintf(mPSFile, cmd, x[i], y[i]);
     fprintf(mPSFile, "c s\n");
 }
@@ -795,5 +833,5 @@
 		   PIColors DrawColor,
 		   PIColors FillColor,
-		   PILineAtt LineAtt) {
+		   PILineAtt LineAtt, bool cinc) {
 
     /* Line Att */
@@ -802,4 +840,8 @@
 	fprintf(mPSFile, "%d slw ", mLineAtt) ; 
     }
+
+    char* cmd ; 
+    if(cinc == true) cmd = "%.2f Ux %.2f Uy rl\n" ; 
+    else             cmd = "%.2f Ux %.2f Uy l\n" ; 
 
     /* Dessin du fond... */
@@ -809,7 +851,6 @@
     fprintf(mPSFile, "%.2f Ux %.2f Uy m\n", x[0], y[0]);
     int i;
-    for(i = 0; i<n; i++) 
-	fprintf(mPSFile, "%.2f Ux %.2f Uy %.2f Ux %.2f Uy l\n",
-		x[i+1], y[i+1], x[i], y[i]);
+    for(i = 1; i<n; i++) 
+	fprintf(mPSFile, cmd, x[i], y[i]);
     fprintf(mPSFile, "c f\n");
 
@@ -819,7 +860,6 @@
     fprintf(mPSFile, "C%d ", mDrawColor) ;
     fprintf(mPSFile, "%.2f Ux %.2f Uy m\n", x[0], y[0]);
-    for(i = 0; i<n; i++) 
-	fprintf(mPSFile, "%.2f Ux %.2f Uy %.2f Ux %.2f Uy l\n",
-		x[i+1], y[i+1], x[i], y[i]);
+    for(i = 1; i<n; i++) 
+      fprintf(mPSFile, cmd, x[i], y[i]);
     fprintf(mPSFile, "c s\n");
 }
@@ -899,5 +939,5 @@
     }
     /* Emplacement de l'image */
-    fprintf(mPSFile, "gs %.2f  %.2f  tr %.2f Ux %.2f Uy sc\n", x0, y0, Tx, Ty);
+    fprintf(mPSFile, "gs %.2f Ux %.2f Uy tr %.2f Ux %.2f Uy sc\n", x0, y0, Tx, Ty);
     /* Nbr pix-X, Nbr pix-Y bits/pixels */
     fprintf(mPSFile, "%d %d 8\n", Nx, Ny);
Index: /trunk/SophyaPI/PI/psfile.h
===================================================================
--- /trunk/SophyaPI/PI/psfile.h	(revision 129)
+++ /trunk/SophyaPI/PI/psfile.h	(revision 130)
@@ -99,4 +99,7 @@
     virtual void  EndBloc();
 
+    virtual void SelForeground(PIColorMap& cmap, int cid) ; 
+    virtual void SelBackground(PIColorMap& cmap, int cid) ; 
+
     /* Trace */
     virtual void  DrawString  (float x,  float y, char *s, 
@@ -123,9 +126,11 @@
     virtual void  DrawPolygon (float *x, float *y, int n,
 			       PIColors DrawColor  = PI_NotDefColor, 
-			       PILineAtt LineAtt   = PI_NotDefLineAtt);
+			       PILineAtt LineAtt   = PI_NotDefLineAtt, 
+                               bool cinc = true);
     virtual void  DrawFPolygon(float *x, float *y, int n,
 			       PIColors DrawColor  = PI_NotDefColor,
 			       PIColors FillColor  = PI_NotDefColor,
-			       PILineAtt LineAtt   = PI_NotDefLineAtt);
+			       PILineAtt LineAtt   = PI_NotDefLineAtt, 
+                               bool cinc = true);
     virtual void  DrawMarker  (float x0, float y0, 
 			       PIMarker MrkType    = PI_NotDefMarker, 
