Changeset 1921 in Sophya


Ignore:
Timestamp:
Mar 6, 2002, 5:53:29 PM (24 years ago)
Author:
perderos
Message:

1) modifs ds pidrwtools pour setter les attributs des fleches
2) modif ds pigrahuc pour les porpager

OP/RZ 06-03-22002

Location:
trunk/SophyaPI/PI
Files:
4 edited

Legend:

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

    r1907 r1921  
    22// Outils de manipulation des PIDrawer  R. Ansari 06/98
    33// LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA
    4 
     4// modifs pour
    55#include <stdlib.h>
    66
     
    103103
    104104int wszx = 5*spx+3.5*bsx;
    105 int wszy = (2+5*0.85)*bsy+(7+5*0.85)*spy;
     105int wszy = (2+6*0.85)*bsy+(7+6*0.85)*spy;
    106106SetSize(wszx, wszy);
    107107
     
    254254mOpt[7]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
    255255
    256 int kb;
    257256cpx = 2*spx;
    258257cpy += spy+bsyo;
     258// OP 03/2002
     259
     260mOpt[8] = new PIOptMenu(this, "bwt-opt-8", bsx*1.75, bsy, cpx, cpy);
     261mOpt[8]->AppendItem("Def.ArrowMrk", 900);
     262mOpt[8]->AppendItem("Basic-Arrow", 901);
     263mOpt[8]->AppendItem("Triangle-Arrow", 902);
     264mOpt[8]->AppendItem("FTriangle-Arrow", 903);
     265mOpt[8]->AppendItem("ShapedArrow", 904);
     266mOpt[8]->AppendItem("FShapedArrow", 905);
     267mOpt[8]->SetValue(900);
     268mOpt[8]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
     269
     270cpx += spx+1.75*bsx;
     271mOpt[9] = new PIOptMenu(this, "bwt-opt-9", bsx*1.75, bsy, cpx, cpy);
     272mOpt[9]->AppendItem("Arrow-1pt  ", 951);
     273mOpt[9]->AppendItem("Arrow-3pt ", 952);
     274mOpt[9]->AppendItem("Arrow-5pt", 953);
     275mOpt[9]->AppendItem("Arrow-7pt", 954);
     276mOpt[9]->AppendItem("Arrow-9pt", 955);
     277mOpt[9]->AppendItem("Arrow-11pt", 956);
     278mOpt[9]->AppendItem("Arrow-13pt", 957);
     279mOpt[9]->AppendItem("Arrow-15pt", 958);
     280mOpt[9]->AppendItem("Arrow-17pt", 959);
     281mOpt[9]->SetValue(952 );
     282mOpt[9]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
     283
     284cpx = 2*spx;
     285cpy += spy+bsyo;
     286
     287// end OP
     288int kb;
    259289bsy = bsyo; spy = spyo;
    260290mButdr[0] = new PIButton(this, "-", 1501, bsy, bsy, cpx, cpy);
     
    315345for(i=0; i<6; i++) delete mButcf[i];
    316346for(i=0; i<2; i++) delete mButdr[i];
    317 for(i=0; i<8; i++)  delete mOpt[i];
     347for(i=0; i<10 ; i++)  delete mOpt[i];
    318348for(i=0; i<2; i++)  delete mCasc[i];
    319349delete mNlb;
     
    349379static PIFontSize fntsz[6] = { PI_NotDefFontSize, PI_TinySizeFont, PI_SmallSizeFont,
    350380                               PI_NormalSizeFont, PI_LargeSizeFont, PI_HugeSizeFont };
     381
     382static PIArrowMarker arrmrk[6]= { PI_NotDefArrowMarker, PI_BasicArrowMarker,
     383                     PI_TriangleArrowMarker, PI_FTriangleArrowMarker,
     384                     PI_ArrowShapedArrowMarker, PI_FArrowShapedArrowMarker };
     385
    351386
    352387/* --Methode-- */
     
    475510for(kk=0; kk<13; kk++)
    476511  if (lat == line[kk])   { mOpt[5]->SetValue(600+kk);  break; }
     512
     513PIArrowMarker arr = gratt.GetArrowMarker();
     514for(kk==0 ; kk<6 ; kk++)
     515  if(arr == arrmrk[kk]) {mOpt[8]->SetValue(900+kk);}
     516     
     517kk = gratt.GetArrowMarkerSize();
     518if(kk<1) kk=1;
     519if(kk>17) kk=17;
     520 kk = (kk+1)/2;
     521mOpt[9]->SetValue(950 + kk);
    477522
    478523return;
     
    511556  if ( (k < 0) || (k > 12) )  k = 0;
    512557  gratt.SetLineAtt(PILineAtt(line[k]));
     558
     559  ii=mOpt[8]->GetValue()-900;
     560  jj=mOpt[9]->GetValue()-950;
     561 
     562  gratt.SetArrowMarkerAtt(2*jj-1,arrmrk[ii]);
     563 
    513564  drw->SetGraphicAtt(gratt);
     565
    514566  if (fgref)  mCurBW->Refresh();
    515567  else drw->Refresh();
  • trunk/SophyaPI/PI/pidrwtools.h

    r1851 r1921  
    3939private:
    4040// Pour couleur, fontes, etc
    41   PIOptMenu* mOpt[8];
     41  PIOptMenu* mOpt[10];
    4242  PIMenu* mCasc[5];
    4343  PILabel* mNlb;
  • trunk/SophyaPI/PI/pigraphuc.cc

    r1914 r1921  
    806806
    807807/* --Methode-- */
     808void PIGraphicUC::SelArrowMarker(int arrsz, PIArrowMarker arrmrk)
     809{
     810  if (!mGrC) return;
     811  mGrC->SelArrowMarker(arrsz, arrmrk);
     812}
     813
     814/* --Methode-- */
    808815void PIGraphicUC::SelFontSz(PIGrCoord sz)
    809816{
     
    837844
    838845/* --Methode-- */
     846void PIGraphicUC::SelArrowMarkerSz(PIGrCoord arrsz, PIArrowMarker arrmrk)
     847{
     848  if (!mGrC) return;
     849  double fx, fy;
     850  DUC2GrC((double)arrsz, (double)arrsz, fx, fy);
     851  int asz = int(0.5*(fx+fy+1));
     852  mGrC->SelArrowMarker(asz, arrmrk);
     853}
     854
     855/* --Methode-- */
    839856void PIGraphicUC::SetClipRectangle(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy)
    840857{
     
    891908  return(mGrC->GetMarkerSize());
    892909}
     910
     911/* --Methode-- */
     912PIArrowMarker PIGraphicUC::GetArrowMarker()
     913{
     914  if (!mGrC) return(PI_NotDefArrowMarker);
     915  return(mGrC->GetArrowMarker());
     916}
     917
     918/* --Methode-- */
     919int PIGraphicUC::GetArrowMarkerSize()
     920{
     921  if (!mGrC) return(0);
     922  return(mGrC->GetArrowMarkerSize());
     923}
     924
     925
    893926/* --Methode-- */
    894927PIGrCoord PIGraphicUC::GetFontHeight(PIGrCoord& asc, PIGrCoord& desc)
  • trunk/SophyaPI/PI/pigraphuc.h

    r1914 r1921  
    8484  virtual void       SelLine(PILineAtt const& att);
    8585  virtual void       SelMarker(int msz=3, PIMarker mrk=PI_DotMarker);
     86  virtual void       SelArrowMarker(int arrsz=5,
     87                                    PIArrowMarker arrmrk=PI_BasicArrowMarker);
    8688
    8789// Modification de fonte
     
    9496  virtual void       SelFontSz(PIGrCoord sz, PIFontAtt att);
    9597  virtual void       SelMarkerSz(PIGrCoord msz, PIMarker mrk=PI_DotMarker);
     98  virtual void       SelArrowMarkerSz(PIGrCoord arrsz,
     99                                      PIArrowMarker arrmrk=PI_BasicArrowMarker);
    96100
    97101// Selection de zone de trace (clip)
     
    106110  virtual PIMarker   GetMarker();
    107111  virtual int        GetMarkerSize();
     112  virtual PIArrowMarker    GetArrowMarker();
     113  virtual int        GetArrowMarkerSize();
    108114
     115
     116  inline  PIFont     GetFont() { return (mGrC->GetFont()) ; }
    109117  virtual PIGrCoord  GetFontHeight(PIGrCoord& asc, PIGrCoord& desc);
    110118  virtual PIGrCoord  CalcStringWidth(char const* s);
Note: See TracChangeset for help on using the changeset viewer.