Changeset 202 in Sophya for trunk/SophyaPI


Ignore:
Timestamp:
Feb 26, 1999, 3:18:35 PM (27 years ago)
Author:
ercodmgr
Message:

protec mem piimage, amelioration trace axes, rz+cmv 26/2/99

Location:
trunk/SophyaPI/PI
Files:
8 edited

Legend:

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

    r201 r202  
    245245{
    246246  BestTicks(xMin,xMax,7,xMajTickStep);
    247   xMinTickStep = xMajTickStep/10;
     247  xMinTickStep = xMajTickStep/5;
    248248  xFirstMajTick = int(xMin / xMajTickStep) * xMajTickStep;
    249249  if (xFirstMajTick < xMin) xFirstMajTick += xMajTickStep;
     
    252252
    253253  BestTicks(yMin,yMax,12,yMajTickStep);
    254   yMinTickStep = yMajTickStep/10;
     254  yMinTickStep = yMajTickStep/5;
    255255  yFirstMajTick = int(yMin / yMajTickStep) * yMajTickStep;
    256256  if (yFirstMajTick < yMin) yFirstMajTick += yMajTickStep;
     
    291291    g->DrawLine(xMin, 0, xMax, 0);
    292292    g->DrawLine(0, yMin, 0, yMax);
     293
     294    // La grille en pointilles
     295
     296    if (flags & kGridOn) DrawGrid(g);
    293297 
    294298    // Les ticks majeurs
  • trunk/SophyaPI/PI/pidrawer.h

    r201 r202  
    4949  float YMin() const {return yMin;}
    5050  float YMax() const {return yMax;}
     51  inline unsigned int GetAxesFlags() { return(axesFlags); }
    5152 
    5253  inline PIGraphicUC*    GetGraphicUC() { return(mGrUC); }
  • trunk/SophyaPI/PI/pidrwtools.cc

    r201 r202  
    7878mText[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    7979
    80 cpx = 2*spx+0.25*bsx;
     80cpx = spx+0.25*bsx;
    8181cpy += spy+bsy;
    82 mCkb[0] = new PICheckBox(this,"AxeX-RtoL", 2000, 1.5*bsx, bsy, cpx, cpy);
    83 cpx += spx+1.5*bsx;
    84 mCkb[1] = new PICheckBox(this,"AxeY-UpDown", 2000, 1.5*bsx, bsy, cpx, cpy);
     82mCkb[0] = new PICheckBox(this,"X-RtoL", 2000, bsx, bsy, cpx, cpy);
     83cpx += spx+bsx;
     84mCkb[1] = new PICheckBox(this,"Y-UpDn", 2000, bsx, bsy, cpx, cpy);
     85cpx += spx+bsx;
     86mCkb[2] = new PICheckBox(this,"Grid", 2000, bsx, bsy, cpx, cpy);
    8587mCkb[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    8688mCkb[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
     89mCkb[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    8790
    8891cpy += spy+bsy;
     
    248251  delete mButcf[i];
    249252  }
     253for(i=0; i<3; i++) delete mCkb[i];
    250254delete mBut[2];
    251255for(i=0; i<6; i++)  delete mOpt[i];
     
    305309mCkb[0]->SetState(false);
    306310mCkb[1]->SetState(false);
     311mCkb[2]->SetState(false);
    307312
    308313mOpt[0]->SetValue(100);
     
    339344    if (mCkb[0]->GetState())  axrl = kAxeDirRtoL ;
    340345    if (mCkb[1]->GetState())  ayud = kAxeDirUpDown;
    341     if ( mCurBW->kind() == PIScDrawWdg::ClassId ) ((PIScDrawWdg*)mCurBW)-> SetLimits(xmin, xmax, ymin, ymax, axrl, ayud);
     346    if ( mCurBW->kind() == PIScDrawWdg::ClassId ) {
     347      ((PIScDrawWdg*)mCurBW)->SetLimits(xmin, xmax, ymin, ymax, axrl, ayud);
     348      unsigned int flags = ((PIScDrawWdg*)mCurBW)->GetAxesFlags();
     349      if (mCkb[2]->GetState()) ((PIScDrawWdg*)mCurBW)->SetAxesFlags(flags | kGridOn);
     350      else  ((PIScDrawWdg*)mCurBW)->SetAxesFlags(flags & ~kGridOn);
     351      }
    342352    else mCurBW->SetDefaultDrawerLimits(xmin, xmax, ymin, ymax, axrl, ayud);
    343353    mCurBW->Refresh();
  • trunk/SophyaPI/PI/pidrwtools.h

    r120 r202  
    3737  PIButton* mBut[3];
    3838  PIText* mText[2];
    39   PICheckBox* mCkb[2];
     39  PICheckBox* mCkb[3];
    4040// Pour couleur, fontes, etc
    4141  PIOptMenu* mOpt[6];
  • trunk/SophyaPI/PI/pigraphuc.cc

    r197 r202  
    167167void PIGraphicUC::UC2GrC(float x, float y, float& xpix, float& ypix)
    168168{
    169   xpix = (float)(xOrg + x*xScale);  // $CHECK$ Reza 21/06/98 ? + .5);
    170   ypix = (float)(yOrg + y*yScale);  // $CHECK$ Reza 21/06/98 ?+ .5);
     169  xpix = (float)(xOrg + x*xScale); 
     170  ypix = (float)(yOrg + y*yScale); 
    171171}
    172172
  • trunk/SophyaPI/PI/piimage.cc

    r163 r202  
    421421  }
    422422
    423 if (showinfo) {
     423if (showinfo && img) {
    424424  char buff[256];
    425425  float x,y;
     
    443443
    444444// ----  Le copier ----
    445   if (key == 'C' || key == 'c') {
     445  if ((key == 'C' || key == 'c') && img) {
    446446    // On limite la taille a 48x48
    447447    int i1 = XPave(); 
     
    664664void PIImage::PasteSelection(unsigned int typ, void *pdata, unsigned int l)
    665665{
     666if (!img) return;
    666667if (typ != PICP_string) return;
    667668int ll = (l<256) ? l+1 : 256;
     
    917918int PIImage::PosW2Img(int xiw, int yiw, int * xp, int * yp)
    918919{
     920if (!img) { *xp = *yp = 0;  return(1); }
    919921xiw -= ofx;  yiw -= ofy;   // Offset d'affichage du pixmap
    920922if (zoom > 0)
     
    938940int PIImage::PosImg2W(int xp, int yp, int * xiw, int * yiw)
    939941{
     942if (!img) { *xiw = *yiw = -1;  return(1); }
    940943if (zoom > 0)
    941944  {
     
    961964void PIImage::SetOffsetFromPave()
    962965{
     966if (!img) { offx = offy = 0; return; }
    963967if (zoom > 0)
    964968  {
     
    991995  { xwsz = -(XSize()*zoom);
    992996  ywsz = -(YSize()*zoom); }
    993  
    994 if (xwsz > (img->XSize()-offx)) xwsz = (img->XSize()-offx);
    995 if (ywsz > (img->YSize()-offy)) ywsz = (img->YSize()-offy);
     997
     998if (img) {   
     999  if (xwsz > (img->XSize()-offx)) xwsz = (img->XSize()-offx);
     1000  if (ywsz > (img->YSize()-offy)) ywsz = (img->YSize()-offy);
     1001  }
    9961002xpav = offx+xwsz/2;
    9971003ypav = offx+ywsz/2;
  • trunk/SophyaPI/PI/piscdrawwdg.cc

    r190 r202  
    182182  char buff[128];
    183183  sprintf(buff, "X= %g  Y= %g",  x, y);
     184  //  sprintf(buff, "%.3f,%.3f ",  x, y);
    184185  return((string)buff);
    185186}
     
    229230 
    230231  string ctxt =  GetClickText(dx, dy);
    231 
     232//DEBUG  char buff[32];    sprintf(buff, " %d:%d",xp,yp); ctxt += buff;
    232233  if (mTxw)
    233234    mTxw->SetLabel(ctxt);
  • trunk/SophyaPI/PI/piscdrawwdg.h

    r180 r202  
    3030  virtual void       UpdateLimits();  // Calcule et change les limites a partir de Drawer-No-1
    3131
    32   inline void        SetAxesFlags(unsigned int flags=kAxesDflt) { mBDrw->SetAxesFlags(flags); }
     32  inline void        SetAxesFlags(unsigned int flags=kBoxAxes | kExtTicks | kLabels)
     33                                  { mBDrw->SetAxesFlags(flags); }
     34  inline unsigned int GetAxesFlags() { return(mBDrw->GetAxesFlags()); }
    3335
    3436  inline void        SetTitles(const char* tt=NULL, const char* tb=NULL)
Note: See TracChangeset for help on using the changeset viewer.