Changeset 2164 in Sophya for trunk/SophyaPI


Ignore:
Timestamp:
Aug 7, 2002, 4:59:52 PM (23 years ago)
Author:
ansari
Message:
  • Creation d'une classe gestionnaire de trace d'elements a etre utilise

ds la classe PIElDrawer (Traceur d'elements, d'axes 2D et titres, etc ...)

  • Ajout d'une nouvelle classe PIElDrawer3D , remplissant les memes

fonctions pour les objets 3D

  • Ajout de trace de label d'axes ds PIAxes
  • Ajout methode Set3DBox ds PIDrawer3D - Preparation en vue du

transfert du trace de boite/axes 3D a l'objet PIElDrawer3D

Reza 7/8/2002

Location:
trunk/SophyaPI/PI
Files:
11 edited

Legend:

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

    r2138 r2164  
    4646//                double& teta, double& phi, double& psi, double& dax, double& day, double& co, double& dco)
    4747//      Renvoie la définition de la Vue-3D. Retourne "true " si définie par "Set3DView_Obs()"
     48// void Set3DBox(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
     49//      Définition de la boite 3D.
     50//
    4851// void Draw3DBoxe(PIGraphic3D* g3, double xx1, double xx2, double yy1, double yy2,  -
    4952//                 double zz1, double zz2, double xl1, double xl2, -
     
    6265  lCO = 10.;  dlCO = 3.; 
    6366  v3D_obs = false;
    64   x3Min = y3Min = z3Min = -1.; 
    65   x3Max = y3Max = z3Max = 1.;
     67  Set3DBox(-1., 1., -1., 1., -1., 1.);
    6668}
    6769
     
    103105  co = lCO;     dco = dlCO;
    104106  return(v3D_obs);
     107}
     108/* --Methode-- */
     109void PIDrawer3D::Set3DBox(double xmin, double xmax, double ymin, double ymax,
     110                          double zmin, double zmax)
     111{
     112  x3Min = xmin;  x3Max = xmax;
     113  y3Min = ymin;  y3Max = ymax;
     114  z3Min = zmin;  z3Max = zmax;
    105115}
    106116
     
    221231}
    222232
     233/*  --------------------------------------------------------------  */
     234/*  ------------------- Classe PIElDrawer3D ------------------------  */
     235/*  --------------------------------------------------------------  */
     236
     237//++
     238// Class        PIElDrawer3D
     239// Lib          PI
     240// include      p3ddrw.h
     241//
     242//      Classe de traceur ("Drawer") capable de gérer et de
     243//      tracer une liste d'éléments simples. Cette classe
     244//      est utilisé pour le tracé des axes et des éléments de
     245//      texte ds les "PIScDrawWdg", "PIDraw3DWdg" et "PIImage".
     246//--
     247//++
     248// Links        Parents
     249// PIDrawer3D
     250//--
     251//++
     252// Links        Voir aussi
     253// PIElDrawer
     254// PIElDrwMgr
     255//--
     256
     257//++
     258// Titre        Constructeurs et méthodes
     259//--
     260
     261//++
     262// PIElDrawer3D()
     263//      Constructeur
     264//--
     265
     266/* --Methode-- */
     267PIElDrawer3D::PIElDrawer3D()
     268{
     269  ShowTitles();
     270}
     271
     272/* --Methode-- */
     273PIElDrawer3D::~PIElDrawer3D()
     274{
     275}
     276
     277
     278//++
     279//  void  SetTitles(string tt, string tb)
     280//  void  SetTitles(string tt, string tb, PIGraphicAtt const& att)
     281//      Ajout de titres haut ("tt") et bas ("tb")
     282//--
     283
     284
     285/* --Methode-- */
     286int PIElDrawer3D::DecodeOptionString(vector<string> & opt, bool rmdecopt)
     287{
     288  int nopt0 = opt.size();
     289  if (nopt0 < 1)  return(0); 
     290  int ndec1 = PIDrawer::DecodeOptionString(opt, rmdecopt);
     291  if ((nopt0 - ndec1) < 1) return(ndec1);  // si tout a ete decode
     292  vector<string> udopt;
     293  unsigned int k = 0;
     294  int ndec = opt.size();
     295  for( k=0; k<opt.size(); k++ ) {
     296    string opts = opt[k];
     297    if (opts == "title") ShowTitles(true);
     298    else if (opts == "notitle") ShowTitles(false);
     299
     300    else {
     301      ndec--;
     302      if (rmdecopt)  udopt.push_back(opts);
     303    }
     304  } 
     305
     306  if (rmdecopt)  opt = udopt;
     307  return(ndec+ndec1);
     308}
     309
     310
     311/* --Methode-- */
     312void  PIElDrawer3D::Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax)
     313{
     314SelGraAtt(g);   // DrawAxes change certains attributs graphiques
     315DrawAxes(g);   // Trace des axes
     316g->SelFont(PI_NormalSizeFont);
     317SelGraAtt(g);   // DrawAxes change certains attributs graphiques
     318
     319// Trace des titres
     320if ( showTitles && ((titleT.length() > 0) || (titleB.length() > 0)) ) {
     321  PIGraphicAtt grs = GetGraphicAtt();
     322  UpdateGraphicAtt(titleAtt);
     323  SelGraAtt(g);
     324
     325  aXdir = false;  // Vrai si Axe X de Droite vers Gauche
     326  aYdir = false;  // Vrai si Axe Y de Haut vers Bas
     327  double fx, fy, fh;
     328//  fh = g->GetFontHeightUC(gas, gds);
     329  fh = 0.075*(YMax()-YMin());
     330  if ( titleT.length() > 0) {
     331      if (g->isAxeYDirUpDown()) fy = g->DeltaUCY(YMin(), -fh);
     332      else fy = g->DeltaUCY(YMax(), fh);
     333      g->DrawString((XMax()+XMin())*0.5, fy, titleT.c_str(), PI_HorizontalCenter | PI_VerticalBottom);
     334//      printf(" PIElDrawer3D::Draw()/DBG (%g , %g) %s  - %g \n", fx, fy, titleT.c_str(), fh);
     335    }
     336  if ( titleB.length() > 0) {
     337      fx = g->CalcStringWidth(titleB.c_str());
     338      if(aXdir) fx = g->DeltaUCX(XMax(), -(XMax()-XMin()-fx)/2.);
     339      else fx = g->DeltaUCX(XMin(), (XMax()-XMin()-fx)/2.);
     340      if (g->isAxeYDirUpDown()) fy =  g->DeltaUCY(YMax(), fh*1.5);
     341      else fy = g->DeltaUCY(YMin(), -fh*1.5);
     342      g->DrawString((XMax()+XMin())*0.5, fy, titleB.c_str(), PI_HorizontalCenter | PI_VerticalBottom);
     343//      printf(" PIElDrawer3D::Draw()/DBG (%g , %g) %s  - %g \n", fx, fy, titleT.c_str(), fh);
     344    }
     345  SetGraphicAtt(grs);
     346  }
     347
     348 SelGraAtt(g);
     349// Trace des elements
     350 ElDrwMgr().DrawElements(g, xmin, ymin, xmax, ymax);
     351
     352}
     353
  • trunk/SophyaPI/PI/pi3ddrw.h

    r2138 r2164  
    2828  bool                  Get3DView(double& xc, double& yc, double& zc, double& xo, double& yo, double& zo,
    2929                                  double& teta, double& phi, double& psi, double& dax, double& day, double& co, double& dco);
     30
     31  virtual void          Set3DBox(double xmin, double xmax, double ymin, double ymax,
     32                                 double zmin, double zmax);
    3033 
    3134  virtual PIGraphicUC*  SetDrwWdg(PIBaseWdgGen* drw, int x0, int y0, int dx, int dy, PIGraphicGen* g);
     
    5659
    5760
     61// -----------------  Traceur d'elements 3D  -------------------
     62class PIElDrawer3D : public PIDrawer3D
     63{
     64public:
     65                     PIElDrawer3D();
     66  virtual           ~PIElDrawer3D();
     67
     68//   Methode de decodage des options
     69  virtual int        DecodeOptionString(vector<string> & opt, bool rmdecopt=true);
     70
     71  virtual void       Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax);
     72
     73  inline PIElDrwMgr& ElDrwMgr()    { return eltsMgr; }
     74
     75  inline void        SetTitles(string tt, string tb)   { titleT = tt;  titleB = tb; }
     76  inline void        SetTitles(string tt, string tb, PIGraphicAtt const& att)
     77                        { titleT = tt;  titleB = tb; titleAtt = att; }
     78  inline void        ShowTitles(bool fg=true) { showTitles = fg; }
     79
     80// -- Pour compatibilite avec l'interface precedente , Reza 08/2002
     81  inline void        ElDel(int id) { eltsMgr.ElDel(id); }
     82  inline void        ElDelAll()    { eltsMgr.ElDelAll(); }
     83 
     84  inline int         ElAddText(PIGrCoord x, PIGrCoord y, const char* s)
     85                                   { return eltsMgr.ElAddText(x, y, s); }
     86
     87protected:
     88  PIElDrwMgr eltsMgr;
     89  string titleT, titleB;       // Titre Haut - Bas
     90  PIGraphicAtt titleAtt;       // Attributs graphiques de trace de titre
     91  bool showTitles;             // Affichage des titres si true
     92
     93};
     94
    5895
    5996#endif
  • trunk/SophyaPI/PI/pi3dwdg.cc

    r2138 r2164  
    7171//  SetDefaultDrawRectangle(0.12, 0.12, 0.88, 0.88, true);
    7272  SetDefaultDrawRectangle(0., 0., 1., 1., true);
    73   mBDrw = new PIElDrawer;
     73  mBDrw = new PIElDrawer3D;
    7474  mBDrw->SetLimits(0.12,0.88, 0.12,0.88, kAxeDirLtoR,kAxeDirDownUp);
    7575  AddDrawer(mBDrw, 0.12, 0.12, 0.88, 0.88, true, false, false);
  • trunk/SophyaPI/PI/pi3dwdg.h

    r2138 r2164  
    4040  inline void           SetTitles(string const & tt, string const & tb)
    4141                                  { mBDrw->SetTitles(tt, tb); }
    42   inline PIElDrawer  BaseDrawer() { return mBDrw; };
     42  inline PIElDrawer3D*  BaseDrawer() { return mBDrw; };
    4343
    4444//   Methode permettant de decoder des options a partir de chaines
     
    7070  virtual void          DrawXYZAxes();
    7171
    72   PIElDrawer* mBDrw;   // Objet traceur d'elements de fond
     72  PIElDrawer3D* mBDrw;   // Objet traceur d'elements de fond
    7373  int mPx, mPy;        // Position pointeur - Bouton-1
    7474 
  • trunk/SophyaPI/PI/piaxes.cc

    r2138 r2164  
    3939PIAxes::PIAxes()
    4040{
     41  setupDone = false;
    4142}
    4243
     
    5758//|     kGridOn, kAxesNone
    5859//      Si "afsz == true", la taille de fonte est choisie automatiquement.
     60//
    5961// void DrawXYAxes(PIGraphicUC* g, PIGraphicAtt& gratt, unsigned int flags, bool afsz, \
    6062//      double xmin, double xmax, double ymin, double ymax)
    6163//      Tracé d'axes avec spécification des limites d'axes.
     64//
     65// void DrawXCaption(PIGraphicUC* g, string const& xLabel, PIGraphicAtt const& att)
     66//      Tracé du label d'axe X.
     67// void DrawYCaption(PIGraphicUC* g, string const& YLabel, PIGraphicAtt const& att)
     68//      Tracé du label d'axe Y.
    6269//--
    6370
     
    195202
    196203/* --Methode-- */
     204void PIAxes::DrawXCaption(PIGraphicUC* g, PIGraphicAtt& att, unsigned int flags, string const& xLabel)
     205{
     206  if (xLabel.length() < 1) return;
     207  if (!setupDone) {
     208    PIGrCoord xmin, xmax, ymin, ymax;
     209    g->GetGrSpace(xmin, xmax, ymin, ymax);
     210    Setup(g, xmin, xmax, ymin, ymax);
     211  }
     212  if ( (att.GetFontName() != PI_DefaultFont) ||
     213       (att.GetFontAtt() != PI_NotDefFontAtt) )
     214    g->SelFont(att.GetFont());
     215  PIColors fcol = att.GetFgColor();
     216  if (fcol != PI_NotDefColor)    g->SelForeground(fcol);
     217
     218  double fy, fh;
     219  fh = 0.090*(yMax-yMin); 
     220  if (flags&kBoxAxes) {
     221    if (g->isAxeYDirUpDown()) fy = yMax;
     222    else fy = yMin;
     223  }
     224
     225  else fy = 0.5*(yMin+yMax);
     226  if (g->isAxeYDirUpDown()) fy += fh;
     227  else fy -= fh;
     228  g->DrawString(xMax-(xMax-xMin)*0.30, fy, xLabel.c_str(),
     229                PI_HorizontalCenter | PI_VerticalCenter); 
     230}
     231
     232/* --Methode-- */
     233void PIAxes::DrawYCaption(PIGraphicUC* g, PIGraphicAtt& att, unsigned int flags, string const& yLabel)
     234{
     235  if (yLabel.length() < 1) return;
     236  if (!setupDone) {
     237    PIGrCoord xmin, xmax, ymin, ymax;
     238    g->GetGrSpace(xmin, xmax, ymin, ymax);
     239    Setup(g, xmin, xmax, ymin, ymax);
     240  }
     241  if ( (att.GetFontName() != PI_DefaultFont) ||
     242       (att.GetFontAtt() != PI_NotDefFontAtt) )
     243    g->SelFont(att.GetFont());
     244  PIColors fcol = att.GetFgColor();
     245  if (fcol != PI_NotDefColor)    g->SelForeground(fcol);
     246
     247  double fx, fh;
     248  fh = 0.125*(xMax-xMin);
     249  if (yLabel.length() > 0) {
     250    if (flags&kBoxAxes) {
     251      if (g->isAxeXDirRtoL()) fx = xMax;
     252      else fx = xMin;
     253    }
     254    else fx = 0.5*(xMin+xMax);
     255    if (g->isAxeXDirRtoL()) fx += fh;
     256    else fx -= fh;
     257    unsigned long txtflg = PI_HorizontalCenter | PI_VerticalCenter | PI_TextDirectionVerticalUp;
     258    if (g->isAxeYDirUpDown())
     259      txtflg = PI_HorizontalCenter | PI_VerticalCenter | PI_TextDirectionVerticalDown;
     260    g->DrawString(fx, yMax-(yMax-yMin)*0.30, yLabel.c_str(), txtflg);
     261  }
     262}
     263
     264/* --Methode-- */
    197265void PIAxes::Setup(PIGraphicUC* g, double xmin, double xmax,
    198266                       double ymin, double ymax)
     
    219287  xMajTickLen = (yMax-yMin)/100;
    220288  xMinTickLen = (yMax-yMin)/250;
     289
     290  setupDone = true;
    221291}
    222292
  • trunk/SophyaPI/PI/piaxes.h

    r2115 r2164  
    4040                               double ymin, double ymax);
    4141
     42
     43  virtual void      DrawXCaption(PIGraphicUC* g, PIGraphicAtt& att, unsigned int flags,
     44                                 string const& xLabel);
     45  virtual void      DrawYCaption(PIGraphicUC* g, PIGraphicAtt& att, unsigned int flags,
     46                                 string const& YLabel);
     47
    4248  //  virtual void      DrawHorizontalAxe(double xmin, double xmax, double y,
    4349
     
    6672  void DrawGrid(PIGraphicUC* g);
    6773
     74
     75  bool   setupDone;  // Si Setup a ete appele
     76
    6877  double xMin, xMax, yMin, yMax;
    6978  bool   aXdir, aYdir;           // Sens des axes horiz, vertical
     
    7786  double xMajTickLen,  xMinTickLen;
    7887  double yMajTickLen,  yMinTickLen;
     88
    7989};
    8090
  • trunk/SophyaPI/PI/pidrawer.cc

    r2080 r2164  
    252252  if (GetGraphicAtt().GetMarker() != PI_NotDefMarker)
    253253    g->SelMarker(GetGraphicAtt().GetMarkerSize(), GetGraphicAtt().GetMarker());
     254  if (GetGraphicAtt().GetArrowMarker() !=  PI_NotDefArrowMarker)
     255    g->SelArrowMarker(GetGraphicAtt().GetArrowMarkerSize(),
     256                      GetGraphicAtt().GetArrowMarker());
    254257}
    255258
  • trunk/SophyaPI/PI/pieldrw.cc

    r2119 r2164  
    1010
    1111#include <math.h>
     12
     13/*  --------------------------------------------------------------  */
     14/*  ------------------- Classe PIElDrwMgr ------------------------  */
     15/*  --------------------------------------------------------------  */
     16
     17//++
     18// Class        PIElDrwMgr
     19// Lib          PI
     20// include      pieldrw.h
     21//
     22//      Classe gestionnaire de tracé d'éléments. Utilisé par "PIElDrawer".
     23//--
     24//++
     25// Links        Voir aussi
     26// PIElDrawer
     27//--
     28//++
     29// Titre        Constructeurs et méthodes
     30//--
     31
     32/* --Methode-- */
     33//++
     34PIElDrwMgr::PIElDrwMgr()
     35//      Constructeur
     36//--
     37{
     38  mEn = 0;
     39}
     40
     41/* --Methode-- */
     42//++
     43PIElDrwMgr::~PIElDrwMgr()
     44//      destructeur
     45//--
     46{
     47  ElDelAll();
     48}
     49/* --Methode-- */
     50//++
     51void PIElDrwMgr::DrawElements(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax)
     52//      Tracé des éléments
     53//--
     54{
     55  DrwElList::iterator it;
     56  g->SaveGraphicAtt();
     57  for (it = mElist.begin(); it != mElist.end(); it++)
     58    {
     59      PIColors fcol = (*it).gatt.GetFgColor();
     60      if (fcol != PI_NotDefColor)    g->SelForeground(fcol);
     61      PIColors bcol = (*it).gatt.GetBgColor();
     62      if (bcol != PI_NotDefColor)    g->SelBackground(bcol);
     63      if ((*it).gatt.GetLineAtt() != PI_NotDefLineAtt) 
     64        g->SelLine((*it).gatt.GetLineAtt());
     65      if ( ((*it).gatt.GetFontName() != PI_DefaultFont) ||
     66           ((*it).gatt.GetFontAtt() != PI_NotDefFontAtt) )
     67        g->SelFont((*it).gatt.GetFont());
     68      if ((*it).gatt.GetMarker() != PI_NotDefMarker)
     69        g->SelMarker((*it).gatt.GetMarkerSize(), (*it).gatt.GetMarker());
     70      if ((*it).gatt.GetArrowMarker() !=  PI_NotDefArrowMarker)
     71        g->SelArrowMarker((*it).gatt.GetArrowMarkerSize(),
     72                          (*it).gatt.GetArrowMarker());
     73
     74      switch ( (*it).etyp )
     75        {
     76        case PIDEL_Line :
     77          g->DrawLine((*it).ex, (*it).ey, (*it).edx, (*it).edy );
     78          break;
     79        case PIDEL_Mark :
     80          g->DrawMarker((*it).ex, (*it).ey);
     81          break;
     82        case PIDEL_Arrow :
     83          g->DrawArrowMarker((*it).ex, (*it).ey, (*it).edx, (*it).edy, true);
     84          break;
     85        case PIDEL_Text :
     86          g->DrawString((*it).ex, (*it).ey, (char*) ((*it).es.c_str()) );
     87          break;
     88        case PIDEL_Rect :
     89          g->DrawBox((*it).ex, (*it).ey, (*it).edx, (*it).edy );
     90          break;
     91        case PIDEL_FRect :
     92          g->DrawFBox((*it).ex, (*it).ey, (*it).edx, (*it).edy );
     93          break;
     94        case PIDEL_Circ :
     95          g->DrawCircle((*it).ex, (*it).ey, (*it).edx );
     96          break;
     97        case PIDEL_FCirc :
     98          g->DrawFCircle((*it).ex, (*it).ey, (*it).edx );
     99          break;
     100        case PIDEL_Poly :
     101          g->DrawPolygon((*it).xpol, (*it).ypol, (*it).npol, false );
     102          break;
     103        case PIDEL_FPoly :
     104          g->DrawFPolygon((*it).xpol, (*it).ypol, (*it).npol, false );
     105          break;
     106        default :
     107          break;
     108        }
     109      g->RestoreGraphicAtt();
     110    }
     111}
     112
     113//++
     114// int  ElAddText(PIGrCoord x, PIGrCoord y, const char* s)
     115// int  ElAddText(PIGrCoord x, PIGrCoord y, const char* s, PIGraphicAtt gatt)
     116// int  ElAddText(PIGrCoord x, PIGrCoord y, string const & s)
     117// int  ElAddText(PIGrCoord x, PIGrCoord y, string const &  s, PIGraphicAtt gatt)
     118//      Ajout d'un élément texte (possibilité de spécification d'un attribut graphique).
     119//      Renvoie le numéro identificateur de l'élément.
     120//
     121// int  ElAddLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2)
     122// int  ElAddLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2, PIGraphicAtt gatt)
     123//      Ajout d'un élément de ligne (possibilité de spécification d'un attribut graphique).
     124//      Renvoie le numéro identificateur de l'élément.
     125//     
     126// int  ElAddRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy)
     127// int  ElAddRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy, PIGraphicAtt gatt)
     128//      Ajout d'un élément de type rectangle (possibilité de spécification d'un attribut graphique).
     129//      Renvoie le numéro identificateur de l'élément.
     130//
     131// int  ElAddFRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy)
     132// int  ElAddFRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy,  PIGraphicAtt gatt)
     133//      Ajout d'un élément de type rectangle plein
     134//      (possibilité de spécification d'un attribut graphique).
     135//      Renvoie le numéro identificateur de l'élément.
     136//
     137// int  ElAddCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r)
     138// int  ElAddCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r, PIGraphicAtt gatt)
     139//      Ajout d'un élément de type cercle (possibilité de spécification d'un attribut graphique).
     140//      Renvoie le numéro identificateur de l'élément.
     141//
     142// int  ElAddFCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r)
     143// int  ElAddFCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r, PIGraphicAtt gatt)
     144//      Ajout d'un élément de type cercle plein avec un attribut de couleur.
     145//      Renvoie le numéro identificateur de l'élément.
     146//
     147// int  ElAddPoly(vector<PIGrCoord>& x, vector<PIGrCoord>& y)
     148// int  ElAddPoly(vector<PIGrCoord>& x, vector<PIGrCoord>& y, PIGraphicAtt gatt)
     149//      Ajout d'un élément de type polygone (possibilité de spécification d'un attribut graphique).
     150//      Renvoie le numéro identificateur de l'élément.
     151//
     152// int  ElAddFPoly(vector<PIGrCoord>& x, vector<PIGrCoord>& y)
     153// int  ElAddFPoly(vector<PIGrCoord>& x, vector<PIGrCoord>& y, PIGraphicAtt gatt)
     154//      Ajout d'un élément de type polygone plein
     155//      (possibilité de spécification d'un attribut graphique).
     156//      Renvoie le numéro identificateur de l'élément.
     157//
     158// void  ElDel(int id)
     159//      Suppression de l'élément avec l'identificateur "id".
     160// void  ElDelAll()
     161//      Suppression de tous les éléments de l'objet.
     162//--
     163
     164/* --Methode-- */
     165int PIElDrwMgr::ElAdd(int typ, PIGrCoord x, PIGrCoord  y, PIGrCoord dx, PIGrCoord dy,
     166                      const char* s, PIGraphicAtt const& att)
     167{
     168  DrwEl dre;
     169  mEn++;
     170  dre.eid = mEn;  dre.etyp = typ;
     171  dre.ex = x;   dre.ey = y;
     172  dre.edx = dx;  dre.edy = dy;
     173  dre.gatt = att;
     174  if (s)  dre.es = s;
     175  dre.xpol = dre.ypol = NULL;
     176  dre.npol = 0;
     177  mElist.push_back(dre);
     178  return(mEn);
     179}
     180
     181/* --Methode-- */
     182int PIElDrwMgr::ElAdd(int typ, vector<PIGrCoord>& x, vector<PIGrCoord>& y, PIGraphicAtt const& att)
     183{
     184  DrwEl dre;
     185  mEn++;
     186  dre.eid = mEn;  dre.etyp = typ;
     187  dre.ex = dre.ey = 0;
     188  dre.edx = dre.edy = 0;
     189  dre.gatt = att;
     190  dre.xpol = dre.ypol = NULL;
     191  dre.npol = (y.size() < x.size()) ? y.size() : x.size();
     192  if (dre.npol > 0) {
     193    dre.xpol = new PIGrCoord[dre.npol];
     194    dre.ypol = new PIGrCoord[dre.npol];
     195    for(int kk=0; kk<dre.npol; kk++) {
     196      dre.xpol[kk] = x[kk];
     197      dre.ypol[kk] = y[kk];
     198    }
     199  }
     200  mElist.push_back(dre);
     201  return(mEn);
     202}
     203
     204/* --Methode-- */
     205void  PIElDrwMgr::ElDel(int id)
     206{
     207  DrwElList::iterator it;
     208  for (it = mElist.begin(); it != mElist.end(); it++) {
     209    if ( (*it).eid == id) {
     210      if ( (*it).xpol ) delete[] (*it).xpol;
     211      if ( (*it).ypol ) delete[] (*it).ypol;
     212      mElist.erase(it);   
     213      break;
     214    }
     215  }
     216  return;
     217}
     218
     219/* --Methode-- */
     220void  PIElDrwMgr::ElDelAll()
     221{
     222  DrwElList::iterator it;
     223  for (it = mElist.begin(); it != mElist.end(); it++) {
     224    if ( (*it).xpol ) delete[] (*it).xpol;
     225    if ( (*it).ypol ) delete[] (*it).ypol;
     226  }
     227  mElist.erase(mElist.begin(), mElist.end());
     228  return;
     229}
     230
     231
    12232
    13233
     
    30250// PIDrawer
    31251//--
     252//++
     253// Links        Voir aussi
     254// PIElDrwMgr
     255//--
    32256
    33257//++
     
    43267PIElDrawer::PIElDrawer()
    44268{
    45 mEn = 0;
    46 titleT = titleB = "";
    47269ShowTitles();
     270 ShowAxesLabels();
    48271}
    49272
     
    55278
    56279//++
    57 //  void  SetTitles(const char* tt=NULL, const char* tb=NULL)
     280//  void  SetTitles(string tt, string tb)
    58281//      Ajout de titres haut ("tt") et bas ("tb")
    59 //  void  SetTitles(string const & tt, string const & tb)
    60 //      Ajout de titres haut ("tt") et bas ("tb")
    61 //--
    62 
    63 /* --Methode-- */
    64 void PIElDrawer::SetTitles(const char* tt, const char* tb)
    65 {
    66 if (tt != NULL)  titleT = tt;
    67 if (tb != NULL)  titleB = tb;
    68 }
    69 
    70 /* --Methode-- */
    71 void PIElDrawer::SetTitles(string const & tt, string const & tb)
    72 {
    73 titleT = tt;  titleB = tb;
    74 }
     282//--
     283
    75284
    76285/* --Methode-- */
     
    119328}
    120329
    121 //++
    122 // int  ElAddText(PIGrCoord x, PIGrCoord y, const char* s, PIColors c=PI_NotDefColor)
    123 //      Ajout d'un élément texte avec un attribut de couleur.
    124 //      Renvoie le numéro identificateur de l'élément.
    125 // int  ElAddLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2, -
    126 //                 PIColors c=PI_NotDefColor)
    127 //      Ajout d'un élément de ligne avec un attribut de couleur.
    128 //      Renvoie le numéro identificateur de l'élément.
    129 // int  ElAddRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy, -
    130 //                PIColors c=PI_NotDefColor)
    131 //      Ajout d'un élément de type rectangle avec un attribut de couleur.
    132 //      Renvoie le numéro identificateur de l'élément.
    133 // int  ElAddFRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy, -
    134 //                PIColors c=PI_NotDefColor)
    135 //      Ajout d'un élément de type rectangle plein avec un attribut de couleur.
    136 //      Renvoie le numéro identificateur de l'élément.
    137 // int  ElAddCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r, PIColors c=PI_NotDefColor)
    138 //      Ajout d'un élément de type cercle avec un attribut de couleur.
    139 //      Renvoie le numéro identificateur de l'élément.
    140 // int  ElAddFCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r, PIColors c=PI_NotDefColor)
    141 //      Ajout d'un élément de type cercle plein avec un attribut de couleur.
    142 //      Renvoie le numéro identificateur de l'élément.
    143 //
    144 // void  ElDel(int id)
    145 //      Suppression de l'élément avec l'identificateur "id".
    146 // void  ElDelAll()
    147 //      Suppression de tous les éléments du dessin.
    148 //--
    149 
    150 /* --Methode-- */
    151 void  PIElDrawer::Draw(PIGraphicUC* g, double /*xmin*/, double /*ymin*/, double /*xmax*/, double /*ymax*/)
     330/* --Methode-- */
     331void  PIElDrawer::DrawAxes(PIGraphicUC* g)
     332{
     333  g->NoClip();
     334  g->SaveGraphicAtt();
     335  PIAxes axes;
     336  axes.DrawXYAxes(g, mGrAtt, axesFlags, axesAFSz, XMin(), XMax(), YMin(), YMax());
     337  g->RestoreGraphicAtt();
     338  if (showAxesLabels) {
     339    axes.DrawXCaption(g, labelAtt, axesFlags, xLabel);
     340    axes.DrawYCaption(g, labelAtt, axesFlags, yLabel);
     341  }
     342  g->Clip();
     343}
     344
     345/* --Methode-- */
     346void  PIElDrawer::Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax)
    152347{
    153348SelGraAtt(g);   // DrawAxes change certains attributs graphiques
     
    158353// Trace des titres
    159354if ( showTitles && ((titleT.length() > 0) || (titleB.length() > 0)) ) {
     355  PIGraphicAtt grs = GetGraphicAtt();
     356  UpdateGraphicAtt(titleAtt);
     357  SelGraAtt(g);
     358
    160359  aXdir = false;  // Vrai si Axe X de Droite vers Gauche
    161360  aYdir = false;  // Vrai si Axe Y de Haut vers Bas
     
    164363  fh = 0.075*(YMax()-YMin());
    165364  if ( titleT.length() > 0) {
    166       fx = g->CalcStringWidth(titleT.c_str());
    167       if(aXdir) fx = g->DeltaUCX(XMax(), -(XMax()-XMin()-fx)/2.);
    168       else fx = g->DeltaUCX(XMin(), (XMax()-XMin()-fx)/2.);
    169365      if (g->isAxeYDirUpDown()) fy = g->DeltaUCY(YMin(), -fh);
    170366      else fy = g->DeltaUCY(YMax(), fh);
    171       g->DrawString(fx, fy, titleT.c_str());
     367      g->DrawString((XMax()+XMin())*0.5, fy, titleT.c_str(), PI_HorizontalCenter | PI_VerticalCenter);
    172368//      printf(" PIElDrawer::Draw()/DBG (%g , %g) %s  - %g \n", fx, fy, titleT.c_str(), fh);
    173369    }
     
    178374      if (g->isAxeYDirUpDown()) fy =  g->DeltaUCY(YMax(), fh*1.5);
    179375      else fy = g->DeltaUCY(YMin(), -fh*1.5);
    180       g->DrawString(fx, fy, titleB.c_str());
     376      g->DrawString((XMax()+XMin())*0.5, fy, titleB.c_str(), PI_HorizontalCenter | PI_VerticalCenter);
    181377//      printf(" PIElDrawer::Draw()/DBG (%g , %g) %s  - %g \n", fx, fy, titleT.c_str(), fh);
    182378    }
    183   }
    184 DrwElList::iterator it;
    185 PIColors cc = g->GetForeground();
    186 for (it = mElist.begin(); it != mElist.end(); it++)
    187   {
    188   if ((*it).col != PI_NotDefColor)  g->SelForeground((*it).col);
    189   switch ( (*it).etyp )
    190     {
    191     case PIDEL_Line :
    192       g->DrawLine((*it).ex, (*it).ey, (*it).edx, (*it).edy );
    193       break;
    194     case PIDEL_Text :
    195       g->DrawString((*it).ex, (*it).ey, (char*) ((*it).es.c_str()) );
    196       break;
    197     case PIDEL_Rect :
    198       g->DrawBox((*it).ex, (*it).ey, (*it).edx, (*it).edy );
    199       break;
    200     case PIDEL_FRect :
    201       g->DrawFBox((*it).ex, (*it).ey, (*it).edx, (*it).edy );
    202       break;
    203     case PIDEL_Circ :
    204       g->DrawCircle((*it).ex, (*it).ey, (*it).edx );
    205       break;
    206     case PIDEL_FCirc :
    207       g->DrawFCircle((*it).ex, (*it).ey, (*it).edx );
    208       break;
    209     default :
    210       break;
    211     }
    212   g->SelForeground(cc);
    213   }
    214 }
    215 
    216 
    217 /* --Methode-- */
    218 int PIElDrawer::ElAdd(int typ, PIGrCoord x, PIGrCoord  y, PIGrCoord dx, PIGrCoord dy, const char* s, PIColors c)
    219 {
    220 DrwEl dre;
    221 mEn++;
    222 dre.eid = mEn;  dre.etyp = typ;
    223 dre.ex = x;   dre.ey = y;
    224 dre.edx = dx;  dre.edy = dy;
    225 dre.col = c;
    226 if (s)  dre.es = s;
    227 mElist.push_back(dre);
    228 return(mEn);
    229 }
    230 
    231 /* --Methode-- */
    232 void  PIElDrawer::ElDel(int id)
    233 {
    234 DrwElList::iterator it;
    235 for (it = mElist.begin(); it != mElist.end(); it++)
    236   if ( (*it).eid == id) { mElist.erase(it);   break; }
    237 return;
    238 }
    239 
    240 /* --Methode-- */
    241 void  PIElDrawer::ElDelAll()
    242 {
    243 mElist.erase(mElist.begin(), mElist.end());
    244 return;
    245 }
    246 
     379  SetGraphicAtt(grs);
     380  }
     381
     382 SelGraAtt(g);
     383// Trace des elements
     384 ElDrwMgr().DrawElements(g, xmin, ymin, xmax, ymax);
     385
     386}
     387
  • trunk/SophyaPI/PI/pieldrw.h

    r1970 r2164  
    1010//  Classe avec gestion d une liste d elements a tracer
    1111
    12 class PIElDrawer : public PIDrawer
     12class PIElDrwMgr
    1313{
    1414public:
    1515  enum { PIDEL_Line = 1, PIDEL_Text = 2,
    1616         PIDEL_Rect = 3, PIDEL_FRect = 4,
    17          PIDEL_Circ = 5, PIDEL_FCirc = 6 } ;
     17         PIDEL_Circ = 5, PIDEL_FCirc = 6,
     18         PIDEL_Poly = 7, PIDEL_FPoly = 8,
     19         PIDEL_Mark = 9, PIDEL_Arrow = 10 } ;
    1820
    19                      PIElDrawer();
    20   virtual           ~PIElDrawer();
     21                PIElDrwMgr();
     22  virtual       ~PIElDrwMgr();
    2123
    22   virtual void       SetTitles(const char* tt=NULL, const char* tb=NULL);
    23   virtual void       SetTitles(string const & tt, string const & tb);
    24  
    25   inline void        ShowTitles(bool fg=true) { showTitles = fg; }
     24  virtual void  DrawElements(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax);
    2625
    27 //   Methode de decodage des options
    28   virtual int        DecodeOptionString(vector<string> & opt, bool rmdecopt=true);
     26  inline int    ElAddLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2)
     27    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Line, x1, y1, x2, y2, NULL, gatt) ); } 
     28  inline int    ElAddLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2,
     29                          PIGraphicAtt const & gatt)
     30    { return( ElAdd(PIDEL_Line, x1, y1, x2, y2, NULL, gatt) ); } 
    2931
    30   virtual void       Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax);
     32  inline int    ElAddArrow(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2)
     33    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Arrow, x1, y1, x2, y2, NULL, gatt) ); } 
     34  inline int    ElAddArrow(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2,
     35                           PIGraphicAtt const & gatt)
     36    { return( ElAdd(PIDEL_Arrow, x1, y1, x2, y2, NULL, gatt) ); } 
    3137
    32   inline int         ElAddLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2,
    33                                PIColors c=PI_NotDefColor)
    34     { return( ElAdd(PIDEL_Line, x1, y1, x2, y2, NULL, c) ); } 
    35   inline int         ElAddText(PIGrCoord x, PIGrCoord y, const char* s, PIColors c=PI_NotDefColor)
    36     { return( ElAdd(PIDEL_Text, x, y, 0, 0, s, c) ); } 
    37   inline int         ElAddRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy,
    38                                PIColors c=PI_NotDefColor)
    39     { return( ElAdd(PIDEL_Rect, x, y, dx, dy, NULL, c) ); } 
    40   inline int         ElAddFRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy,
    41                                PIColors c=PI_NotDefColor)
    42     { return( ElAdd(PIDEL_FRect, x, y, dx, dy, NULL, c) ); } 
    43   inline int         ElAddCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r, PIColors c=PI_NotDefColor)
    44     { return( ElAdd(PIDEL_Circ, x, y, r, r, NULL, c) ); } 
    45   inline int         ElAddFCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r, PIColors c=PI_NotDefColor)
    46     { return( ElAdd(PIDEL_FCirc, x, y, r, r, NULL, c) ); } 
     38  inline int    ElAddMarker(PIGrCoord x, PIGrCoord y)
     39    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Circ, x, y, 0, 0, NULL, gatt) ); } 
     40  inline int    ElAddMarker(PIGrCoord x, PIGrCoord y, PIGraphicAtt const & gatt)
     41    { return( ElAdd(PIDEL_Mark, x, y, 0, 0, NULL, gatt) ); } 
     42
     43  inline int    ElAddText(PIGrCoord x, PIGrCoord y, const char* s)
     44    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Text, x, y, 0, 0, s, gatt) ); } 
     45  inline int    ElAddText(PIGrCoord x, PIGrCoord y, const char* s, PIGraphicAtt const & gatt)
     46    { return( ElAdd(PIDEL_Text, x, y, 0, 0, s, gatt) ); } 
     47  inline int    ElAddText(PIGrCoord x, PIGrCoord y, string const & s)
     48    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Text, x, y, 0, 0, s.c_str(), gatt) ); } 
     49  inline int    ElAddText(PIGrCoord x, PIGrCoord y, string const & s, PIGraphicAtt const & gatt)
     50    { return( ElAdd(PIDEL_Text, x, y, 0, 0, s.c_str(), gatt) ); } 
     51
     52  inline int    ElAddRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy)
     53    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Rect, x, y, dx, dy, NULL, gatt) ); } 
     54  inline int    ElAddRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy,
     55                          PIGraphicAtt const & gatt)
     56    { return( ElAdd(PIDEL_Rect, x, y, dx, dy, NULL, gatt) ); } 
     57
     58  inline int    ElAddFRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy)
     59    { PIGraphicAtt gatt; return( ElAdd(PIDEL_FRect, x, y, dx, dy, NULL, gatt) ); } 
     60  inline int    ElAddFRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy,
     61                           PIGraphicAtt const & gatt)
     62    { return( ElAdd(PIDEL_FRect, x, y, dx, dy, NULL, gatt) ); } 
     63
     64  inline int    ElAddCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r)
     65    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Circ, x, y, r, r, NULL, gatt) ); } 
     66  inline int    ElAddCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r, PIGraphicAtt const & gatt)
     67    { return( ElAdd(PIDEL_Circ, x, y, r, r, NULL, gatt) ); } 
     68
     69  inline int    ElAddFCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r)
     70    { PIGraphicAtt gatt; return( ElAdd(PIDEL_FCirc, x, y, r, r, NULL, gatt) ); } 
     71  inline int    ElAddFCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r, PIGraphicAtt const & gatt)
     72    { return( ElAdd(PIDEL_FCirc, x, y, r, r, NULL, gatt) ); } 
     73
     74  inline int    ElAddPoly(vector<PIGrCoord>& x, vector<PIGrCoord>& y)
     75    { PIGraphicAtt gatt; return( ElAdd(PIDEL_Poly, x, y, gatt) ); } 
     76  inline int    ElAddPoly(vector<PIGrCoord>& x, vector<PIGrCoord>& y, PIGraphicAtt const & gatt)
     77    { return( ElAdd(PIDEL_Poly, x, y, gatt) ); }
     78 
     79  inline int    ElAddFPoly(vector<PIGrCoord>& x, vector<PIGrCoord>& y)
     80    { PIGraphicAtt gatt; return( ElAdd(PIDEL_FPoly, x, y, gatt) ); } 
     81  inline int    ElAddFPoly(vector<PIGrCoord>& x, vector<PIGrCoord>& y, PIGraphicAtt const & gatt)
     82    { return( ElAdd(PIDEL_FPoly, x, y, gatt) ); } 
    4783
    4884  void               ElDel(int id);
     
    5187protected:
    5288  int                ElAdd(int typ, PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy,
    53                            const char* s, PIColors c=PI_NotDefColor);
    54 #ifdef __DECCXX
    55 public:
    56 #endif
     89                           const char* s, PIGraphicAtt const & att);
     90  int                ElAdd(int typ, vector<PIGrCoord>& x, vector<PIGrCoord>& y,
     91                           PIGraphicAtt const & att);
     92
    5793  struct DrwEl{
    5894    int eid, etyp;
     
    6096    PIGrCoord edx,edy;
    6197    string es;
    62     PIColors col;
     98    PIGraphicAtt gatt;
     99    PIGrCoord* xpol;
     100    PIGrCoord* ypol;
     101    int npol;
    63102  };
    64 #ifdef __DECCXX
    65 protected:
    66 #endif
     103
    67104  typedef list<DrwEl> DrwElList;
    68 
    69105  DrwElList mElist;
    70106  int mEn;
     107 
     108};
    71109
     110class PIElDrawer : public PIDrawer
     111{
     112public:
     113                     PIElDrawer();
     114  virtual           ~PIElDrawer();
     115
     116//   Methode de decodage des options
     117  virtual int        DecodeOptionString(vector<string> & opt, bool rmdecopt=true);
     118
     119  virtual void       DrawAxes(PIGraphicUC* g); // Trace d'axes avec label axe X,Y
     120
     121  virtual void       Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax);
     122
     123  inline PIElDrwMgr& ElDrwMgr()    { return eltsMgr; }
     124
     125  inline void        SetTitles(string tt, string tb)   { titleT = tt;  titleB = tb; }
     126  inline void        SetTitles(string tt, string tb, PIGraphicAtt const& att)
     127                        { titleT = tt;  titleB = tb; titleAtt = att; }
     128  inline void        ShowTitles(bool fg=true) { showTitles = fg; }
     129
     130  inline void        SetAxesLabels(string xl, string yl) { xLabel = xl;  yLabel = yl; }
     131  inline void        SetAxesLabels(string xl, string yl, PIGraphicAtt const& att)
     132                        { xLabel = xl;  yLabel = yl; labelAtt = att; }
     133  inline void        ShowAxesLabels(bool fg=true) { showAxesLabels = fg; }
     134
     135// -- Pour compatibilite avec l'interface precedente , Reza 08/2002
     136  inline void        ElDel(int id) { eltsMgr.ElDel(id); }
     137  inline void        ElDelAll()    { eltsMgr.ElDelAll(); }
     138 
     139  inline int         ElAddText(PIGrCoord x, PIGrCoord y, const char* s)
     140                                   { return eltsMgr.ElAddText(x, y, s); }
     141
     142protected:
     143  PIElDrwMgr eltsMgr;
    72144  string titleT, titleB;       // Titre Haut - Bas
    73   bool showTitles;              // Affichage des titres si true
     145  PIGraphicAtt titleAtt;       // Attributs graphiques de trace de titre
     146  bool showTitles;             // Affichage des titres si true
     147  string xLabel, yLabel;       // Label x, label y
     148  PIGraphicAtt labelAtt;       // Attributs graphiques de trace de label d'axes
     149  bool showAxesLabels;         // Affichage des labels d'axes si true
    74150
    75151};
  • trunk/SophyaPI/PI/piimage.cc

    r2157 r2164  
    11041104gvdrw->SetLimits(xw1, xw2, yw1, yw2, kAxeDirLtoR, kAxeDirUpDown);
    11051105int cmapid = cmap->Type();
     1106PIGraphicAtt gatt;
    11061107if ( (cmapid == CMAP_GREY32) || (cmapid == CMAP_GREYINV32) ||
    11071108     (cmapid == CMAP_GREY128) || (cmapid == CMAP_GREYINV128))
    1108   gvdrw->GetGraphicAtt().SetColAtt(PI_Red);
    1109 else gvdrw->GetGraphicAtt().SetColAtt(PI_Turquoise);
    1110 gvdrw->GetGraphicAtt().SetLineAtt(PI_NormalLine);
    1111 gvdrw->ElAddRect(x,y,dx,dy);
     1109  gatt.SetColAtt(PI_Red);
     1110else gatt.SetColAtt(PI_Turquoise);
     1111gatt.SetLineAtt(PI_NormalLine);
     1112gvdrw->ElDrwMgr().ElAddRect(x,y,dx,dy,gatt);
    11121113gvw->AddDrawer(gvdrw, xw1, yw1, xw2, yw2, false);
    11131114gvw->SetColMap(cmap, false);
  • trunk/SophyaPI/PI/pisurfdr.cc

    r2092 r2164  
    9595  Set3DView((xmin+xmax)/2., (ymin+ymax)/2, zmin+(zmax-zmin)*0.40,
    9696            (xmin+xmax)/2.+D , (ymin+ymax)/2.-2.5*D , zmin+(zmax-zmin)*0.85, 0.25, 0.25); 
    97  
    98   x3Min = xmin;   x3Max = xmax;
    99   y3Min = ymin;   y3Max = ymax;
    100   z3Min = zmin-PERC_GARDE*(zmax-zmin); z3Max = zmax+PERC_GARDE*(zmax-zmin);
     97
     98  Set3DBox(xmin, xmax, ymin, ymax, zmin-PERC_GARDE*(zmax-zmin), zmax+PERC_GARDE*(zmax-zmin));
    10199
    102100//  printf("PISurfaceDrawer::UpdateLimits() : %g-%g  %g-%g  %g-%g (%g) \n", xmin,xmax,ymin,ymax,zmin,zmax,D);
Note: See TracChangeset for help on using the changeset viewer.