Changeset 130 in Sophya for trunk/SophyaPI


Ignore:
Timestamp:
Aug 7, 1998, 7:14:31 PM (27 years ago)
Author:
ercodmgr
Message:

Correction PSFile et ajout texte ds PICMapViewer Reza 07/08/98

Location:
trunk/SophyaPI/PI
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/picmapview.cc

    r128 r130  
    1313
    1414{
    15   cmap = NULL;
     15  cmap = NULL;
     16  vmin = 1.;   vmax = -1.;
    1617}
    1718
     
    2526 
    2627/* --Methode-- */
    27 void PICMapView::SetColMap(PIColorMap* cmp, bool refr)
     28void PICMapView::SetColMap(PIColorMap* cmp, float min, float max, bool refr)
    2829{
    2930  if (cmp == NULL)   {
    3031    if (cmap) delete cmap;
    3132    cmap = NULL;
     33    vmin = 1.;  vmax = -1.;
     34    if (refr)  Refresh(); 
    3235    return;
    3336    }
    34   if ( cmap && (cmp->Type() == cmap->Type()) && (cmp->Type() != CMAP_OTHER) ) return;
     37  if ( cmap && (cmp->Type() == cmap->Type()) && (cmp->Type() != CMAP_OTHER)
     38       && ((vmin-min) < 1.e-19) &&  ((vmin-min) > -1.e-19) &&
     39       ((vmax-max) < 1.e-19) &&  ((vmax-max) > -1.e-19) )  return;
    3540  if (cmap) delete cmap;
    3641  cmap = new PIColorMap(*cmp);
     42  vmin = min;  vmax = max;
    3743  if (refr)  Refresh(); 
    3844  return;
     
    4046
    4147/* --Methode-- */
    42 void PICMapView::SetColMapId(CMapId cmapid, bool refr)
     48void PICMapView::SetColMapId(CMapId cmapid, float min, float max, bool refr)
    4349{
    44   if (cmap && (cmap->Type() == cmapid) && (cmapid != CMAP_OTHER) )  return;
     50  if ( cmap && (cmapid == cmap->Type()) && (cmapid != CMAP_OTHER)
     51       && ((vmin-min) < 1.e-19) &&  ((vmin-min) > -1.e-19) &&
     52       ((vmax-max) < 1.e-19) &&  ((vmax-max) > -1.e-19) )  return;
    4553  if (cmap) delete cmap;
    4654  cmap = new PIColorMap(cmapid);
     55  vmin = min;  vmax = max;
    4756  if (refr)  Refresh(); 
    4857  return;
     
    8594  }
    8695 
     96  if (vmin > vmax)   return;
     97  if ( (cmap->Type() == CMAP_GREY32) || (cmap->Type() == CMAP_GREYINV32) ||
     98       (cmap->Type() == CMAP_GREY128) || (cmap->Type() == CMAP_GREYINV128) )  g->SelForeground(PI_Red);
     99  else if ( (cmap->Type() == CMAP_COLRJ32) || (cmap->Type() == CMAP_COLRJ128) ) g->SelForeground(PI_Magenta);
     100  else g->SelForeground(PI_White);
     101
     102  if (sx > sy) {    // horizontal
     103    int fsz = (sy < 20) ? sy-8 : 12;
     104    g->SelFontSzPt(fsz);
     105    char buff[32];
     106    sprintf(buff, "%.2f", vmin);
     107    g->DrawString(4, sy-4, buff);
     108    sprintf(buff, "%.2f", vmax);
     109    g->DrawString(sx-4-(int)g->CalcStringWidth(buff), sy-4, buff);
     110    }
     111  else {   // vertical
     112    int fsz = (sx < 40) ? sx/4 : 12;
     113    g->SelFontSzPt(fsz);
     114    char buff[32];
     115    sprintf(buff, "%.2f", vmin);
     116    g->DrawString(4, sy-4, buff);
     117    sprintf(buff, "%.2f", vmax);
     118    int fa, fd;
     119    g->DrawString(4, g->GetFontHeight(fa,fd)+4, buff);
     120    }
     121   
    87122  return;
    88123}
  • trunk/SophyaPI/PI/picmapview.h

    r127 r130  
    2323  virtual long    kind() {return ClassId; }
    2424
    25   void            SetColMap(PIColorMap* cmp=NULL, bool refr=true);
    26   void            SetColMapId(CMapId cmapid, bool refr=true);
     25  void            SetColMap(PIColorMap* cmp=NULL, float min=1., float max=-1., bool refr=true);
     26  void            SetColMapId(CMapId cmapid, float min=1., float max=-1., bool refr=true);
    2727
    2828// Traitement des evenements   
     
    3333protected:
    3434  PIColorMap* cmap;
     35  float vmin, vmax;
    3536};
    3637
  • trunk/SophyaPI/PI/pigraphps.cc

    r113 r130  
    6565void PIGraphicPS::Erase(PIGrCoord, PIGrCoord, PIGrCoord, PIGrCoord)
    6666{
     67// A Faire ??? $CHECK$
    6768return;
    6869}
     
    137138xtmp = new float[n];
    138139ytmp = new float[n];
    139 
    140 float xoff,yoff;
    141 if (cinc) { xoff=yoff=0.; }   // Coord en mode incremental
    142 else { xoff = (float)x[0];  yoff = (float)y[0]; }   //   Coord en mode absolu
    143 for(i=0;i<n;i++) {
    144   xtmp[i] = (float)x[i]-xoff;
    145   ytmp[i] = (float)y[i]-yoff;
    146 }
    147 mPSOut->DrawPolygon(xtmp,ytmp,n,mFCol,mLAtt);
     140for(int i = 0 ; i < n ; i++) {xtmp[i] = (float)x[i] ; ytmp[i] = (float)y[i] ; }
     141//float xoff,yoff;
     142//if (cinc) { xoff=yoff=0.; }   // Coord en mode incremental
     143//else { xoff = (float)x[0];  yoff = (float)y[0]; }   //   Coord en mode absolu
     144//xtmp[0] = (float)x[0];
     145//ytmp[0] = (float)y[0];
     146//for(i=1;i<n;i++) {
     147//  xtmp[i] = (float)x[i]-xoff;
     148//  ytmp[i] = (float)y[i]-yoff;
     149//}
     150mPSOut->DrawPolygon(xtmp,ytmp,n,mFCol,mLAtt,cinc);
    148151delete[] xtmp;
    149152delete[] ytmp;
     
    164167xtmp = new float[n];
    165168ytmp = new float[n];
    166 
    167 float xoff,yoff;
    168 if (cinc) { xoff=yoff=0.; }   // Coord en mode incremental
    169 else { xoff = (float)x[0];  yoff = (float)y[0]; }   //   Coord en mode absolu
    170 for(i=0;i<n;i++) {
    171   xtmp[i] = (float)x[i]-xoff;
    172   ytmp[i] = (float)y[i]-yoff;
    173 }
    174 mPSOut->DrawFPolygon(xtmp,ytmp,n,mFCol,mFCol,mLAtt);
     169for(int i = 0 ; i < n ; i++) {xtmp[i] = (float)x[i] ; ytmp[i] = (float)y[i] ; }
     170//float xoff,yoff;
     171//if (cinc) { xoff=yoff=0.; }   // Coord en mode incremental
     172//else { xoff = (float)x[0];  yoff = (float)y[0]; }   //   Coord en mode absolu
     173//xtmp[0] = (float)x[0];
     174//ytmp[0] = (float)y[0];
     175//for(i=1;i<n;i++) {
     176//  xtmp[i] = (float)x[i]-xoff;
     177//  ytmp[i] = (float)y[i]-yoff;
     178//}
     179mPSOut->DrawFPolygon(xtmp,ytmp,n,mFCol,mFCol,mLAtt,cinc);
    175180delete[] xtmp;
    176181delete[] ytmp;
     
    215220{
    216221if ( (sx < 1) || (sy < 1) )  return;
    217 if ((pix == NULL) || (cmap == NULL)) return; 
     222if ((pix == NULL) || (cmap == NULL)) return;
    218223if(mPSOut)
    219224  mPSOut->Image((float)x, (float)y, (float)sx, (float)sy, sx, sy, pix, cmap);
     
    238243void PIGraphicPS::SelForeground(PIColorMap& cmap, int cid)
    239244{
     245// A Faire Voir Nicolas 
    240246mFCfMap = cmap.GetColor(cid);
    241247mFCol = PI_ColorFromMap;
     248mPSOut->SelForeground(cmap, cid) ;
    242249return;
    243250}
     
    246253void PIGraphicPS::SelBackground(PIColorMap& cmap, int cid)
    247254{
     255// A Faire Voir Nicolas 
    248256mBCfMap = cmap.GetColor(cid);
    249257mBCol = PI_ColorFromMap;
     
    385393PIGrCoord PIGraphicPS::CalcStringWidth(char const* s)
    386394{
    387 return((float)(mFSize*strlen(s)));   /* $CHECK$  Voir Nicolas ! */
     395return((float)(mFSize*strlen(s)*0.5));   /*  facteur 0.5 ad'hoc $CHECK$  Voir Nicolas ! */
    388396}
    389397
  • trunk/SophyaPI/PI/piimage.cc

    r128 r130  
    114114  gvw->SetUserData(NULL, 0);
    115115  }
    116 if (cmvw)  cmvw->SetColMap(NULL, true);
     116if (cmvw)  cmvw->SetColMap(NULL, 1., -1., true);
    117117if (lut) delete lut;
    118118delete mdrw;
     
    201201{
    202202cmvw = cw;
    203 if (cmvw && refr) cmvw->SetColMap(cmap, true);
     203if (cmvw && refr) cmvw->SetColMap(cmap, Lut()->Min(), Lut()->Max(), true);
    204204}
    205205
     
    352352if (zow)  zow->SetColMap(cmp, refr);
    353353if (gvw)  gvw->SetColMap(cmp, refr);
    354 if (cmvw) cmvw->SetColMap(cmp, refr);
     354if (cmvw) cmvw->SetColMap(cmap, Lut()->Min(), Lut()->Max(), refr);
    355355return;
    356356}
     
    365365if (zow)  zow->SetColMapId(cmapid, refr);
    366366if (gvw)  gvw->SetColMapId(cmapid, refr);
    367 if (cmvw) cmvw->SetColMapId(cmapid, refr);
     367if (cmvw) cmvw->SetColMapId(cmapid, Lut()->Min(), Lut()->Max(), refr);
    368368return;
    369369}
     
    392392if (gvw != NULL)
    393393  if ( (gvw->UserData() != this) || (mw) )  SetGloVPixmap();
    394 if (cmvw) cmvw->SetColMap(cmap, true);
     394if (cmvw) cmvw->SetColMap(cmap, Lut()->Min(), Lut()->Max(), true);
    395395 
    396396return;
     
    849849
    850850g->SelGOMode(PI_GOCopy);
    851 if ( (GetColMapId() == CMAP_GREY32) || (GetColMapId() == CMAP_GREYINV32) )  g->SelForeground(PI_Red);
     851if ( (GetColMapId() == CMAP_GREY32) || (GetColMapId() == CMAP_GREYINV32) ||
     852     (GetColMapId() == CMAP_GREY128) || (GetColMapId() == CMAP_GREYINV128) )  g->SelForeground(PI_Red);
    852853else  g->SelForeground(PI_White);
    853854
     
    855856else g->SelLine(PI_ThickLine);
    856857
    857 if ((xcurs>=0) && (ycurs>=0)) {
     858if ((xcurs>=0) && (ycurs>=0) && (g->kind() != PI_PSFileGraphics ) ) {
    858859  PIPixmap::Draw(g, xcurs-3, ycurs-CURSHSIZE, 6, CURSHSIZE*2);
    859860  PIPixmap::Draw(g, xcurs-CURSHSIZE, ycurs-3, CURSHSIZE*2, 6);
     
    893894  int a,d,h;
    894895  h = g->GetFontHeight(a, d);
    895   PIPixmap::Draw(g, 0, YSize()-10-h, XSize(), h+10);
     896  if (g->kind() != PI_PSFileGraphics )   PIPixmap::Draw(g, 0, YSize()-10-h, XSize(), h+10);
    896897  }
    897898return;
  • trunk/SophyaPI/PI/pipodrw.cc

    r128 r130  
     1//  Adaptateurs et Drawers divers pour Outils PEIDA++
     2//                             R. Ansari  06-08/98
     3// LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA
     4
    15#include "pipodrw.h"
    26#include "generalfit.h"
     
    8387}
    8488
     89// ----------------------------------------------------------
    8590// Adaptateur de vecteurs Peida++ a P1DArrayAdapter
     91// ----------------------------------------------------------
     92
    8693/* --Methode-- */
    8794POVectorAdapter::POVectorAdapter(Vector* v, bool ad)
     
    103110}
    104111
     112// ----------------------------------------------------------
    105113// Adaptateur d'Histo-2D Peida++ a P2DArrayAdapter
     114// ----------------------------------------------------------
     115
    106116/* --Methode-- */
    107117POH2DAdapter::POH2DAdapter(Histo2D* h2d, bool ad)
     
    123133return((*mH2d)(ix, iy));
    124134}
     135
     136// ----------------------------------------------------------
     137// Adaptateur de matrice Peida++ a P2DArrayAdapter
     138// Attention  Y: Lignes (rows)  X: Colonnes
     139// ----------------------------------------------------------
     140
     141/* --Methode-- */
     142POMatrixAdapter::POMatrixAdapter(Matrix* mtx, bool ad)
     143        : P2DArrayAdapter(mtx->NCol(), mtx->NRows())
     144{
     145aDel = ad; mMtx = mtx;
     146}
     147
     148/* --Methode-- */
     149POMatrixAdapter::~POMatrixAdapter()
     150{
     151if (aDel)  delete mMtx;
     152}
     153
     154/* --Methode-- */
     155float POMatrixAdapter::Value(int ix, int iy)
     156{
     157// Attention MatrixAdapter(X=Colonne, Y= Row) = Matrix(row, col) 
     158return((*mMtx)(iy, ix));
     159}
     160
     161
  • trunk/SophyaPI/PI/pipodrw.h

    r128 r130  
    1010#include "parradapter.h"
    1111#include "cvector.h"
     12#include "matrix.h"
    1213#include "histos2.h"
    1314
     
    6364};
    6465
     66// Adaptateur de matrice Peida++ a P2DArrayAdapter
     67// Attention MatrixAdapter(X=Colonne, Y= Row) = Matrix(row, col) 
     68class POMatrixAdapter :  public P2DArrayAdapter {
     69public :
     70                  POMatrixAdapter(Matrix* mtx, bool ad=false);
     71  virtual         ~POMatrixAdapter();
     72
     73  virtual float   Value(int ix, int iy);   
     74
     75protected:
     76  bool aDel;
     77  Matrix* mMtx;
     78};
     79
     80
    6581#endif
  • trunk/SophyaPI/PI/piscdrawwdg.cc

    r120 r130  
    241241
    242242
     243// ----------------------------------------------------------
    243244//  Classe de trace de points/fonctions Y=f(X)
     245//  Trace Y=ay->Value() = f(X= ax->Value()) si ax et ay != NULL
     246//  Trace Y=ax->Value() = f(X= ax->X())  si ay == NULL
     247// ----------------------------------------------------------
    244248
    245249/* --Methode-- */
     
    250254  mAx = ax;
    251255  mAy = ay;
    252   if ((mAx == NULL) || (mAy == NULL))  mSz = 0;
    253   else mSz = (mAx->Size() < mAy->Size()) ? mAx->Size() :  mAy->Size();
     256  if ((mAx == NULL))  mSz = 0;
     257  else {
     258    if (!mAy)  mSz = mAx->Size();
     259    else   mSz = (mAx->Size() < mAy->Size()) ? mAx->Size() :  mAy->Size();
     260    }
    254261}
    255262
     
    270277  ymin = ymax = mAy->Value(i);
    271278  float cv;
    272   for(i=0; i<mSz; i++) {
     279  if (mAy) for(i=0; i<mSz; i++) {
    273280    cv = mAx->Value(i);
    274281    if (cv < xmin)  xmin = cv;
     
    277284    if (cv < ymin)  ymin = cv;
    278285    if (cv > ymax)  ymax = cv;
    279   }
     286    }
     287  else  for(i=0; i<mSz; i++) {
     288    cv = mAx->X(i);
     289    if (cv < xmin)  xmin = cv;
     290    if (cv > xmax)  xmax = cv;
     291    cv = mAx->Value(i);
     292    if (cv < ymin)  ymin = cv;
     293    if (cv > ymax)  ymax = cv;
     294    }
     295
    280296  float dx, dy;
    281297  dx = 0.02*(xmax-xmin);
     
    298314  if ( (mMrk != PI_NotDefMarker) ||  (mLAtt == PI_NotDefLineAtt) ) {
    299315    for(i=0; i<mSz; i++) {
    300       xp = mAx->Value(i);
    301       yp = mAy->Value(i);
     316      if (mAy) { xp = mAx->Value(i); yp = mAy->Value(i); }
     317      else { xp = mAx->X(i);  yp = mAx->Value(i); }
    302318      if ( (xp < xmin) || (xp > xmax) || (yp < ymin) || (yp > ymax) )  continue;
    303319      g->DrawMarker(xp, yp);
     
    309325// Trace des lignes
    310326  float xp2, yp2;
    311   xp = mAx->Value(0);
    312   yp = mAy->Value(0);
     327  if (mAy) { xp = mAx->Value(0); yp = mAy->Value(0); }
     328  else { xp = mAx->X(0);  yp = mAx->Value(0); }
    313329  for(i=1; i<mSz; i++) {
    314     xp2 = mAx->Value(i);
    315     yp2 = mAy->Value(i);
     330    if (mAy) { xp2 = mAx->Value(i); yp2 = mAy->Value(i); }
     331    else { xp2 = mAx->X(i);  yp2 = mAx->Value(i); }
    316332    if ( ((xp < xmin) || (xp > xmax) || (yp < ymin) || (yp > ymax)) &&
    317333         ((xp2 < xmin) || (xp2 > xmax) || (yp2 < ymin) || (yp2 > ymax)) )  continue;
  • trunk/SophyaPI/PI/piscdrawwdg.h

    r127 r130  
    1 // Module PI : Peida Interactive     PIScDrawWdg
     1// This may look like C code, but it is really -*- C++ -*-
     2// Module PI : Peida Interactive  PIScDrawWdg PIYfXDrawer
    23// Gestionnaire Drawer-2D  E.Aubourg, R. Ansari  96-98
    34// LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA
     
    8182
    8283
     84// ----------------------------------------------------------
    8385// Classe de traceur de points/fonction Y=F(x)
    84 
     86// Trace Y=ay->Value() = f(X= ax->Value()) si ax et ay != NULL
     87// Trace Y=ax->Value() = f(X= ax->X())  si ay == NULL
     88 
    8589class P1DArrayAdapter;
    8690class PIYfXDrawer : public PIDrawer {
  • trunk/SophyaPI/PI/psfile.cc

    r98 r130  
    2929  PI_Landscape, PI_Portrait,\
    3030  \
    31   PI_Black, PI_White, PI_Grey, PI_Red, PI_Blue,\
     31  PI_ColorFromMap, PI_Black, PI_White, PI_Grey, PI_Red, PI_Blue,\
    3232  PI_Green, PI_Yellow, PI_Magenta, PI_NotDefColor,\
    3333  \
     
    4141$PIDict begin $PIDict /mtrx matrix put /Landscape %d def /Portrait %d def\n\
    4242%% Couleurs et fontes courantes\n\
     43/C%-2d  {ur    ug    ub    setrgbcolor} bind def %% PI_ColorFromMap\n\
    4344/C%-2d  {0.0   0.0   0.0   setrgbcolor} bind def %% PI_Black\n\
    4445/C%-2d  {0.996 0.996 0.996 setrgbcolor} bind def %% PI_White\n\
     
    5051/C%-2d  {0.996 0.0   0.996 setrgbcolor} bind def %% PI_Magenta\n\
    5152/C%-2d  {}                              bind def %% PI_NotDefColor\n\
    52 /F%-2d  {/Times-Roman   findfont} bind def       %% PI_RomanFont\n\
    53 /F%-2d  {/Times-Bold    findfont} bind def       %% PI_BoldFont\n\
    54 /F%-2d  {/Times-Italic  findfont} bind def       %% PI_ItalicFont\n\
     53/F%-2d  {/Courier   findfont} bind def       %% PI_RomanFont\n\
     54/F%-2d  {/Courier-Bold    findfont} bind def       %% PI_BoldFont\n\
     55/F%-2d  {/Courier-Italic  findfont} bind def       %% PI_ItalicFont\n\
    5556/F%-2d  {}\
    5657                        bind def       %% PI_NotDefFontAtt\n\
     
    616617}
    617618
     619void PSFile::SelForeground(PIColorMap& cmap, int cid)
     620{
     621  mDrawColor = PI_ColorFromMap ;
     622  PIColor tmp = cmap.GetColor(cid) ;
     623  fprintf(mPSFile, "/ur %.3f def /ug %.3f def /ub %.3f def \n",
     624          (float)(tmp.red)/65535.,
     625          (float)(tmp.green)/65535.,
     626          (float)(tmp.blue)/65535.) ;
     627}
     628
     629
     630void PSFile::SelBackground(PIColorMap& cmap, int cid)
     631{
     632  mDrawColor = PI_ColorFromMap ;
     633}
     634
    618635
    619636void  PSFile::DrawString  (float x,  float y, char *s,
     
    646663                   PILineAtt LineAtt) {
    647664
     665  int lw = 0 ;
     666
     667  switch(LineAtt) {
     668    case PI_NotDefLineAtt:
     669      break ;
     670    case PI_NormalLine:
     671      lw = 2. ;
     672      break ;
     673    case PI_ThinLine:
     674      lw = 1 ;
     675      break ;
     676    case PI_ThickLine:
     677      lw = 4 ;
     678      break ;
     679  }
     680
    648681    /* Line Att */
    649682    if ( (LineAtt != PI_NotDefLineAtt) || (LineAtt != mLineAtt) ) {
    650683        mLineAtt = LineAtt;
    651         fprintf(mPSFile, "%d slw ", mLineAtt) ;
     684        fprintf(mPSFile, "%d slw ", lw) ;
    652685    }
    653686
     
    767800
    768801
     802// Les coordonnees sont supposees etre en mode incremental .
    769803void  PSFile::DrawPolygon (float *x, float *y, int n,
    770804                   PIColors DrawColor,
    771                    PILineAtt LineAtt) {
     805                   PILineAtt LineAtt, bool cinc) {
    772806
    773807    /* Line Att */
     
    785819    /* On dessine ; ici*/
    786820    fprintf(mPSFile, "%.2f Ux %.2f Uy m\n", x[0], y[0]);
    787     for(int i = 0; i<n; i++)
    788         fprintf(mPSFile, "%.2f Ux %.2f Uy %.2f Ux %.2f Uy l\n",
    789                 x[i+1], y[i+1], x[i], y[i]);
     821
     822    char* cmd ;
     823    if(cinc == true) cmd = "%.2f Ux %.2f Uy rl\n" ;
     824    else             cmd = "%.2f Ux %.2f Uy l\n" ;
     825
     826    for(int i = 1; i<n; i++)
     827      fprintf(mPSFile, cmd, x[i], y[i]);
    790828    fprintf(mPSFile, "c s\n");
    791829}
     
    795833                   PIColors DrawColor,
    796834                   PIColors FillColor,
    797                    PILineAtt LineAtt) {
     835                   PILineAtt LineAtt, bool cinc) {
    798836
    799837    /* Line Att */
     
    802840        fprintf(mPSFile, "%d slw ", mLineAtt) ;
    803841    }
     842
     843    char* cmd ;
     844    if(cinc == true) cmd = "%.2f Ux %.2f Uy rl\n" ;
     845    else             cmd = "%.2f Ux %.2f Uy l\n" ;
    804846
    805847    /* Dessin du fond... */
     
    809851    fprintf(mPSFile, "%.2f Ux %.2f Uy m\n", x[0], y[0]);
    810852    int i;
    811     for(i = 0; i<n; i++)
    812         fprintf(mPSFile, "%.2f Ux %.2f Uy %.2f Ux %.2f Uy l\n",
    813                 x[i+1], y[i+1], x[i], y[i]);
     853    for(i = 1; i<n; i++)
     854        fprintf(mPSFile, cmd, x[i], y[i]);
    814855    fprintf(mPSFile, "c f\n");
    815856
     
    819860    fprintf(mPSFile, "C%d ", mDrawColor) ;
    820861    fprintf(mPSFile, "%.2f Ux %.2f Uy m\n", x[0], y[0]);
    821     for(i = 0; i<n; i++)
    822         fprintf(mPSFile, "%.2f Ux %.2f Uy %.2f Ux %.2f Uy l\n",
    823                 x[i+1], y[i+1], x[i], y[i]);
     862    for(i = 1; i<n; i++)
     863      fprintf(mPSFile, cmd, x[i], y[i]);
    824864    fprintf(mPSFile, "c s\n");
    825865}
     
    899939    }
    900940    /* Emplacement de l'image */
    901     fprintf(mPSFile, "gs %.2f  %.2f tr %.2f Ux %.2f Uy sc\n", x0, y0, Tx, Ty);
     941    fprintf(mPSFile, "gs %.2f Ux %.2f Uy tr %.2f Ux %.2f Uy sc\n", x0, y0, Tx, Ty);
    902942    /* Nbr pix-X, Nbr pix-Y bits/pixels */
    903943    fprintf(mPSFile, "%d %d 8\n", Nx, Ny);
  • trunk/SophyaPI/PI/psfile.h

    r71 r130  
    9999    virtual void  EndBloc();
    100100
     101    virtual void SelForeground(PIColorMap& cmap, int cid) ;
     102    virtual void SelBackground(PIColorMap& cmap, int cid) ;
     103
    101104    /* Trace */
    102105    virtual void  DrawString  (float x,  float y, char *s,
     
    123126    virtual void  DrawPolygon (float *x, float *y, int n,
    124127                               PIColors DrawColor  = PI_NotDefColor,
    125                                PILineAtt LineAtt   = PI_NotDefLineAtt);
     128                               PILineAtt LineAtt   = PI_NotDefLineAtt,
     129                               bool cinc = true);
    126130    virtual void  DrawFPolygon(float *x, float *y, int n,
    127131                               PIColors DrawColor  = PI_NotDefColor,
    128132                               PIColors FillColor  = PI_NotDefColor,
    129                                PILineAtt LineAtt   = PI_NotDefLineAtt);
     133                               PILineAtt LineAtt   = PI_NotDefLineAtt,
     134                               bool cinc = true);
    130135    virtual void  DrawMarker  (float x0, float y0,
    131136                               PIMarker MrkType    = PI_NotDefMarker,
Note: See TracChangeset for help on using the changeset viewer.