Changeset 117 in Sophya for trunk/SophyaPI


Ignore:
Timestamp:
Jul 6, 1998, 10:12:18 AM (27 years ago)
Author:
ansari
Message:

Corrections mineures (/Linux) Reza 6/07/98

Location:
trunk/SophyaPI/PI
Files:
5 edited

Legend:

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

    r114 r117  
    6464float maxpix = min;
    6565float pixv;
    66 printf("DEBUG_CHECKDYN-IN %d - %g %g ", vit, min, max);
     66// printf("DEBUG_CHECKDYN-IN %d - %g %g ", vit, min, max);
    6767
    6868int n = 0;
     
    100100else { moy = 0.;  sig = -1.; }
    101101
    102 printf("DEBUG_CHECKDYN: %d %g %g - %g %g \n", n, min, max, moy, sig);
     102// printf("DEBUG_CHECKDYN: %d %g %g - %g %g \n", n, min, max, moy, sig);
    103103return(n);
    104104}
  • trunk/SophyaPI/PI/pigraphx.cc

    r114 r117  
    659659BigFontIndex = (kksel < NMAXFONTSZ-2) ? kksel+2 : NMAXFONTSZ-1 ;
    660660
    661 printf("PIGraphicX::Init()-DBG- FontIndex= %d %d %d (%d) \n",
    662        SmallFontIndex, NormalFontIndex, BigFontIndex, szf);
     661//printf("PIGraphicX::Init()-DBG- FontIndex= %d %d %d (%d) \n",
     662//       SmallFontIndex, NormalFontIndex, BigFontIndex, szf);
    663663
    664664/*  Les couleurs  */
  • trunk/SophyaPI/PI/piimage.cc

    r116 r117  
    610610yw2 = yspxm+yw1;
    611611SetDefaultDrawRectangle(xw1, yw1, xw2, yw2, false);
    612 printf("--DBG-- ComputePixmap() %d %d $ %d %d :: %d %d , %d %d \n", xwsz, ywsz, xspxm, yspxm, xw1, yw1, xw2, yw2);
     612// printf("--DBG-- ComputePixmap() %d %d $ %d %d :: %d %d , %d %d \n", xwsz, ywsz, xspxm, yspxm, xw1, yw1, xw2, yw2);
    613613int x1,y1, x2,y2;
    614614ofx = xw1;  ofy = yw1;
     
    619619img->Coord(x2,y2, fx2, fy1);  // En effet Image de haut vers bas, Axes de bas vers haut par defaut
    620620SetDefaultDrawerLimits(fx1, fx2, fy1, fy2, kAxeDirAuto, kAxeDirAuto);
    621 printf("--DBG2-- ComputePixmap() %g %g  %g %g  \n", fx1, fx2, fy1, fy2);
     621// printf("--DBG2-- ComputePixmap() %g %g  %g %g  \n", fx1, fx2, fy1, fy2);
    622622xcurs = ycurs = -1;
    623623SetPixmap(pixm, xspxm, yspxm, true, xw1, yw1);
  • trunk/SophyaPI/PI/piimgtools.cc

    r116 r117  
    3232spy = bsy/4;
    3333
    34 int wszx = 8*spx+3*bsx+1.5*bsy;
    35 int wszy = 10*spy+7*bsy;
     34int wszx = 8*spx+3*bsx+2*bsy;
     35int wszy = 10*spy+9*bsy;
    3636SetSize(wszx, wszy);
    3737
     
    8282mOpt[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    8383
    84 cpy += spy+bsy;
     84cpy += 2*spy+bsy;
    8585cpx = bsx/2;
    8686mBut[0] = new PIButton(this, "Apply", 2500, bsx*1.5, bsy, cpx, cpy);
     
    9090mBut[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    9191
    92 int offy = cpy+bsy+spy*2;
     92int offy = cpy+bsy+spy*3;
    9393printf("-DBG- PIImgLutWind()  SzX,Y= %d %d , ButPos= %d %d (off=%d)\n", wszx, wszy, cpx, cpy, offy);
    9494
    95 cpx = 5*spx+2.5*bsx;
     95cpx = 6*spx+2.75*bsx;
    9696cpy = 2*spy;
    97 mSc[0] = new PIScale(this, "offset-lut", 2700, false, bsy*0.75, 4.5*bsy, cpx, cpy);
     97mSc[0] = new PIScale(this, "sc-offset-lut", 2700, false, bsy*0.75, 4.5*bsy, cpx, cpy);
    9898cpx += 1.5*bsy;
    99 mSc[1] = new PIScale(this, "offset-lut", 2800, false, bsy*0.75, 4.5*bsy, cpx, cpy);
     99mSc[1] = new PIScale(this, "sc-dyn-lut", 2800, false, bsy*0.75, 4.5*bsy, cpx, cpy);
    100100mSc[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    101101mSc[0]->SetMinMax(-50, 50);
     
    106106
    107107//  Option-Menu  Couleur/Zoom
    108 cpx = 2*spx;
     108cpx = 3*spx;
    109109cpy = offy;
    110110mOptzc[0] = new PIOptMenu(this, "imglut-opt-3", 1.5*bsx, bsy, cpx, cpy);
     
    120120mOptzc[0]->AppendItem("Col16", 210);
    121121mOptzc[0]->SetValue(203);
    122 
    123 cpx += 1.5*bsx+2*spx;
     122mOptzc[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
     123
     124cpx += 1.5*bsx+3*spx;
    124125mOptzc[1] = new PIOptMenu(this, "imglut-opt-4", 1.5*bsx, bsy, cpx, cpy);
    125126mOptzc[1]->AppendItem("Agr. x10", 110);
     
    139140mOptzc[1]->AppendItem("Red. /10", 90);
    140141mOptzc[1]->SetValue(101);
     142mOptzc[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
     143
     144cpx = 2*spx;
     145cpy += bsy+spy;
     146mButsz[0] = new PIButton(this, "1x1", 3201,  bsx/2, bsy, cpx, cpy);
     147mButsz[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
     148cpx += bsx/2+spx;
     149mButsz[1] = new PIButton(this, "1x2", 3202,  bsx/2, bsy, cpx, cpy);
     150mButsz[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
     151cpx += bsx/2+spx;
     152mButsz[2] = new PIButton(this, "1x4", 3204,  bsx/2, bsy, cpx, cpy);
     153mButsz[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
     154cpx += bsx/2+spx;
     155mButsz[3] = new PIButton(this, "1/2", 3198,  bsx/2, bsy, cpx, cpy);
     156mButsz[3]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
     157cpx += bsx/2+spx;
     158mButsz[4] = new PIButton(this, "1/4", 3196,  bsx/2, bsy, cpx, cpy);
     159mButsz[4]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
     160
     161cpx = 2*spx;
     162cpy += bsy+spy;
     163mButcax[0] = new PIButton(this, "- X", 5201,  bsx/2, bsy, cpx, cpy);
     164mButcax[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
     165cpx += bsx/2+spx;
     166mButcax[1] = new PIButton(this, "- Y", 5202,  bsx/2, bsy, cpx, cpy);
     167mButcax[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
     168cpx += bsx/2+spx;
     169mButcax[2] = new PIButton(this, "X<>Y", 5203,  bsx/2, bsy, cpx, cpy);
     170mButcax[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    141171
    142172curlutw = this;
     
    158188  delete mOptzc[i];
    159189  }
     190for(int i=0; i<5; i++)  delete mButsz[i];
     191for(int i=0; i<3; i++)  delete mButcax[i];
     192
    160193}
    161194
     
    191224
    192225msg = UserMsg(msg);
     226
     227if (msg == 2600)  { this->Hide();  return; }
     228PIImage* mpii = PIImage::CurrentPIImage();
     229if (mpii == NULL)  return;
     230
    193231switch (msg)
    194232  {
    195   case 2600:
    196     this->Hide();
    197     break;
    198233  case 2500:
    199234  case 2700 :
    200235  case 2800 :
    201236    {
    202     if (PIImage::CurrentPIImage() == NULL)  return;
    203237    min = atof(mText[0]->GetText().c_str());
    204238    max = atof(mText[1]->GetText().c_str());
    205239    if (msg == 2700) {
     240      del = max-min;
    206241      min += (float)mSc[0]->GetValue()/100*del;
    207242      max += (float)mSc[0]->GetValue()/100*del;
    208243    }
    209244    if (msg == 2800) {
    210       min -= (float)mSc[0]->GetValue()/100*del*0.5;
    211       max += (float)mSc[0]->GetValue()/100*del*0.5;
     245      del = max-min;
     246      min -= (float)mSc[1]->GetValue()/100.*del*0.5;
     247      max += (float)mSc[1]->GetValue()/100.*del*0.5;
    212248    }
    213249    if ( (msg == 2700) || (msg == 2800) ) {
     
    228264    break;
    229265
     266  case 3201 :
     267  case 3202 :
     268  case 3204 :
     269  case 3198 :
     270  case 3196 :
     271    {
     272    PIImage* pimg = PIImage::CurrentPIImage();
     273    printf(" --DBG-- msg= %ld  pimg= %lx \n", (long)msg, (long)pimg);
     274    int zm = msg-3200;
     275    pimg->SetZoom(zm, false);
     276    int sx, sy, snx, sny;
     277    sx = pimg->XSize();
     278    sy = pimg->YSize();
     279    if (zm > 0)
     280      {
     281      snx = pimg->Image()->XSize()*zm;
     282      sny = pimg->Image()->YSize()*zm;
     283      }
     284    else
     285      {
     286      snx = pimg->Image()->XSize()/(-zm);
     287      sny = pimg->Image()->YSize()/(-zm);
     288      }
     289    if ((snx != sx) || (sny != sy))
     290      {
     291      pimg->SetOffset(0, 0, false);
     292      if (((PIContainer*)(pimg-Parent()))->NbChilds() == 1) 
     293        ((PIContainer*)(pimg-Parent()))->SetSize(snx, sny);
     294      }
     295    else   pimg->SetOffset(0, 0);
     296   
     297    }
     298    break;
     299
     300  case 5201 :
     301    mpii->ChangeAxesConfiguration(true, false, false);
     302    break;
     303  case 5202 :
     304    mpii->ChangeAxesConfiguration(false, true, false);
     305    break;
     306  case 5203 :
     307    mpii->ChangeAxesConfiguration(false, false, true);
     308    break;
     309
    230310  default:
    231311//    printf("PIImgLutWind::Process Msg %d received \n", (int)msg);
     
    233313  }
    234314
    235 if (PIImage::CurrentPIImage() == NULL)  return;
    236315
    237316CMapId cmap[10] =  { CMAP_GREY32, CMAP_GREYINV32, CMAP_COLRJ32,
     
    242321if ((msg <= 110) && (msg >= 90))  // Zoom
    243322  PIImage::CurrentPIImage()->SetZoom((int)(msg-100));
    244 else if ((msg > 200) && (msg < 206)) // Changement de couleur
     323else if ((msg > 200) && (msg < 211)) // Changement de couleur
    245324  PIImage::CurrentPIImage()->SetColMap(cmap[msg-201]);
    246325
  • trunk/SophyaPI/PI/piwindowx.cc

    r114 r117  
    112112{
    113113pwm->SetSize(sx, sy);
     114PIWdgX::SetSize(sx, sy);
    114115return;
    115116}
     
    119120{
    120121pwm->SetPos(px, py);
     122PIWdgX::SetPos(px, py);
    121123return;
    122124}
Note: See TracChangeset for help on using the changeset viewer.