Changeset 119 in Sophya for trunk/SophyaPI
- Timestamp:
- Jul 13, 1998, 8:08:21 PM (27 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 2 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/Makefile
r114 r119 4 4 5 5 all: $(LIB)libPI.a 6 $(LIB)libPI.a : $(OBJ)lut.o $(OBJ)parradapter.o $(OBJ)pi3ddrw.o $(OBJ)piapplgen.o $(OBJ)piapplx.o $(OBJ)pibwdggen.o $(OBJ)pibwdgx.o $(OBJ)picmap.o $(OBJ)picmapgen.o $(OBJ)picmapview.o $(OBJ)picmapx.o $(OBJ)picons.o $(OBJ)picontainergen.o $(OBJ)picontainerx.o $(OBJ)pidrawer.o $(OBJ)pidrawwin.o $(OBJ)pidrwtools.o $(OBJ)pifilechogen.o $(OBJ)pifilechox.o $(OBJ)pigraph3d.o $(OBJ)pigraphgen.o $(OBJ)pigraphps.o $(OBJ)pigraphuc.o $(OBJ)pigraphx.o $(OBJ)pihisto.o $(OBJ)pihisto2d.o $(OBJ)piimage.o $(OBJ)piimgtools.o $(OBJ)piinit.o $(OBJ)pilistgen.o $(OBJ)pilistx.o $(OBJ)pimenubargen.o $(OBJ)pimenubarx.o $(OBJ)pimenugen.o $(OBJ)pimenux.o $(OBJ)pimsghandler.o $(OBJ)pintup3d.o $(OBJ)pintuple.o $(OBJ)pioptmenugen.o $(OBJ)pioptmenux.o $(OBJ)piperiodx.o $(OBJ)pipixmapgen.o $(OBJ)pipixmapx.o $(OBJ)pi scdrawwdg.o $(OBJ)pistdwdggen.o $(OBJ)pistdwdgx.o $(OBJ)pistlist.o $(OBJ)pisurfdr.o $(OBJ)piup.o $(OBJ)piwdggen.o $(OBJ)piwdgx.o $(OBJ)piwindowgen.o $(OBJ)piwindowx.o $(OBJ)pixtbase.o $(OBJ)psfile.o6 $(LIB)libPI.a : $(OBJ)lut.o $(OBJ)parradapter.o $(OBJ)pi3ddrw.o $(OBJ)piapplgen.o $(OBJ)piapplx.o $(OBJ)pibwdggen.o $(OBJ)pibwdgx.o $(OBJ)picmap.o $(OBJ)picmapgen.o $(OBJ)picmapview.o $(OBJ)picmapx.o $(OBJ)picons.o $(OBJ)picontainergen.o $(OBJ)picontainerx.o $(OBJ)pidrawer.o $(OBJ)pidrawwin.o $(OBJ)pidrwtools.o $(OBJ)pifilechogen.o $(OBJ)pifilechox.o $(OBJ)pigraph3d.o $(OBJ)pigraphgen.o $(OBJ)pigraphps.o $(OBJ)pigraphuc.o $(OBJ)pigraphx.o $(OBJ)pihisto.o $(OBJ)pihisto2d.o $(OBJ)piimage.o $(OBJ)piimgtools.o $(OBJ)piinit.o $(OBJ)pilistgen.o $(OBJ)pilistx.o $(OBJ)pimenubargen.o $(OBJ)pimenubarx.o $(OBJ)pimenugen.o $(OBJ)pimenux.o $(OBJ)pimsghandler.o $(OBJ)pintup3d.o $(OBJ)pintuple.o $(OBJ)pioptmenugen.o $(OBJ)pioptmenux.o $(OBJ)piperiodx.o $(OBJ)pipixmapgen.o $(OBJ)pipixmapx.o $(OBJ)pipodrw.o $(OBJ)piscdrawwdg.o $(OBJ)pistdwdggen.o $(OBJ)pistdwdgx.o $(OBJ)pistlist.o $(OBJ)pisurfdr.o $(OBJ)piup.o $(OBJ)piwdggen.o $(OBJ)piwdgx.o $(OBJ)piwindowgen.o $(OBJ)piwindowx.o $(OBJ)pixtbase.o $(OBJ)psfile.o 7 7 $(AR) $(ARFLAGS) $@ $? 8 8 ifeq ($(CXX),cxx) … … 12 12 13 13 clean: 14 rm -f $(OBJ)lut.o $(OBJ)parradapter.o $(OBJ)pi3ddrw.o $(OBJ)piapplgen.o $(OBJ)piapplx.o $(OBJ)pibwdggen.o $(OBJ)pibwdgx.o $(OBJ)picmap.o $(OBJ)picmapgen.o $(OBJ)picmapview.o $(OBJ)picmapx.o $(OBJ)picons.o $(OBJ)picontainergen.o $(OBJ)picontainerx.o $(OBJ)pidrawer.o $(OBJ)pidrawwin.o $(OBJ)pidrwtools.o $(OBJ)pifilechogen.o $(OBJ)pifilechox.o $(OBJ)pigraph3d.o $(OBJ)pigraphgen.o $(OBJ)pigraphps.o $(OBJ)pigraphuc.o $(OBJ)pigraphx.o $(OBJ)pihisto.o $(OBJ)pihisto2d.o $(OBJ)piimage.o $(OBJ)piimgtools.o $(OBJ)piinit.o $(OBJ)pilistgen.o $(OBJ)pilistx.o $(OBJ)pimenubargen.o $(OBJ)pimenubarx.o $(OBJ)pimenugen.o $(OBJ)pimenux.o $(OBJ)pimsghandler.o $(OBJ)pintup3d.o $(OBJ)pintuple.o $(OBJ)pioptmenugen.o $(OBJ)pioptmenux.o $(OBJ)piperiodx.o $(OBJ)pipixmapgen.o $(OBJ)pipixmapx.o $(OBJ)pi scdrawwdg.o $(OBJ)pistdwdggen.o $(OBJ)pistdwdgx.o $(OBJ)pistlist.o $(OBJ)pisurfdr.o $(OBJ)piup.o $(OBJ)piwdggen.o $(OBJ)piwdgx.o $(OBJ)piwindowgen.o $(OBJ)piwindowx.o $(OBJ)pixtbase.o $(OBJ)psfile.o14 rm -f $(OBJ)lut.o $(OBJ)parradapter.o $(OBJ)pi3ddrw.o $(OBJ)piapplgen.o $(OBJ)piapplx.o $(OBJ)pibwdggen.o $(OBJ)pibwdgx.o $(OBJ)picmap.o $(OBJ)picmapgen.o $(OBJ)picmapview.o $(OBJ)picmapx.o $(OBJ)picons.o $(OBJ)picontainergen.o $(OBJ)picontainerx.o $(OBJ)pidrawer.o $(OBJ)pidrawwin.o $(OBJ)pidrwtools.o $(OBJ)pifilechogen.o $(OBJ)pifilechox.o $(OBJ)pigraph3d.o $(OBJ)pigraphgen.o $(OBJ)pigraphps.o $(OBJ)pigraphuc.o $(OBJ)pigraphx.o $(OBJ)pihisto.o $(OBJ)pihisto2d.o $(OBJ)piimage.o $(OBJ)piimgtools.o $(OBJ)piinit.o $(OBJ)pilistgen.o $(OBJ)pilistx.o $(OBJ)pimenubargen.o $(OBJ)pimenubarx.o $(OBJ)pimenugen.o $(OBJ)pimenux.o $(OBJ)pimsghandler.o $(OBJ)pintup3d.o $(OBJ)pintuple.o $(OBJ)pioptmenugen.o $(OBJ)pioptmenux.o $(OBJ)piperiodx.o $(OBJ)pipixmapgen.o $(OBJ)pipixmapx.o $(OBJ)pipodrw.o $(OBJ)piscdrawwdg.o $(OBJ)pistdwdggen.o $(OBJ)pistdwdgx.o $(OBJ)pistlist.o $(OBJ)pisurfdr.o $(OBJ)piup.o $(OBJ)piwdggen.o $(OBJ)piwdgx.o $(OBJ)piwindowgen.o $(OBJ)piwindowx.o $(OBJ)pixtbase.o $(OBJ)psfile.o 15 15 ifeq ($(CXX),cxx) 16 16 cd $(REPM); rm -f *.o … … 24 24 piwdgx.h piwdggen.h pimsghandler.h picmap.h picmapx.h picmapgen.h \ 25 25 pigraphx.h pigraphgen.h pigraphuc.h psfile.h \ 26 $(EROSDEVREP)/Include/defs.h pigraph3d.h pibwdgx.h pigraphps.h 26 $(EROSDEVREP)/Include/defs.h pigraph3d.h pibwdgx.h pigraphps.h \ 27 pidrwtools.h pistdwdgx.h pistdwdggen.h pioptmenux.h pioptmenugen.h \ 28 pimenux.h pimenugen.h piwindowx.h piwindowgen.h picontainerx.h \ 29 picontainergen.h piapplx.h piapplgen.h pimenubarx.h pimenubargen.h \ 30 picons.h 27 31 $(OBJ)piapplgen.o: piapplgen.cc piapplgen.h pimsghandler.h pisysdep.h \ 28 32 picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimenubarx.h \ … … 40 44 pimsghandler.h picmap.h picmapx.h picmapgen.h pigraphx.h pigraphgen.h \ 41 45 pigraphuc.h psfile.h $(EROSDEVREP)/Include/defs.h pidrawer.h \ 42 pigraphps.h 46 pigraphps.h pidrwtools.h pistdwdgx.h pistdwdggen.h pioptmenux.h \ 47 pioptmenugen.h pimenux.h pimenugen.h piwindowx.h piwindowgen.h \ 48 picontainerx.h picontainergen.h piapplx.h piapplgen.h pimenubarx.h \ 49 pimenubargen.h picons.h pibwdgx.h 43 50 $(OBJ)pibwdgx.o: pibwdgx.cc pixtbaseP.h pibwdgx.h pisysdep.h pibwdggen.h \ 44 51 piwdgx.h piwdggen.h pimsghandler.h picmap.h picmapx.h picmapgen.h \ … … 71 78 $(EROSDEVREP)/Include/defs.h pigraphps.h pistdwdgx.h pistdwdggen.h \ 72 79 pidrawer.h 73 $(OBJ)pidrwtools.o: pidrwtools.cc pidrwtools.h pisysdep.h pi menux.h \74 pi menugen.h piwdgx.h piwdggen.h pimsghandler.h piapplx.h piapplgen.h \75 pi containerx.h picontainergen.h pimenubarx.h pimenubargen.h picons.h \76 pi stdwdgx.h pistdwdggen.h pibwdgx.h pibwdggen.h picmap.h picmapx.h \77 pi cmapgen.h pigraphx.h pigraphgen.h pigraphuc.h psfile.h \78 $(EROSDEVREP)/Include/defs.h pigraphps.h piscdrawwdg.h piwindowx.h \79 piwindowgen.h pidrawer.h80 $(OBJ)pidrwtools.o: pidrwtools.cc pidrwtools.h pisysdep.h pistdwdgx.h \ 81 pistdwdggen.h piwdgx.h piwdggen.h pimsghandler.h pioptmenux.h \ 82 pioptmenugen.h pimenux.h pimenugen.h piwindowx.h piwindowgen.h \ 83 picontainerx.h picontainergen.h piapplx.h piapplgen.h pimenubarx.h \ 84 pimenubargen.h picons.h pibwdgx.h pibwdggen.h picmap.h picmapx.h \ 85 picmapgen.h pigraphx.h pigraphgen.h pigraphuc.h psfile.h \ 86 $(EROSDEVREP)/Include/defs.h pigraphps.h piscdrawwdg.h pidrawer.h 80 87 $(OBJ)pifilechogen.o: pifilechogen.cc pifilechogen.h pisysdep.h piwdgx.h \ 81 88 piwdggen.h pimsghandler.h … … 127 134 pigraphuc.h psfile.h pipixmapx.h pipixmapgen.h pibwdgx.h pigraphps.h \ 128 135 pistdwdgx.h pistdwdggen.h piwindowx.h piwindowgen.h picontainerx.h \ 129 picontainergen.h 136 picontainergen.h piimgtools.h pioptmenux.h pioptmenugen.h pimenux.h \ 137 pimenugen.h piapplx.h piapplgen.h pimenubarx.h pimenubargen.h \ 138 picons.h pidrwtools.h 130 139 $(OBJ)piimgtools.o: piimgtools.cc piimgtools.h pisysdep.h pistdwdgx.h \ 131 pistdwdggen.h piwdgx.h piwdggen.h pimsghandler.h pi menux.h \132 pi menugen.h pioptmenux.h pioptmenugen.h piwindowx.h piwindowgen.h \140 pistdwdggen.h piwdgx.h piwdggen.h pimsghandler.h pioptmenux.h \ 141 pioptmenugen.h pimenux.h pimenugen.h piwindowx.h piwindowgen.h \ 133 142 picontainerx.h picontainergen.h piapplx.h piapplgen.h pimenubarx.h \ 134 143 pimenubargen.h picons.h pibwdgx.h pibwdggen.h picmap.h picmapx.h \ … … 200 209 picmapx.h picmapgen.h pigraphx.h pigraphgen.h pigraphuc.h psfile.h \ 201 210 $(EROSDEVREP)/Include/defs.h pigraphps.h 202 $(OBJ)piscdrawwdg.o: piscdrawwdg.cc $(EROSDEVREP)/Include/generalfit.h \ 203 $(EROSDEVREP)/Include/exceptions.h $(EROSDEVREP)/Include/defs.h \ 211 $(OBJ)pipodrw.o: pipodrw.cc pipodrw.h pidrawer.h pibwdggen.h pisysdep.h \ 212 piwdgx.h piwdggen.h pimsghandler.h picmap.h picmapx.h picmapgen.h \ 213 pigraphx.h pigraphgen.h pigraphuc.h psfile.h \ 214 $(EROSDEVREP)/Include/defs.h $(EROSDEVREP)/Include/generalfit.h \ 215 $(EROSDEVREP)/Include/exceptions.h \ 204 216 $(EROSDEVREP)/Include/peidainit.h \ 205 217 $(EROSDEVREP)/Include/matrix.h $(EROSDEVREP)/Include/peida.h \ … … 208 220 $(EROSDEVREP)/Include/ppersist.h \ 209 221 $(EROSDEVREP)/Include/pclassids.h \ 210 $(EROSDEVREP)/Include/cvector.h piscdrawwdg.h pisysdep.h pibwdgx.h \ 222 $(EROSDEVREP)/Include/cvector.h 223 $(OBJ)piscdrawwdg.o: piscdrawwdg.cc piscdrawwdg.h pisysdep.h pibwdgx.h \ 211 224 pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h picmap.h picmapx.h \ 212 picmapgen.h pigraphx.h pigraphgen.h pigraphuc.h psfile.h pigraphps.h \ 213 pistdwdgx.h pistdwdggen.h piwindowx.h piwindowgen.h picontainerx.h \ 214 picontainergen.h pidrawer.h 225 picmapgen.h pigraphx.h pigraphgen.h pigraphuc.h psfile.h \ 226 $(EROSDEVREP)/Include/defs.h pigraphps.h pistdwdgx.h pistdwdggen.h \ 227 piwindowx.h piwindowgen.h picontainerx.h picontainergen.h pidrawer.h \ 228 pidrwtools.h pioptmenux.h pioptmenugen.h pimenux.h pimenugen.h \ 229 piapplx.h piapplgen.h pimenubarx.h pimenubargen.h picons.h 215 230 $(OBJ)pistdwdggen.o: pistdwdggen.cc pistdwdggen.h pisysdep.h piwdgx.h \ 216 231 piwdggen.h pimsghandler.h -
trunk/SophyaPI/PI/parradapter.h
r113 r119 3 3 // LAL (Orsay) / IN2P3-CNRS DAPNIA/SPP (Saclay) / CEA 4 4 5 // Cette classe est un adaptateur pour les PIImages et6 // autres classes de PI qui operent sur des structures7 // de type Tableaux 2-D (images, ...)8 5 9 6 #ifndef PARRADAPTER_SEEN … … 14 11 #include "lut.h" 15 12 16 class LUT; 13 class P1DArrayAdapter { 14 public : 15 P1DArrayAdapter(int sz=0) {mSize=sz; } 16 ~P1DArrayAdapter(); 17 18 virtual float Value(int i) = 0; 19 inline int Size() { return (mSize) ; } 20 21 protected : 22 int mSize; 23 }; 24 25 // Cette classe est un adaptateur pour les PIImages et 26 // autres classes de PI qui operent sur des structures 27 // de type Tableaux 2-D (images, ...) 28 17 29 class P2DArrayAdapter { 18 30 public : … … 66 78 }; 67 79 80 template <class T> 81 class P1DAdapter : public P1DArrayAdapter { 82 public : 83 P1DAdapter(T* data, int sz, bool ad=false) : 84 P1DArrayAdapter(sz) 85 { aDel = ad; mData = data; } 86 87 virtual ~P1DAdapter() { if ( (aDel) && (mData != NULL) ) delete[] mData; } 88 virtual float Value(int i) 89 { if ( (i < 0) || (i >= mSize) ) return(0.); 90 return(mData[i]); } 91 protected : 92 bool aDel; 93 T* mData; 94 }; 95 68 96 69 97 template <class T> -
trunk/SophyaPI/PI/pi3ddrw.cc
r116 r119 8 8 9 9 #include "pi3ddrw.h" 10 #include "pidrwtools.h" 10 11 11 12 … … 238 239 DrawXYZAxes(); 239 240 Send(Msg(), PIMsg_Active); 241 PIDrwTools::SetCurrentBaseWdg(this); 240 242 } 241 243 … … 296 298 DrawXYZAxes(); 297 299 Send(Msg(), PIMsg_Active); 300 PIDrwTools::SetCurrentBaseWdg(this); 298 301 } 299 302 … … 370 373 { 371 374 Send(Msg(), PIMsg_Active); 375 PIDrwTools::SetCurrentBaseWdg(this); 372 376 if ( (x > 50) || ( y > 50) ) return; 373 377 list<int>::iterator it = m3DrIl.begin(); -
trunk/SophyaPI/PI/pibwdggen.cc
r118 r119 4 4 #include "pidrawer.h" 5 5 #include "pigraphps.h" 6 #include "pidrwtools.h" 6 7 7 8 // Les methodes de la classe PIBWdgGen … … 25 26 delete mWGrC; 26 27 DeleteDrawers(); 28 if (PIDrwTools::GetCurrentBaseWdg() == this) 29 PIDrwTools::SetCurrentBaseWdg(NULL); 27 30 } 28 31 -
trunk/SophyaPI/PI/pidrwtools.cc
r112 r119 4 4 5 5 #include <stdlib.h> 6 6 7 #include "pidrwtools.h" 7 8 #include "piscdrawwdg.h" 8 9 9 10 10 /* --Methode-- */ 11 PIDrwMenu::PIDrwMenu(PIApplication* par) 12 : PIMenu(par->Menubar(), "DrawerTools") 13 { 14 pdm[0] = new PIMenu(this, "Color"); 15 pdm[0]->AppendItem("White", 303); 16 AppendPDMenu(pdm[0]); 17 } 18 19 /* --Methode-- */ 20 PIDrwMenu::~PIDrwMenu() 21 { 22 int i; 23 for(i=0; i<1; i++) delete pdm[i]; 24 } 25 26 /* --Methode-- */ 27 void PIDrwMenu::Process(PIMessage msg, PIMsgHandler* /*sender*/, void* data) 28 { 11 PIDrwTools* PIDrwTools::cwdrwt = NULL; 12 PIBaseWdgGen* PIDrwTools::mCurBW = NULL; 13 14 /* --Methode-- */ 15 void PIDrwTools::ShowPIDrwTools() 16 { 17 if (cwdrwt == NULL) cwdrwt = new PIDrwTools(PIApplicationGetApp()); 18 cwdrwt->Show(); 19 } 20 21 /* --Methode-- */ 22 void PIDrwTools::SetCurrentBaseWdg(PIBaseWdgGen* cbw) 23 { 24 mCurBW = cbw; 25 if (cwdrwt) { 26 cwdrwt->mNlb->SetLabel("0"); 27 cwdrwt->mNDr = 0; 28 } 29 } 30 /* --Methode-- */ 31 PIBaseWdgGen* PIDrwTools::GetCurrentBaseWdg() 32 { 33 return(mCurBW); 34 } 35 36 /* --Methode-- */ 37 PIDrwTools::PIDrwTools(PIApplication* par) 38 : PIWindow((PIMsgHandler*)par, "PIDrawerTools", PIWK_dialog, 240, 240, 150, 150) 39 { 40 int bsx, bsy, spx, spy; 41 42 // On definit la taille a partir de la taille par defaut des composantes 43 // PIApplicationPrefCompSize(bsx, bsy); 44 par->PrefCompSz(bsx, bsy); 45 spx = bsx/10; 46 spy = bsy/4; 47 48 int wszx = 5*spx+3.5*bsx; 49 int wszy = (6+3*0.85)*(spy+bsy); 50 SetSize(wszx, wszy); 51 52 int cpx = spx*2; 53 int cpy = spy*2; 54 int csx = cpx; 55 int csy = cpy; 56 mLab[0] = new PILabel(this, "X Min Max", 1.5*bsx, bsy, cpx, cpy); 57 cpy += spy+bsy; 58 mLab[1] = new PILabel(this, "Y Min Max", 1.5*bsx, bsy, cpx, cpy); 59 mLab[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 60 mLab[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 61 62 cpy = spy*2; 63 cpx += spx+1.5*bsx; 64 mText[0] = new PIText(this, "x_min_max", 2.0*bsx, bsy, cpx, cpy); 65 mText[0]->SetText("-1.0 1.0"); 66 cpy += spy+bsy; 67 mText[1] = new PIText(this, "y_min_max", 2.0*bsx, bsy, cpx, cpy); 68 mText[1]->SetText("-1.0 1.0"); 69 mText[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 70 mText[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 71 72 cpx = 2*spx; 73 cpy += spy+bsy; 74 mCkb[0] = new PICheckBox(this,"AxeX-RtoL", 2000, 1.5*bsx, bsy, cpx, cpy); 75 cpx += spx+1.5*bsx; 76 mCkb[1] = new PICheckBox(this,"AxeY-UpDown", 2000, 1.5*bsx, bsy, cpx, cpy); 77 mCkb[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 78 mCkb[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 79 80 cpy += spy+bsy; 81 cpx = 4*spx;; 82 mBut[0] = new PIButton(this, "Apply", 2500, bsx*1.5, bsy, cpx, cpy); 83 cpx += bsx*1.5+2*spx; 84 mBut[1] = new PIButton(this, "Dismiss", 2600, bsx*1.5, bsy, cpx, cpy); 85 mBut[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 86 mBut[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 87 88 int offy = cpy+bsy+spy*2; 89 90 // Option-Menu Marker, Line, couleur, etc... 91 cpx = 2*spx; 92 cpy += 3*spy+bsy; 93 94 int bsyo = bsy; 95 int spyo = spy; 96 bsy = 0.85*bsy; spy = 0.85*spy; 97 98 mOpt[0] = new PIOptMenu(this, "bwt-opt-0", bsx*1.75, bsy, cpx, cpy); 99 mOpt[0]->AppendItem("Black", 101); 100 mOpt[0]->AppendItem("White", 102); 101 mOpt[0]->AppendItem("Grey", 103); 102 mOpt[0]->AppendItem("Red", 104); 103 mOpt[0]->AppendItem("Blue", 105); 104 mOpt[0]->AppendItem("Green", 106); 105 mOpt[0]->AppendItem("Yellow", 107); 106 mOpt[0]->AppendItem("Magenta", 108); 107 mOpt[0]->SetValue(101); 108 mOpt[0]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 109 110 cpx += spx+1.75*bsx; 111 mOpt[1] = new PIOptMenu(this, "bwt-opt-1", bsx*1.75, bsy, cpx, cpy); 112 mOpt[1]->AppendItem("NoColor", 200); 113 mOpt[1]->AppendItem("Grey32", 201); 114 mOpt[1]->AppendItem("GreyInv32", 202); 115 mOpt[1]->AppendItem("ColRJ32", 203); 116 mOpt[1]->AppendItem("ColBR32", 204); 117 mOpt[1]->AppendItem("ColRV32", 205); 118 mOpt[1]->AppendItem("Grey128", 206); 119 mOpt[1]->AppendItem("GreyInv128", 207); 120 mOpt[1]->AppendItem("ColRJ128", 208); 121 mOpt[1]->AppendItem("ColBR128", 209); 122 mOpt[1]->AppendItem("Col16", 210); 123 mOpt[1]->SetValue(200); 124 mOpt[1]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 125 126 127 cpx = 2*spx; 128 cpy += spy+bsy; 129 mOpt[2] = new PIOptMenu(this, "bwt-opt-2", bsx*1.75, bsy, cpx, cpy); 130 mOpt[2]->AppendItem("Undef-Mrk", 300); 131 mOpt[2]->AppendItem("Mrk Dot(.)", 301); 132 mOpt[2]->AppendItem("Mrk Plus(+)", 302); 133 mOpt[2]->AppendItem("Mrk Cross(x)", 303); 134 mOpt[2]->AppendItem("Mrk Circle", 304); 135 mOpt[2]->AppendItem("Mrk FCircle", 305); 136 mOpt[2]->AppendItem("Mrk Box", 306); 137 mOpt[2]->AppendItem("Mrk FBox", 307); 138 mOpt[2]->AppendItem("Mrk Triangle", 308); 139 mOpt[2]->AppendItem("Mrk FTriangle", 309); 140 mOpt[2]->AppendItem("Mrk Star", 310); 141 mOpt[2]->AppendItem("Mrk FStar", 311); 142 mOpt[2]->SetValue(301); 143 mOpt[2]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 144 145 cpx += spx+1.75*bsx; 146 mOpt[3] = new PIOptMenu(this, "bwt-opt-3", bsx*1.75, bsy, cpx, cpy); 147 mOpt[3]->AppendItem("Mrk 3 pt", 403); 148 mOpt[3]->AppendItem("Mrk 5 pt", 405); 149 mOpt[3]->AppendItem("Mrk 7 pt", 407); 150 mOpt[3]->AppendItem("Mrk 9 pt", 409); 151 mOpt[3]->AppendItem("Mrk 11 pt", 411); 152 mOpt[3]->AppendItem("Mrk 13 pt", 413); 153 mOpt[3]->AppendItem("Mrk 15 pt", 415); 154 mOpt[3]->SetValue(405); 155 mOpt[3]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 156 157 cpx = 2*spx; 158 cpy += spy+bsy; 159 mOpt[4] = new PIOptMenu(this, "bwt-opt-4", bsx*1.75, bsy, cpx, cpy); 160 mOpt[4]->AppendItem("Normal-Font", 500); 161 mOpt[4]->AppendItem("Bold-Font", 501); 162 mOpt[4]->AppendItem("Ital-Font", 502); 163 mOpt[4]->AppendItem("Small-Font", 510); 164 mOpt[4]->AppendItem("Small-Bold-Font", 511); 165 mOpt[4]->AppendItem("Small-Ital-Font", 512); 166 mOpt[4]->AppendItem("Big-Font", 521); 167 mOpt[4]->AppendItem("Big-Bold-Font", 522); 168 mOpt[4]->AppendItem("Big-Ital-Font", 523); 169 mOpt[4]->SetValue(500); 170 mOpt[4]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 171 172 cpx += spx+1.75*bsx; 173 mOpt[5] = new PIOptMenu(this, "bwt-opt-5", bsx*1.75, bsy, cpx, cpy); 174 mOpt[5]->AppendItem("Undef-Line", 600); 175 mOpt[5]->AppendItem("Thin-Line", 601); 176 mOpt[5]->AppendItem("Normal-Line", 602); 177 mOpt[5]->AppendItem("Thick-Line", 603); 178 mOpt[5]->SetValue(601); 179 mOpt[5]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 180 181 cpx = 2*spx; 182 cpy += spy+bsyo; 183 bsy = bsyo; spy = spyo; 184 mButdr[0] = new PIButton(this, "Dr-", 3501, bsy, bsy, cpx, cpy, PIBtn_ArrowLeft); 185 cpx += bsy+0.25*spy; 186 mNlb = new PILabel(this,"NumDr", bsy, bsy, cpx, cpy); 187 mNlb->SetLabel("0"); 188 mNDr = 0; 189 cpx += bsy+0.25*spy; 190 mButdr[1] = new PIButton(this, "Dr+", 3502, bsy, bsy, cpx, cpy, PIBtn_ArrowRight); 191 mButdr[0]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 192 mButdr[1]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 193 mNlb->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 194 195 cpx += bsy+3*spx; 196 mButcf[0] = new PIButton(this, "SetAtt", 2800, bsx*0.85, bsy, cpx, cpy); 197 cpx += 0.85*bsx+spx; 198 mButcf[1] = new PIButton(this, "Refresh", 2900, bsx*0.85, bsy, cpx, cpy); 199 mButcf[0]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 200 mButcf[1]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 201 202 cwdrwt = this; 203 204 } 205 206 /* --Methode-- */ 207 PIDrwTools::~PIDrwTools() 208 { 209 if (cwdrwt == this) cwdrwt = NULL; 210 for(int i=0; i<2; i++) 211 { 212 delete mLab[i]; 213 delete mBut[i]; 214 delete mText[i]; 215 delete mButdr[i]; 216 delete mButcf[i]; 217 } 218 for(int i=0; i<6; i++) delete mOpt[i]; 219 delete mNlb; 220 } 221 222 /* --Methode-- */ 223 void PIDrwTools::Show() 224 { 225 PIWindow::Show(); 226 char buff[92]; 227 mNDr = 0; 228 if ((mCurBW != NULL) && ( mCurBW->kind() == PIScDrawWdg::ClassId ) ) { 229 PIScDrawWdg* scd = ( PIScDrawWdg*)mCurBW; 230 sprintf(buff, "%g %g", scd->XMin(), scd->XMax()); 231 mText[0]->SetText(buff); 232 sprintf(buff, "%g %g", scd->YMin(), scd->YMax()); 233 mText[1]->SetText(buff); 234 if (scd->NbDrawers() > 1) mNDr = 1; 235 } 236 else { 237 mText[0]->SetText("-1.0 1.0"); 238 mText[1]->SetText("-1.0 1.0"); 239 } 240 sprintf(buff, "%d", mNDr); 241 mNlb->SetLabel(buff); 242 243 mCkb[0]->SetState(false); 244 mCkb[1]->SetState(false); 245 246 mOpt[0]->SetValue(101); 247 mOpt[1]->SetValue(200); 248 mOpt[2]->SetValue(301); 249 mOpt[3]->SetValue(405); 250 mOpt[4]->SetValue(500); 251 mOpt[5]->SetValue(601); 252 29 253 return; 30 254 } 255 256 257 /* --Methode-- */ 258 void PIDrwTools::Process(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/) 259 { 260 PIColors cols[9] = { PI_NotDefColor, PI_Black, PI_White, 261 PI_Grey, PI_Red, PI_Blue, 262 PI_Green, PI_Yellow, PI_Magenta}; 263 264 PIMarker mrk[11] = { PI_DotMarker, PI_PlusMarker, PI_CrossMarker, 265 PI_CircleMarker, PI_FCircleMarker, 266 PI_BoxMarker, PI_FBoxMarker, 267 PI_TriangleMarker, PI_FTriangleMarker, 268 PI_StarMarker, PI_FStarMarker }; 269 PILineAtt line[4] = { PI_NotDefLineAtt, PI_ThinLine, PI_NormalLine, PI_ThickLine}; 270 271 PIFontAtt fntatt[3] = { PI_RomanFont, PI_BoldFont, PI_ItalicFont }; 272 PIFontSize fntsz[3] = { PI_NormalSizeFont, PI_SmallSizeFont, PI_BigSizeFont }; 273 CMapId cmap[11] = { CMAP_OTHER, CMAP_GREY32, CMAP_GREYINV32, 274 CMAP_COLRJ32, CMAP_COLBR32, CMAP_COLRV32, 275 CMAP_GREY128, CMAP_GREYINV128, CMAP_COLRJ128, CMAP_COLBR128, CMAP_COL16 }; 276 277 msg = UserMsg(msg); 278 if (msg == 2600) { Hide(); return; } 279 280 if (mCurBW == NULL) return; 281 282 char strg[64]; 283 float xmin, xmax, ymin, ymax; 284 int axrl = kAxeDirLtoR; 285 int ayud = kAxeDirDownUp; 286 int k, kk; 287 288 switch (msg) { 289 290 case 2500 : 291 sscanf(mText[0]->GetText().c_str(), "%g %g" , &xmin, &xmax); 292 sscanf(mText[1]->GetText().c_str(), "%g %g" , &ymin, &ymax); 293 if (mCkb[0]->GetState()) axrl = kAxeDirRtoL ; 294 if (mCkb[1]->GetState()) ayud = kAxeDirUpDown; 295 printf("--DBG-- %g-%g , %g-%g , %d %d \n", xmin, xmax, ymin, ymax, axrl, ayud); 296 if ( mCurBW->kind() == PIScDrawWdg::ClassId ) ((PIScDrawWdg*)mCurBW)-> SetLimits(xmin, xmax, ymin, ymax, axrl, ayud); 297 else mCurBW->SetDefaultDrawerLimits(xmin, xmax, ymin, ymax, axrl, ayud); 298 mCurBW->Refresh(); 299 break; 300 301 case 2800 : 302 case 2900 : 303 { 304 PIDrawer* drw = mCurBW->GetDrawer(mNDr); 305 if (drw == NULL) return; 306 k = mOpt[0]->GetValue()-100; 307 if ( (k < 0) || (k > 8) ) k = 0; 308 drw->SetColAtt(cols[k]); 309 k = mOpt[1]->GetValue()-200; 310 if ( (k < 0) || (k > 10) ) k = 0; 311 drw->SetColMapId(cmap[k]); 312 k = mOpt[2]->GetValue()-300; 313 if ( (k < 0) || (k > 10) ) k = 0; 314 kk = mOpt[3]->GetValue()-400; 315 if ( (kk < 1) || (kk > 27) ) kk = 1; 316 drw->SetMarkerAtt(kk, mrk[k]); 317 k = ((mOpt[4]->GetValue()-500)/10)%3; 318 kk = (mOpt[4]->GetValue()-500-10*k)%3; 319 drw->SetFontAtt(fntsz[k], fntatt[kk]); 320 k = mOpt[5]->GetValue()-600; 321 if ( (k < 0) || (k > 3) ) k = 0; 322 drw->SetLineAtt(line[k]); 323 if (msg == 2800) drw->Refresh(); 324 else mCurBW->Refresh(); 325 } 326 break; 327 328 case 3501 : 329 mNDr--; 330 if (mNDr < 0) mNDr = 0; 331 sprintf(strg, "%d", mNDr); 332 mNlb->SetLabel(strg); 333 break; 334 case 3502 : 335 mNDr++; 336 if (mNDr >= mCurBW->NbDrawers()) mNDr--; 337 sprintf(strg, "%d", mNDr); 338 mNlb->SetLabel(strg); 339 break; 340 341 default : 342 break; 343 } 344 345 return; 346 } 347 -
trunk/SophyaPI/PI/pidrwtools.h
r112 r119 7 7 8 8 #include "pisysdep.h" 9 #include PIMENU_H 9 #include PISTDWDG_H 10 #include PIOPTMENU_H 11 #include PIWIN_H 10 12 #include PIAPP_H 13 #include "pibwdggen.h" 11 14 12 class PIDrwMenu : public PIMenu 15 // --------- fenetre de dialogue pour modifs axes et options des Drawers ---------- 16 // -------------------------------------------------------------------------------- 17 18 19 class PIDrwTools : public PIWindow 13 20 { 14 21 public : 15 PIDrwMenu(PIApplication* app); 16 virtual ~PIDrwMenu(); 22 PIDrwTools(PIApplication* par); 23 ~PIDrwTools(); 24 virtual void Show(); 25 26 static PIDrwTools* curlutw; 27 static void ShowPIDrwTools(); 28 static void SetCurrentBaseWdg(PIBaseWdgGen* cbw); 29 static PIBaseWdgGen* GetCurrentBaseWdg(); 30 17 31 protected: 18 virtual void Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL); 19 PIMenu* pdm[2]; 32 virtual void Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL); 33 34 private: 35 // Pour changer les axes 36 PILabel* mLab[2]; 37 PIButton* mBut[2]; 38 PIText* mText[2]; 39 PICheckBox* mCkb[2]; 40 // Pour couleur, fontes, etc 41 PIOptMenu* mOpt[6]; 42 PILabel* mNlb; 43 PIButton* mButdr[2]; 44 PIButton* mButcf[2]; 45 int mNDr; 46 int mtyp, msz; 47 // 48 static PIBaseWdgGen* mCurBW; 49 static PIDrwTools* cwdrwt; 20 50 }; 21 51 -
trunk/SophyaPI/PI/piimage.cc
r117 r119 12 12 #include "piimage.h" 13 13 #include "piimgtools.h" 14 #include "pidrwtools.h" 14 15 15 16 // -------------------------------------------------------------------------------- … … 338 339 Send(Msg(), PIMsg_Active); 339 340 cur_piimage = this; 341 PIDrwTools::SetCurrentBaseWdg(this); 340 342 } 341 343 if (zow != NULL) ComputeZoomPixmap(); … … 386 388 void PIImage::Keyboard(int key, PIKeyModifier kmod) 387 389 { 390 cur_piimage = this; 388 391 if (kmod == PIKM_Alt) { 389 392 if (key == 'V' || key == 'v') RequestSelection(); // Pour coller (copier/coller) 390 393 if (key == 'Z' || key == 'z') { mdrw->ElDelAll(); Refresh(); } // Pour supprimer tous les signes 391 if (key == 'O' || key == 'o') PIImg LutWind::ShowPIImgLutWind(); // Fentre LUT et options394 if (key == 'O' || key == 'o') PIImgTools::ShowPIImgTools(); // Fentre LUT et options 392 395 } 393 396 … … 421 424 Send(Msg(), PIMsg_Active); 422 425 cur_piimage = this; 426 PIDrwTools::SetCurrentBaseWdg(this); 423 427 if (img == NULL) return; 424 428 if ( PosW2Img(x, y, &xp, &yp) ) return; … … 460 464 Send(Msg(), PIMsg_Active); 461 465 cur_piimage = this; 466 PIDrwTools::SetCurrentBaseWdg(this); 462 467 if (img == NULL) return; 463 468 if ( PosW2Img(x, y, &xpv0, &ypv0) ) { xmv0 = -1; return; } … … 527 532 Send(Msg(), PIMsg_Active); 528 533 cur_piimage = this; 534 PIDrwTools::SetCurrentBaseWdg(this); 529 535 if (img == NULL) return; 530 536 if ( PosW2Img(x, y, &xp, &yp) ) { xmv0 = -1; return; } … … 583 589 { 584 590 if (typ != PICP_string) return; 585 int ll = (l< 128) ? l+1 : 128;586 char pc[ 128];591 int ll = (l<256) ? l+1 : 256; 592 char pc[256]; 587 593 strncpy(pc, (char*)pdata, ll-1); pc[ll-1] = '\0'; 588 594 float fx, fy; -
trunk/SophyaPI/PI/piimgtools.cc
r118 r119 6 6 7 7 #include "piimgtools.h" 8 #include PISTDWDG_H9 #include PIOPTMENU_H10 8 #include "piimage.h" 11 9 12 10 // ------ Menu des options et fenetre de dialogue pour changement de LUT -------- 13 11 14 PIImg LutWind* PIImgLutWind::curlutw = NULL;15 /* --Methode-- */ 16 void PIImg LutWind::ShowPIImgLutWind()17 { 18 if (curlutw == NULL) curlutw = new PIImg LutWind(PIApplicationGetApp());12 PIImgTools* PIImgTools::curlutw = NULL; 13 /* --Methode-- */ 14 void PIImgTools::ShowPIImgTools() 15 { 16 if (curlutw == NULL) curlutw = new PIImgTools(PIApplicationGetApp()); 19 17 curlutw->Show(); 20 18 } 21 19 22 20 /* --Methode-- */ 23 PIImg LutWind::PIImgLutWind(PIApplication* par)21 PIImgTools::PIImgTools(PIApplication* par) 24 22 : PIWindow((PIMsgHandler*)par, "PIImageTools", PIWK_dialog, 240, 240, 150, 150) 25 23 { … … 91 89 92 90 int offy = cpy+bsy+spy*2; 93 // printf("-DBG- PIImg LutWind() SzX,Y= %d %d , ButPos= %d %d (off=%d)\n", wszx, wszy, cpx, cpy, offy);91 // printf("-DBG- PIImgTools() SzX,Y= %d %d , ButPos= %d %d (off=%d)\n", wszx, wszy, cpx, cpy, offy); 94 92 95 93 cpx = 4*spx+2.75*bsx; … … 198 196 199 197 /* --Methode-- */ 200 PIImg LutWind::~PIImgLutWind()198 PIImgTools::~PIImgTools() 201 199 { 202 200 if (curlutw == this) curlutw = NULL; … … 218 216 219 217 /* --Methode-- */ 220 void PIImg LutWind::Show()218 void PIImgTools::Show() 221 219 { 222 220 char buff[32]; … … 245 243 246 244 /* --Methode-- */ 247 void PIImg LutWind::Process(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/)245 void PIImgTools::Process(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/) 248 246 { 249 247 float min, max, del; … … 357 355 358 356 default: 359 // printf("PIImg LutWind::Process Msg %d received \n", (int)msg);357 // printf("PIImgTools::Process Msg %d received \n", (int)msg); 360 358 break; 361 359 } -
trunk/SophyaPI/PI/piimgtools.h
r118 r119 15 15 // -------------------------------------------------------------------------------- 16 16 17 class PIImg LutWind: public PIWindow {17 class PIImgTools : public PIWindow { 18 18 public : 19 PIImg LutWind(PIApplication* par);20 ~PIImg LutWind();19 PIImgTools(PIApplication* par); 20 ~PIImgTools(); 21 21 virtual void Show(); 22 22 23 static PIImg LutWind* curlutw;24 static void ShowPIImg LutWind();23 static PIImgTools* curlutw; 24 static void ShowPIImgTools(); 25 25 protected: 26 26 virtual void Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL); -
trunk/SophyaPI/PI/pintuple.h
r107 r119 3 3 4 4 #include "ntuple.h" 5 #include "pi scdrawwdg.h"5 #include "pidrawer.h" 6 6 7 7 class PINTuple : public PIDrawer { -
trunk/SophyaPI/PI/piscdrawwdg.cc
r113 r119 1 #include "generalfit.h"2 1 #include "piscdrawwdg.h" 2 #include "pidrwtools.h" 3 3 4 4 PIScDrawWdg::PIScDrawWdg(PIContainerGen *par, char *nom, … … 17 17 mTrW = NULL; 18 18 SetTextWin(NULL); 19 20 ActivateKeyboard(); 19 21 ActivateButton(1); // Pour pouvoir activer la fenetre et coordonnees 20 22 ActivateMove(1); // " " " " … … 30 32 } 31 33 34 void 35 PIScDrawWdg::Keyboard(int key, PIKeyModifier kmod) 36 { 37 if (kmod == PIKM_Alt) { 38 if (key == 'V' || key == 'v') RequestSelection(); // Pour coller (copier/coller) 39 if (key == 'Z' || key == 'z') { mBDrw->ElDelAll(); Refresh(); } // Pour supprimer tous les signes 40 if (key == 'O' || key == 'o') { 41 PIDrwTools::SetCurrentBaseWdg(this); 42 PIDrwTools::ShowPIDrwTools(); // Fentre axes et 43 } 44 } 45 } 46 void 47 PIScDrawWdg::PasteSelection(unsigned int typ, void *pdata, unsigned int l) 48 { 49 if (typ != PICP_string) return; 50 int ll = (l<256) ? l+1 : 256; 51 char pc[256]; 52 strncpy(pc, (char*)pdata, ll-1); pc[ll-1] = '\0'; 53 mBDrw->ElAddText(mPPos[0], mPPos[1], pc ); 54 mBDrw->Refresh(); 55 } 32 56 33 57 void … … 38 62 return; // $CHECK$ exception ? 39 63 SetDefaultDrawerLimits(xmin, xmax, ymin, ymax, axrl, ayud); 64 mBDrw->SetLimits(xmin, xmax, ymin, ymax, axrl, ayud); 40 65 mPPos[0] = 0.5*(XMin()+XMax()); 41 66 mPPos[1] = 0.5*(YMin()+YMax()); … … 83 108 84 109 85 /*86 void87 PIScDrawWdg::Draw(PIGraphic* g)88 {89 EraseWindow();90 if (! LimitsFixed() ) { // On met a jour les limites a partir du premier Drawer91 PIDrawer* drw = GetDrawer(1);92 if (drw != NULL) {93 drw->UpdateSize();94 SetLimits(drw->XMin(), drw->XMax(), drw->YMin(), drw->YMax());95 }96 else SetLimits(0., 1., 0., 1.);97 }98 }99 100 void101 PIScDrawWdg::Draw(PIGraphic* g, int x0, int y0, int dx, int dy)102 {103 // EraseWindow();104 if (! LimitsFixed() ) { // On met a jour les limites a partir du premier Drawer105 PIDrawer* drw = GetDrawer(1);106 if (drw != NULL) {107 drw->UpdateSize();108 SetLimits(drw->XMin(), drw->XMax(), drw->YMin(), drw->YMax());109 }110 else SetLimits(0., 1., 0., 1.);111 }112 }113 */114 110 115 111 // Gestion affichage coordonnees du point … … 140 136 } 141 137 Send(Msg(), PIMsg_Active); 142 138 PIDrwTools::SetCurrentBaseWdg(this); 143 139 } 144 140 … … 191 187 mWGrC->SelLine(PI_ThinLine); 192 188 Send(Msg(), PIMsg_Active); 189 PIDrwTools::SetCurrentBaseWdg(this); 193 190 } 194 191 … … 228 225 229 226 230 //================================================================231 // PIFuncDrawer232 //================================================================233 234 PIFuncDrawer::PIFuncDrawer(PIFuncDrawer::FUNC f)235 : mFunc(f)236 {}237 238 PIFuncDrawer::~PIFuncDrawer()239 {240 }241 242 void243 PIFuncDrawer::Draw(PIGraphicUC* g, float /*xmin*/, float/*ymin*/, float/*xmax*/, float/*ymax*/)244 {245 PIGrCoord x1, x2, y1, y2;246 g->GetGrSpace(x1, x2, y1, y2);247 float xMax = x2;248 float xMin = x1;249 float yMax = y2;250 float yMin = y1;251 float xStep = (xMax - xMin)/100;252 float xOld = xMin;253 float yOld = mFunc(xMin);254 for (float x = xMin+xStep; x<xMax; x+=xStep) {255 double y = mFunc(x);256 if (y>yMin && yOld>yMin &&257 y<yMax && yOld<yMax)258 g->DrawLine(xOld, yOld, x, y);259 xOld = x;260 yOld = y;261 }262 }263 264 //================================================================265 // PIGFFDrawer266 //================================================================267 268 PIGFFDrawer::PIGFFDrawer(GeneralFunction* f)269 : mFunc(f), mNParms(f->NPar()), mParms(new double[mNParms])270 {271 ASSERT(f->NVar() == 1);272 }273 274 PIGFFDrawer::~PIGFFDrawer()275 {276 delete[] mParms;277 }278 279 void280 PIGFFDrawer::SetParms(double const* p)281 {282 for (int i=0; i<mNParms; i++)283 mParms[i] = p[i];284 }285 286 287 void288 PIGFFDrawer::Draw(PIGraphicUC* g, float /*xmin*/, float/*ymin*/, float/*xmax*/, float/*ymax*/)289 {290 PIGrCoord x1, x2, y1, y2;291 g->GetGrSpace(x1, x2, y1, y2);292 float xMax = x2;293 float xMin = x1;294 float yMax = y2;295 float yMin = y1;296 float xStep = (xMax - xMin)/100;297 float xOld = xMin;298 float yOld = 0;299 // float yOld = f->Value(&xMin, mParms);300 for (float x = xMin+xStep; x<xMax; x+=xStep) {301 float y = 0; // $CHECK$302 // float y = f->Value(&x, mParms);303 if (y>yMin && yOld>yMin &&304 y<yMax && yOld<yMax)305 g->DrawLine(xOld, yOld, x, y);306 xOld = x;307 yOld = y;308 }309 }310 -
trunk/SophyaPI/PI/piscdrawwdg.h
r113 r119 11 11 12 12 13 14 15 13 class PIScDrawWdg : public PIBaseWdg { 16 14 public: … … 23 21 virtual long kind() {return ClassId; } 24 22 25 // virtual void Draw(PIGraphic* g);26 // virtual void Draw(PIGraphic* g, int x0, int y0, int dx, int dy);23 virtual void Keyboard(int key, PIKeyModifier kmod); 24 virtual void PasteSelection(unsigned int typ, void *pdata, unsigned int l); 27 25 28 26 void SetLimits(float xmin, float xmax, float ymin, float ymax, … … 78 76 79 77 80 class PIFuncDrawer : public PIDrawer {81 public:82 typedef double(*FUNC)(double);83 PIFuncDrawer(FUNC);84 virtual ~PIFuncDrawer();85 86 virtual void Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax);87 protected:88 FUNC mFunc;89 };90 91 class GeneralFunction;92 class PIGFFDrawer : public PIDrawer {93 public:94 PIGFFDrawer(GeneralFunction*);95 virtual ~PIGFFDrawer();96 97 virtual void Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax);98 virtual void SetParms(double const*);99 protected:100 GeneralFunction* mFunc;101 int mNParms;102 double* mParms;103 };104 105 106 78 #endif -
trunk/SophyaPI/PI/pistlist.cc
r107 r119 4 4 5 5 /* --Methode-- */ 6 PIStarList::PIStarList(StarList* stl, bool ad , int ayud)6 PIStarList::PIStarList(StarList* stl, bool ad) 7 7 : PIDrawer(), mStL(stl) 8 8 { 9 9 mAdDO = ad; 10 mAYdir = ayud;11 10 if (stl == NULL) return; 12 11 SetFluxLimits(1., -1.); 13 SetXYLimits(1., -1., 1., -1.);14 12 } 15 13 … … 20 18 21 19 /* --Methode-- */ 22 void PIStarList::SetFluxLimits(float fmin, float fmax, int nl, int msz0, bool refr)20 void PIStarList::SetFluxLimits(float fmin, float fmax, int nl, bool dispflx, bool refr) 23 21 { 24 22 if (!mStL) return; … … 32 30 if (nl > 20) nl = 20; 33 31 mNLev = nl; 34 if (msz0 < 0) msz0 = 0; 35 if (msz0 > 10) msz0 = 10; 36 mMSz0 = msz0; 32 mDspFV = dispflx; 37 33 if (refr) Refresh(); 38 34 return; 39 35 } 40 41 /* --Methode-- */42 void PIStarList::SetXYLimits(float xmin, float xmax, float ymin, float ymax, bool dfv, bool refr)43 {44 if (!mStL) return;45 if ((xmin < xmax) && (ymin < ymax)) {46 mXMin = xmin; mXMax = xmax; mYMin = ymin; mYMax = ymax;47 }48 else {49 double x1, x2, y1, y2;50 mStL->CalcXYLimits(x1, x2, y1, y2);51 mXMin = (float)x1; mXMax = (float)x2; mYMin = (float)y1; mYMax = (float)y2;52 }53 mDspFV = dfv;54 if (refr) Refresh();55 return;56 }57 36 58 37 … … 64 43 // Commencer par trouver nos limites 65 44 float dx, dy; 45 double x1, x2, y1, y2; 46 mStL->CalcXYLimits(x1, x2, y1, y2); 66 47 67 dx = 0.02*( mXMax-mXMin);68 dy = 0.02*( mYMax-mYMin);48 dx = 0.02*(x2-x1); 49 dy = 0.02*(y2-y1); 69 50 70 SetLimits( mXMin-dx, mXMax+dx, mYMin-dy, mYMax+dy, kAxeDirLtoR, mAYdir);51 SetLimits(x1-dx, x2+dx, y1-dy, y2+dy); 71 52 SetAxesFlags(kBoxAxes | kExtTicks | kLabels); 72 53 } … … 84 65 if (!mStL) return; 85 66 67 int msz = mMSz; 68 if (msz < 1) msz = 1; 69 86 70 g->SelFont(); 87 71 nok = 0; nl2 = mNLev*2-1; … … 92 76 if ( (flx < mFmin) || (flx > mFmax) ) continue; 93 77 xp = sti->PosX(); yp = sti->PosY(); 94 if ( (xp < mXMin) || (xp > mXMax) || (yp < mYMin) || (yp > mYMax) ) continue;95 78 if ( (xp < xmin) || (xp > xmax) || (yp < ymin) || (yp > ymax) ) continue; 96 79 nok++; 97 sz = (int)((log10((double)flx/mF0))/mDLgF*(double)nl2-0.01) + m MSz0;80 sz = (int)((log10((double)flx/mF0))/mDLgF*(double)nl2-0.01) + msz; 98 81 if (sz < 2) g->SelMarker(sz, PI_DotMarker); 99 82 else g->SelMarker(sz, PI_FCircleMarker); -
trunk/SophyaPI/PI/pistlist.h
r107 r119 7 7 class PIStarList : public PIDrawer { 8 8 public: 9 PIStarList(StarList* stl, bool ad , int ayud=kAxeDirUpDown);9 PIStarList(StarList* stl, bool ad); 10 10 virtual ~PIStarList(); 11 11 … … 13 13 virtual void UpdateSize(); 14 14 15 void SetFluxLimits(float min=1., float max=-1., int nl=5, 16 int msz0=0, bool refr=false); 17 void SetXYLimits(float xmin=1., float xmax=-1., float ymin=1., float ymax=-1., 18 bool dfv=false, bool refr=false); 15 void SetFluxLimits(float min=1., float max=-1., int nl=5, bool dispflx=false, bool refr=false); 19 16 20 17 inline StarList* StList() { return(mStL); } 21 inline float XMin() { return(mXMin); }22 inline float XMax() { return(mXMax); }23 inline float YMin() { return(mYMin); }24 inline float YMax() { return(mYMax); }25 18 inline float FluxMin() { return(mFmin); } 26 19 inline float FluxMax() { return(mFmax); } … … 30 23 bool mAdDO; 31 24 float mFmin, mFmax; 32 int mNLev , mMSz0;25 int mNLev; 33 26 double mF0, mDLgF; 34 float mXMin, mXMax;35 float mYMin, mYMax;36 27 bool mDspFV; 37 int mAYdir;38 39 28 }; 40 29
Note:
See TracChangeset
for help on using the changeset viewer.