Changeset 120 in Sophya for trunk/SophyaPI
- Timestamp:
- Jul 15, 1998, 7:08:53 PM (27 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/parradapter.h
r119 r120 14 14 public : 15 15 P1DArrayAdapter(int sz=0) {mSize=sz; } 16 ~P1DArrayAdapter();16 virtual ~P1DArrayAdapter() { }; 17 17 18 18 virtual float Value(int i) = 0; -
trunk/SophyaPI/PI/pi3ddrw.cc
r119 r120 152 152 } 153 153 154 154 155 /* --Methode-- */ 155 156 void PIDraw3DWdg::Update3DView() 157 { 158 list<int>::iterator it = m3DrIl.begin(); 159 if (it == m3DrIl.end()) return; 160 #if defined(__GNUC__) && !defined(GCCV28) 161 PIDrawer3D* dr3 = (PIDrawer3D*)(GetDrawerId(*it)); 162 #else 163 PIDrawer3D* dr3 = dynamic_cast<PIDrawer3D*>(GetDrawerId(*it)); 164 #endif 165 if (dr3 == NULL) return; 166 dr3->UpdateLimits(); 167 float xo, yo, zo, xc, yc, zc, teta, phi, psi, dax, day, co, dco; 168 bool vobs; 169 vobs = dr3->Get3DView(xc, yc, zc, xo, yo, zo, teta, phi, psi, dax, day, co, dco); 170 if (vobs) Set3DView_Obs(xo, yo, zo, teta, phi, psi, dax, day, co, dco); 171 else Set3DView(xc, yc, zc, xo, yo, zo, dax, day, dco, psi); 172 Refresh(); 173 } 174 175 176 /* --Methode-- */ 177 void PIDraw3DWdg::SetDrawers3DView() 156 178 { 157 179 float xc, yc, zc, xo, yo, zo; … … 179 201 { 180 202 if (!vfixed) { 181 dr3->Update Size();203 dr3->UpdateLimits(); 182 204 float xo, yo, zo, xc, yc, zc, teta, phi, psi, dax, day, co, dco; 183 205 bool vobs; … … 269 291 SelPointerShape(PI_ArrowPointer); 270 292 mWGrC->SelForeground(lCol); 271 Update3DView();293 SetDrawers3DView(); 272 294 Refresh(); 273 295 } … … 305 327 { 306 328 DrawXYZAxes(); 307 float rapx = (float)( x-lPx)/XSize();329 float rapx = (float)(lPx-x)/XSize(); 308 330 if (rapx > 0.) rapx = rapx*2.+1; 309 331 else rapx += 1.; … … 332 354 SelPointerShape(PI_ArrowPointer); 333 355 mWGrC->SelForeground(lCol); 334 Update3DView();356 SetDrawers3DView(); 335 357 Refresh(); 336 358 } … … 375 397 PIDrwTools::SetCurrentBaseWdg(this); 376 398 if ( (x > 50) || ( y > 50) ) return; 377 list<int>::iterator it = m3DrIl.begin(); 378 if (it == m3DrIl.end()) return; 379 #if defined(__GNUC__) && !defined(GCCV28) 380 PIDrawer3D* dr3 = (PIDrawer3D*)(GetDrawerId(*it)); 381 #else 382 PIDrawer3D* dr3 = dynamic_cast<PIDrawer3D*>(GetDrawerId(*it)); 383 #endif 384 if (dr3 == NULL) return; 385 dr3->UpdateSize(); 386 float xo, yo, zo, xc, yc, zc, teta, phi, psi, dax, day, co, dco; 387 bool vobs; 388 vobs = dr3->Get3DView(xc, yc, zc, xo, yo, zo, teta, phi, psi, dax, day, co, dco); 389 if (vobs) Set3DView_Obs(xo, yo, zo, teta, phi, psi, dax, day, co, dco); 390 else Set3DView(xc, yc, zc, xo, yo, zo, dax, day, dco, psi); 391 Refresh(); 399 Update3DView(); 392 400 } 393 401 -
trunk/SophyaPI/PI/pi3ddrw.h
r116 r120 57 57 float& teta, float& phi, float& psi, float& dax, float& day, float& co, float& dco); 58 58 59 virtual void Update3DView(); // Vue 3-D a partir de Drawer No 1 60 59 61 int AddDrawer3D(PIDrawer3D*, bool ad=false); // Ajoute un Drawer 60 62 … … 75 77 76 78 protected : 77 virtual void Update3DView();79 virtual void SetDrawers3DView(); 78 80 virtual void DrawXYZAxes(); 79 81 -
trunk/SophyaPI/PI/pibwdggen.h
r113 r120 92 92 PIGrCoord x2, PIGrCoord y2, bool psz=true); 93 93 virtual void RemoveDrawer(int id); // Ote un drawer de la liste 94 virtual void DeleteDrawers(); // Ote et detruit tous les drawers94 virtual void DeleteDrawers(); // Ote tous les drawers, delete des drawers ajoute avec ad=true 95 95 // Acces aux drawers 96 96 virtual int NbDrawers(); -
trunk/SophyaPI/PI/pidrawer.cc
r113 r120 64 64 65 65 void 66 PIDrawer::Update Size()66 PIDrawer::UpdateLimits() 67 67 { 68 68 // Ne fait rien ! … … 82 82 PIDrawer::SetColAtt(PIColors fg, PIColors bg) 83 83 { 84 if (fg != PI_NotDefColor)mFCol = fg;85 if (bg != PI_NotDefColor)mBCol = bg;84 mFCol = fg; 85 mBCol = bg; 86 86 } 87 87 … … 89 89 PIDrawer::SetLineAtt(PILineAtt lat) 90 90 { 91 if (lat != PI_NotDefLineAtt)mLAtt = lat;91 mLAtt = lat; 92 92 } 93 93 … … 95 95 PIDrawer::SetFontAtt(PIFontSize fsz, PIFontAtt fat) 96 96 { 97 if (fsz != PI_NotDefFontSize)mFSz = fsz;98 if (fat != PI_NotDefFontAtt)mFAtt = fat;97 mFSz = fsz; 98 mFAtt = fat; 99 99 } 100 100 … … 102 102 PIDrawer::SetMarkerAtt(int sz, PIMarker mrk) 103 103 { 104 if (sz >= 0)mMSz = sz;105 if (mrk != PI_NotDefMarker)mMrk = mrk;104 mMSz = sz; 105 mMrk = mrk; 106 106 } 107 107 … … 394 394 DrawAxes(g); // Trace des axes 395 395 396 SelGraAtt(g); // DrawAxes change certains attributs graphiques 396 397 DrwElList::iterator it; 397 398 for (it = mElist.begin(); it != mElist.end(); it++) -
trunk/SophyaPI/PI/pidrawer.h
r113 r120 34 34 35 35 virtual void Refresh(); // Recalcule les limites et reaffiche 36 virtual void Update Size(); // Calcule et change les limites si non fixees36 virtual void UpdateLimits(); // Calcule et change les limites 37 37 38 38 float XMin() const {return xMin;} -
trunk/SophyaPI/PI/pidrwtools.cc
r119 r120 7 7 #include "pidrwtools.h" 8 8 #include "piscdrawwdg.h" 9 #include "pi3ddrw.h" 9 10 10 11 … … 70 71 mText[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 71 72 72 cpx = 2*spx ;73 cpx = 2*spx+0.25*bsx; 73 74 cpy += spy+bsy; 74 75 mCkb[0] = new PICheckBox(this,"AxeX-RtoL", 2000, 1.5*bsx, bsy, cpx, cpy); … … 79 80 80 81 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); 82 cpx = 2.5*spx;; 83 mBut[0] = new PIButton(this, "Apply", 2600, bsx, bsy, cpx, cpy); 84 cpx += bsx*1.25; 85 mBut[1] = new PIButton(this, "Auto", 2700, bsx, bsy, cpx, cpy); 86 cpx += bsx*1.25; 87 mBut[2] = new PIButton(this, "Dismiss", 2500, bsx, bsy, cpx, cpy); 85 88 mBut[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 86 89 mBut[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 90 mBut[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 87 91 88 92 int offy = cpy+bsy+spy*2; … … 97 101 98 102 mOpt[0] = new PIOptMenu(this, "bwt-opt-0", bsx*1.75, bsy, cpx, cpy); 103 mOpt[0]->AppendItem("Def.Col", 100); 99 104 mOpt[0]->AppendItem("Black", 101); 100 105 mOpt[0]->AppendItem("White", 102); … … 105 110 mOpt[0]->AppendItem("Yellow", 107); 106 111 mOpt[0]->AppendItem("Magenta", 108); 107 mOpt[0]->SetValue(10 1);112 mOpt[0]->SetValue(100); 108 113 mOpt[0]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 109 114 110 115 cpx += spx+1.75*bsx; 111 116 mOpt[1] = new PIOptMenu(this, "bwt-opt-1", bsx*1.75, bsy, cpx, cpy); 112 mOpt[1]->AppendItem("No Color", 200);117 mOpt[1]->AppendItem("No.CMap", 200); 113 118 mOpt[1]->AppendItem("Grey32", 201); 114 119 mOpt[1]->AppendItem("GreyInv32", 202); … … 128 133 cpy += spy+bsy; 129 134 mOpt[2] = new PIOptMenu(this, "bwt-opt-2", bsx*1.75, bsy, cpx, cpy); 130 mOpt[2]->AppendItem(" Undef-Mrk", 300);135 mOpt[2]->AppendItem("Def.Mrk", 300); 131 136 mOpt[2]->AppendItem("Mrk Dot(.)", 301); 132 137 mOpt[2]->AppendItem("Mrk Plus(+)", 302); … … 140 145 mOpt[2]->AppendItem("Mrk Star", 310); 141 146 mOpt[2]->AppendItem("Mrk FStar", 311); 142 mOpt[2]->SetValue(30 1);147 mOpt[2]->SetValue(300); 143 148 mOpt[2]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 144 149 145 150 cpx += spx+1.75*bsx; 146 151 mOpt[3] = new PIOptMenu(this, "bwt-opt-3", bsx*1.75, bsy, cpx, cpy); 152 mOpt[3]->AppendItem("Mrk 1 pt", 401); 147 153 mOpt[3]->AppendItem("Mrk 3 pt", 403); 148 154 mOpt[3]->AppendItem("Mrk 5 pt", 405); … … 158 164 cpy += spy+bsy; 159 165 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); 166 mOpt[4]->AppendItem("Def.Font", 500); 167 mOpt[4]->AppendItem("Normal-Font", 511); 168 mOpt[4]->AppendItem("Bold", 512); 169 mOpt[4]->AppendItem("Ital", 513); 170 mOpt[4]->AppendItem("Small-Font", 521); 171 mOpt[4]->AppendItem("Small-Bold-Font", 522); 172 mOpt[4]->AppendItem("Small-Ital-Font", 523); 173 mOpt[4]->AppendItem("Big-Font", 531); 174 mOpt[4]->AppendItem("Big-Bold", 532); 175 mOpt[4]->AppendItem("Big-Ital", 533); 169 176 mOpt[4]->SetValue(500); 170 177 mOpt[4]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); … … 172 179 cpx += spx+1.75*bsx; 173 180 mOpt[5] = new PIOptMenu(this, "bwt-opt-5", bsx*1.75, bsy, cpx, cpy); 174 mOpt[5]->AppendItem(" Undef-Line", 600);181 mOpt[5]->AppendItem("Def.Line", 600); 175 182 mOpt[5]->AppendItem("Thin-Line", 601); 176 183 mOpt[5]->AppendItem("Normal-Line", 602); 177 184 mOpt[5]->AppendItem("Thick-Line", 603); 178 mOpt[5]->SetValue(60 1);185 mOpt[5]->SetValue(600); 179 186 mOpt[5]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 180 187 … … 182 189 cpy += spy+bsyo; 183 190 bsy = bsyo; spy = spyo; 184 mButdr[0] = new PIButton(this, " Dr-", 3501, bsy, bsy, cpx, cpy, PIBtn_ArrowLeft);191 mButdr[0] = new PIButton(this, "-", 3501, bsy, bsy, cpx, cpy); 185 192 cpx += bsy+0.25*spy; 186 193 mNlb = new PILabel(this,"NumDr", bsy, bsy, cpx, cpy); … … 188 195 mNDr = 0; 189 196 cpx += bsy+0.25*spy; 190 mButdr[1] = new PIButton(this, " Dr+", 3502, bsy, bsy, cpx, cpy, PIBtn_ArrowRight);197 mButdr[1] = new PIButton(this, "+", 3502, bsy, bsy, cpx, cpy); 191 198 mButdr[0]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 192 199 mButdr[1]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 193 200 mNlb->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 194 201 195 cpx += bsy+3*spx;202 cpx = wszx-1.7*bsx-3*spx; 196 203 mButcf[0] = new PIButton(this, "SetAtt", 2800, bsx*0.85, bsy, cpx, cpy); 197 204 cpx += 0.85*bsx+spx; … … 216 223 delete mButcf[i]; 217 224 } 225 delete mBut[2]; 218 226 for(int i=0; i<6; i++) delete mOpt[i]; 219 227 delete mNlb; … … 244 252 mCkb[1]->SetState(false); 245 253 246 mOpt[0]->SetValue(10 1);254 mOpt[0]->SetValue(100); 247 255 mOpt[1]->SetValue(200); 248 mOpt[2]->SetValue(30 1);256 mOpt[2]->SetValue(300); 249 257 mOpt[3]->SetValue(405); 250 258 mOpt[4]->SetValue(500); 251 mOpt[5]->SetValue(60 1);259 mOpt[5]->SetValue(600); 252 260 253 261 return; … … 262 270 PI_Green, PI_Yellow, PI_Magenta}; 263 271 264 PIMarker mrk[11] = { PI_DotMarker, PI_PlusMarker, PI_CrossMarker, 272 PIMarker mrk[12] = { PI_NotDefMarker, PI_DotMarker, 273 PI_PlusMarker, PI_CrossMarker, 265 274 PI_CircleMarker, PI_FCircleMarker, 266 275 PI_BoxMarker, PI_FBoxMarker, … … 269 278 PILineAtt line[4] = { PI_NotDefLineAtt, PI_ThinLine, PI_NormalLine, PI_ThickLine}; 270 279 271 PIFontAtt fntatt[ 3] = {PI_RomanFont, PI_BoldFont, PI_ItalicFont };272 PIFontSize fntsz[ 3] = {PI_NormalSizeFont, PI_SmallSizeFont, PI_BigSizeFont };280 PIFontAtt fntatt[4] = { PI_NotDefFontAtt, PI_RomanFont, PI_BoldFont, PI_ItalicFont }; 281 PIFontSize fntsz[4] = { PI_NotDefFontSize, PI_NormalSizeFont, PI_SmallSizeFont, PI_BigSizeFont }; 273 282 CMapId cmap[11] = { CMAP_OTHER, CMAP_GREY32, CMAP_GREYINV32, 274 283 CMAP_COLRJ32, CMAP_COLBR32, CMAP_COLRV32, … … 276 285 277 286 msg = UserMsg(msg); 278 if (msg == 2 600) { Hide(); return; }287 if (msg == 2500) { Hide(); return; } 279 288 280 289 if (mCurBW == NULL) return; … … 284 293 int axrl = kAxeDirLtoR; 285 294 int ayud = kAxeDirDownUp; 286 int k, kk ;295 int k, kk, kkk; 287 296 288 297 switch (msg) { 289 298 290 case 2 500 :299 case 2600 : 291 300 sscanf(mText[0]->GetText().c_str(), "%g %g" , &xmin, &xmax); 292 301 sscanf(mText[1]->GetText().c_str(), "%g %g" , &ymin, &ymax); 293 302 if (mCkb[0]->GetState()) axrl = kAxeDirRtoL ; 294 303 if (mCkb[1]->GetState()) ayud = kAxeDirUpDown; 295 printf("--DBG-- %g-%g , %g-%g , %d %d \n", xmin, xmax, ymin, ymax, axrl, ayud);296 304 if ( mCurBW->kind() == PIScDrawWdg::ClassId ) ((PIScDrawWdg*)mCurBW)-> SetLimits(xmin, xmax, ymin, ymax, axrl, ayud); 297 305 else mCurBW->SetDefaultDrawerLimits(xmin, xmax, ymin, ymax, axrl, ayud); 298 306 mCurBW->Refresh(); 307 break; 308 309 case 2700 : 310 if ( mCurBW->kind() == PIScDrawWdg::ClassId ) ((PIScDrawWdg*)mCurBW)->UpdateLimits(); 311 else if ( mCurBW->kind() == PIDraw3DWdg::ClassId) ((PIDraw3DWdg*)mCurBW)->Update3DView(); 299 312 break; 300 313 … … 311 324 drw->SetColMapId(cmap[k]); 312 325 k = mOpt[2]->GetValue()-300; 313 if ( (k < 0) || (k > 1 0) ) k = 0;326 if ( (k < 0) || (k > 11) ) k = 0; 314 327 kk = mOpt[3]->GetValue()-400; 315 328 if ( (kk < 1) || (kk > 27) ) kk = 1; 316 329 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]);330 k = (mOpt[4]->GetValue()-500); 331 kk = k/10; kkk = k%10; 332 drw->SetFontAtt(fntsz[kk], fntatt[kkk]); 320 333 k = mOpt[5]->GetValue()-600; 321 334 if ( (k < 0) || (k > 3) ) k = 0; … … 327 340 328 341 case 3501 : 329 mNDr--; 330 if (mNDr < 0) mNDr = 0; 342 case 3502 : 343 if (msg == 3501) { mNDr--; if (mNDr < 0) mNDr = 0; } 344 else { mNDr++; if (mNDr >= mCurBW->NbDrawers()) mNDr--; } 331 345 sprintf(strg, "%d", mNDr); 332 346 mNlb->SetLabel(strg); 333 break;334 case 3502 :335 m NDr++;336 if (mNDr >= mCurBW->NbDrawers()) mNDr--;337 sprintf(strg, "%d", mNDr);338 m Nlb->SetLabel(strg);347 mOpt[0]->SetValue(100); 348 mOpt[1]->SetValue(200); 349 mOpt[2]->SetValue(300); 350 mOpt[3]->SetValue(405); 351 mOpt[4]->SetValue(500); 352 mOpt[5]->SetValue(600); 339 353 break; 340 354 -
trunk/SophyaPI/PI/pidrwtools.h
r119 r120 35 35 // Pour changer les axes 36 36 PILabel* mLab[2]; 37 PIButton* mBut[ 2];37 PIButton* mBut[3]; 38 38 PIText* mText[2]; 39 39 PICheckBox* mCkb[2]; -
trunk/SophyaPI/PI/pihisto.cc
r107 r120 17 17 18 18 void 19 PIHisto::Update Size()19 PIHisto::UpdateLimits() 20 20 { 21 21 if (!mHisto) return; -
trunk/SophyaPI/PI/pihisto.h
r107 r120 10 10 virtual ~PIHisto(); 11 11 virtual void Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax); 12 virtual void Update Size();12 virtual void UpdateLimits(); 13 13 virtual void DrawStats(PIGraphicUC* g); 14 14 inline Histo* Histogram() { return(mHisto); } -
trunk/SophyaPI/PI/pihisto2d.cc
r112 r120 144 144 145 145 //++ 146 void PIHisto2D::Update Size()146 void PIHisto2D::UpdateLimits() 147 147 // 148 148 // Definition des tailles graphiques en fonction -
trunk/SophyaPI/PI/pihisto2d.h
r110 r120 22 22 void Print(int lp=0); 23 23 virtual void Draw(PIGraphicUC* g,float xmin,float ymin,float xmax,float ymax); 24 virtual void Update Size();24 virtual void UpdateLimits(); 25 25 virtual void DrawStats(PIGraphicUC* g); 26 26 -
trunk/SophyaPI/PI/pintup3d.cc
r115 r120 44 44 45 45 /* --Methode-- */ 46 void PINTuple3D::Update Size()46 void PINTuple3D::UpdateLimits() 47 47 { 48 48 if (!mNT) return; … … 67 67 68 68 Set3DView((xmin+xmax)/2., (ymin+ymax)/2, (zmin+zmax)/2., 69 (xmin+xmax)/2.+D , (ymin+ymax)/2.+2.*D , zmin+(zmax-zmin)*0. 1, 0.3, 0.3);70 // printf("PINTuple3D::Update Size() : %g-%g %g-%g %g-%g (%g) \n", xmin,xmax,ymin,ymax,zmin,zmax,D);71 // printf("PINTuple3D::Update Size() : %g %g %g << %g %g %g \n",69 (xmin+xmax)/2.+D , (ymin+ymax)/2.+2.*D , zmin+(zmax-zmin)*0.2, 0.3, 0.3); 70 // printf("PINTuple3D::UpdateLimits() : %g-%g %g-%g %g-%g (%g) \n", xmin,xmax,ymin,ymax,zmin,zmax,D); 71 // printf("PINTuple3D::UpdateLimits() : %g %g %g << %g %g %g \n", 72 72 // (xmin+xmax)/2., (ymin+ymax)/2, (zmin+zmax)*0.5, 73 73 // (xmin+xmax)/2.+D , (ymin+ymax)/2.+2.*D , zmin+(zmax-zmin)*0.1); -
trunk/SophyaPI/PI/pintup3d.h
r113 r120 11 11 12 12 virtual void Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax); 13 virtual void Update Size();13 virtual void UpdateLimits(); 14 14 15 15 void SelectXYZ(char* px, char* py, char* pz); -
trunk/SophyaPI/PI/pintuple.cc
r107 r120 40 40 41 41 /* --Methode-- */ 42 void PINTuple::Update Size()42 void PINTuple::UpdateLimits() 43 43 { 44 44 if (!mNT) return; -
trunk/SophyaPI/PI/pintuple.h
r119 r120 11 11 12 12 virtual void Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax); 13 virtual void Update Size();13 virtual void UpdateLimits(); 14 14 15 15 void SelectXY(char* px, char* py); -
trunk/SophyaPI/PI/pipixmapx.cc
r111 r120 66 66 if (!g) return; 67 67 if (g->kind() == PI_PSFileGraphics ) { 68 g->DrawPixmap( 0, 0, pixmap, nx, ny, cmap);68 g->DrawPixmap(ofx, ofy, pixmap, nx, ny, cmap); 69 69 /* Il faut faire quelque chose Sinon ??! */ 70 70 } -
trunk/SophyaPI/PI/pipodrw.h
r119 r120 3 3 4 4 #include "pidrawer.h" 5 #include "parradapter.h" 6 #include "cvector.h" 5 7 6 8 class PIFuncDrawer : public PIDrawer { … … 29 31 }; 30 32 33 34 // Adaptateur de vecteurs Peida++ a P1DArrayAdapter 35 class POVectorAdapter : public P1DArrayAdapter { 36 public : 37 POVectorAdapter(Vector* v, bool ad=false) : 38 P1DArrayAdapter(v->NElts()) 39 { aDel = ad; mVec = v; } 40 virtual ~POVectorAdapter() { if (aDel) delete mVec; } 41 virtual float Value(int i) { return((*mVec)(i)); } 42 43 protected: 44 bool aDel; 45 Vector* mVec; 46 47 }; 31 48 #endif -
trunk/SophyaPI/PI/piscdrawwdg.cc
r119 r120 1 // Module PI : Peida Interactive PIScDrawWdg 2 // Gestionnaire Drawer-2D E.Aubourg, R. Ansari 96-98 3 // LAL (Orsay) / IN2P3-CNRS DAPNIA/SPP (Saclay) / CEA 4 1 5 #include "piscdrawwdg.h" 2 6 #include "pidrwtools.h" 7 #include "parradapter.h" 3 8 4 9 PIScDrawWdg::PIScDrawWdg(PIContainerGen *par, char *nom, … … 40 45 if (key == 'O' || key == 'o') { 41 46 PIDrwTools::SetCurrentBaseWdg(this); 42 PIDrwTools::ShowPIDrwTools(); // Fentre axes et 47 PIDrwTools::ShowPIDrwTools(); // Fentre axes et options de trace 43 48 } 44 49 } … … 73 78 } 74 79 80 void 81 PIScDrawWdg::UpdateLimits() 82 { 83 if (NbDrawers() < 2) return; 84 PIDrawer* d = GetDrawer(1); 85 if (d == NULL) return; 86 d->UpdateLimits(); 87 SetLimits(d->XMin(), d->XMax(), d->YMin(), d->YMax()); 88 Refresh(); 89 return; 90 } 75 91 76 92 int … … 79 95 if (d == NULL) return(-1); 80 96 if (! LimitsFixed() ) { // On met a jour les limites 81 d->Update Size();97 d->UpdateLimits(); 82 98 SetLimits(d->XMin(), d->XMax(), d->YMin(), d->YMax()); 83 99 } … … 225 241 226 242 243 // Classe de trace de points/fonctions Y=f(X) 244 245 /* --Methode-- */ 246 PIYfXDrawer::PIYfXDrawer(P1DArrayAdapter* ax, P1DArrayAdapter* ay, bool ad) 247 : PIDrawer() 248 { 249 mAdDO = ad; 250 mAx = ax; 251 mAy = ay; 252 if ((mAx == NULL) || (mAy == NULL)) mSz = 0; 253 else mSz = (mAx->Size() < mAy->Size()) ? mAx->Size() : mAy->Size(); 254 } 255 256 /* --Methode-- */ 257 PIYfXDrawer::~PIYfXDrawer() 258 { 259 if (mAdDO && mAx) delete mAx; 260 if (mAdDO && mAy) delete mAy; 261 } 262 263 /* --Methode-- */ 264 void PIYfXDrawer::UpdateLimits() 265 { 266 if (mSz <= 0) return; 267 float xmin, xmax, ymin, ymax; 268 int i=0; 269 xmin = xmax = mAx->Value(i); 270 ymin = ymax = mAy->Value(i); 271 float cv; 272 for(i=0; i<mSz; i++) { 273 cv = mAx->Value(i); 274 if (cv < xmin) xmin = cv; 275 if (cv > xmax) xmax = cv; 276 cv = mAy->Value(i); 277 if (cv < ymin) ymin = cv; 278 if (cv > ymax) ymax = cv; 279 } 280 float dx, dy; 281 dx = 0.02*(xmax-xmin); 282 dy = 0.02*(ymax-ymin); 283 284 SetLimits(xmin-dx, xmax+dx, ymin-dy, ymax+dy); 285 SetAxesFlags(kBoxAxes | kExtTicks | kLabels); 286 } 287 288 289 /* --Methode-- */ 290 void PIYfXDrawer::Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax) 291 { 292 float xp,yp; 293 int i; 294 295 if (mSz <= 0) return; 296 297 // Trace des markers 298 if ( (mMrk != PI_NotDefMarker) || (mLAtt == PI_NotDefLineAtt) ) { 299 for(i=0; i<mSz; i++) { 300 xp = mAx->Value(i); 301 yp = mAy->Value(i); 302 if ( (xp < xmin) || (xp > xmax) || (yp < ymin) || (yp > ymax) ) continue; 303 g->DrawMarker(xp, yp); 304 } 305 } 306 307 if (mLAtt == PI_NotDefLineAtt) return; 308 309 // Trace des lignes 310 float xp2, yp2; 311 xp = mAx->Value(0); 312 yp = mAy->Value(0); 313 for(i=1; i<mSz; i++) { 314 xp2 = mAx->Value(i); 315 yp2 = mAy->Value(i); 316 if ( ((xp < xmin) || (xp > xmax) || (yp < ymin) || (yp > ymax)) && 317 ((xp2 < xmin) || (xp2 > xmax) || (yp2 < ymin) || (yp2 > ymax)) ) continue; 318 g->DrawLine(xp, yp, xp2, yp2); 319 xp = xp2; yp = yp2; 320 } 321 } -
trunk/SophyaPI/PI/piscdrawwdg.h
r119 r120 1 // Module PI : Peida Interactive PIScDrawWdg 2 // Gestionnaire Drawer-2D E.Aubourg, R. Ansari 96-98 3 // LAL (Orsay) / IN2P3-CNRS DAPNIA/SPP (Saclay) / CEA 4 1 5 #ifndef PISCDRAWWDG_H 2 6 #define PISCDRAWWDG_H … … 11 15 12 16 17 // PIScDrawWdg, Gestionnaire de traceur 2D 18 13 19 class PIScDrawWdg : public PIBaseWdg { 14 20 public: … … 21 27 virtual long kind() {return ClassId; } 22 28 23 virtual void Keyboard(int key, PIKeyModifier kmod); 24 virtual void PasteSelection(unsigned int typ, void *pdata, unsigned int l); 25 26 void SetLimits(float xmin, float xmax, float ymin, float ymax, 29 virtual void SetLimits(float xmin, float xmax, float ymin, float ymax, 27 30 int axrl=kAxeDirSame, int ayud=kAxeDirSame, bool tmp=false); 31 virtual void UpdateLimits(); // Calcule et change les limites a partir de Drawer-No-1 32 28 33 inline void SetAxesFlags(unsigned int flags=kAxesDflt) { mBDrw->SetAxesFlags(flags); } 29 34 30 35 int AddScDrawer(PIDrawer*, bool ad=false); // Ajoute un Drawer en auto 31 PIDrawer*BaseDrawer() { return mBDrw; };36 inline PIDrawer* BaseDrawer() { return mBDrw; }; 32 37 33 38 float XMin() const {return mBDrw->XMin();} … … 53 58 virtual void Ptr2Move(int x, int y); 54 59 60 virtual void Keyboard(int key, PIKeyModifier kmod); 61 virtual void PasteSelection(unsigned int typ, void *pdata, unsigned int l); 62 55 63 protected: 56 64 float xMinS, xMaxS, yMinS, yMaxS; // Sauvegarde pour zoom … … 75 83 76 84 85 // Classe de traceur de points/fonction Y=F(x) 86 87 class P1DArrayAdapter; 88 class PIYfXDrawer : public PIDrawer { 89 public: 90 PIYfXDrawer(P1DArrayAdapter* ax, P1DArrayAdapter* ay, bool ad); 91 virtual ~PIYfXDrawer(); 92 93 virtual void Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax); 94 virtual void UpdateLimits(); 95 96 97 protected: 98 P1DArrayAdapter* mAx; 99 P1DArrayAdapter* mAy; 100 int mSz; 101 bool mAdDO; 102 }; 77 103 78 104 #endif -
trunk/SophyaPI/PI/pistdwdgx.cc
r111 r120 337 337 int n=0; 338 338 Arg warg[8]; 339 CreateXtWdg(nom, xmScaleWidgetClass, NULL, sx, sy, px, py);340 339 XtSetArg(warg[n], XmNshowValue, TRUE); n++; 341 340 XtSetArg(warg[n],XmNnavigationType,XmNONE); n++; … … 354 353 XtSetArg(warg[n], XmNscaleHeight, sy); n++; 355 354 XtSetArg(warg[n], XmNstringDirection, XmSTRING_DIRECTION_R_TO_L); n++; 356 357 XtSetValues(XtWdg(), warg, n);355 CreateXtWdg(nom, xmScaleWidgetClass, NULL, sx, sy, px, py, warg, n); 356 // XtSetValues(XtWdg(), warg, n); 358 357 SetMinMax(1, 100); 359 358 SetValue(1); -
trunk/SophyaPI/PI/pistlist.cc
r119 r120 37 37 38 38 /* --Methode-- */ 39 void PIStarList::Update Size()39 void PIStarList::UpdateLimits() 40 40 { 41 41 if (!mStL) return; … … 67 67 int msz = mMSz; 68 68 if (msz < 1) msz = 1; 69 70 g->SelFont();69 PIMarker mrk = (mMrk != PI_NotDefMarker) ? mMrk : PI_FCircleMarker; 70 // g->SelFont(); 71 71 nok = 0; nl2 = mNLev*2-1; 72 72 for (int i=0; i<mStL->NbStars(); i++) { … … 80 80 sz = (int)((log10((double)flx/mF0))/mDLgF*(double)nl2-0.01) + msz; 81 81 if (sz < 2) g->SelMarker(sz, PI_DotMarker); 82 else g->SelMarker(sz, PI_FCircleMarker);82 else g->SelMarker(sz, mrk); 83 83 g->DrawMarker((double)xp,(double)yp ); 84 84 if (mDspFV) { -
trunk/SophyaPI/PI/pistlist.h
r119 r120 11 11 12 12 virtual void Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax); 13 virtual void Update Size();13 virtual void UpdateLimits(); 14 14 15 15 void SetFluxLimits(float min=1., float max=-1., int nl=5, bool dispflx=false, bool refr=false); -
trunk/SophyaPI/PI/pisurfdr.cc
r118 r120 40 40 41 41 /* --Methode-- */ 42 void PISurfaceDrawer::Update Size()42 void PISurfaceDrawer::UpdateLimits() 43 43 { 44 44 if (mArr == NULL) return; … … 52 52 float D = xmax-xmin; 53 53 if (D < (ymax-ymin)) D = ymax-ymin; 54 D *= 1. 5;54 D *= 1.4; 55 55 56 Set3DView((xmin+xmax)/2., (ymin+ymax)/2, zmin+(zmax-zmin)*0.4 ,57 (xmin+xmax)/2.+D , (ymin+ymax)/2.+2 .*D , zmin+(zmax-zmin)*0.1, 0.3, 0.3);58 // printf("PISurfaceDrawer::Update Size() : %g-%g %g-%g %g-%g (%g) \n", xmin,xmax,ymin,ymax,zmin,zmax,D);59 // printf("PISurfaceDrawer::Update Size() : %g %g %g <<- %g %g %g \n",60 // (xmin+xmax)/2., (ymin+ymax)/2, (zmin+zmax)*0.5,61 // (xmin+xmax)/2.+D , (ymin+ymax)/2.+2.*D , zmin+(zmax-zmin)*0. 1);56 Set3DView((xmin+xmax)/2., (ymin+ymax)/2, zmin+(zmax-zmin)*0.40, 57 (xmin+xmax)/2.+D , (ymin+ymax)/2.+2*D , zmin+(zmax-zmin)*0.60, 0.25, 0.25); 58 // printf("PISurfaceDrawer::UpdateLimits() : %g-%g %g-%g %g-%g (%g) \n", xmin,xmax,ymin,ymax,zmin,zmax,D); 59 // printf("PISurfaceDrawer::UpdateLimits() : %g %g %g <<- %g %g %g \n", 60 // (xmin+xmax)/2., (ymin+ymax)/2, zmin+(zmax-zmin)*0.40, 61 // (xmin+xmax)/2.+D , (ymin+ymax)/2.+2.*D , zmin+(zmax-zmin)*0.60 ); 62 62 63 63 } -
trunk/SophyaPI/PI/pisurfdr.h
r113 r120 15 15 ~PISurfaceDrawer(); 16 16 17 virtual void Update Size(); // Calcule et change la vue-3D17 virtual void UpdateLimits(); // Calcule et change la vue-3D 18 18 19 19 virtual void Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax); -
trunk/SophyaPI/PI/piwdgx.cc
r114 r120 115 115 /* --Methode-- */ 116 116 int PIWdgX::CreateXtWdg(char *nom, SysDWdgClass wdgcl, SysDWdg pwdg, 117 int sx, int sy, int px, int py )118 { 119 Arg wargs[ 5];117 int sx, int sy, int px, int py, Arg* oarg, int na) 118 { 119 Arg wargs[20]; 120 120 int n=0; 121 121 … … 139 139 XtSetArg(wargs[n],XtNx,px); n++; 140 140 XtSetArg(wargs[n],XtNy,py); n++; 141 142 if (na > 16) { printf("PIWdgX::CreateXtWdg()/Warning: na=%d > Max=16 \n", na); na = 16; } 143 for(int kk=0; kk<na; kk++) { wargs[n] = oarg[kk]; n++; } 141 144 142 145 if (wdgcl == NULL) wdgcl = coreWidgetClass; -
trunk/SophyaPI/PI/piwdgx.h
r114 r120 29 29 virtual ~PIWdgX(); 30 30 31 int CreateXtWdg(char *nom, SysDWdgClass wdgcl=NULL, SysDWdg pwdg=NULL,32 int sx=10, int sy=10, int px=0, int py=0 );33 34 31 virtual void FinishCreate(); // apres avoir installe les sous-vues 35 32 36 33 virtual void SetSize(int sx, int sy); 37 34 virtual void SetPos(int px, int py); 38 virtual void SetBorderWidth(int bw);39 35 virtual void SetLabel(string const & lab); 40 36 virtual void SetBinding(PIBindingKind left, PIBindingKind top, … … 45 41 virtual int XPos(); 46 42 virtual int YPos(); 47 virtual int BorderWidth();48 43 49 44 virtual string Nom(); … … 67 62 virtual void PasteSelection(unsigned int typ, void *, unsigned int l); 68 63 64 // Usage limite a a la version X11 69 65 inline SysDWdg XtWdg() const {return(sdw); }; 70 66 inline SysDWdg& XtWdg() {return(sdw); }; 67 int CreateXtWdg(char *nom, SysDWdgClass wdgcl=NULL, SysDWdg pwdg=NULL, 68 int sx=10, int sy=10, int px=0, int py=0, Arg* oarg=NULL, int na=0); 69 int BorderWidth(); 70 void SetBorderWidth(int bw); 71 71 72 72 protected: 73 int InitXt(int narg=0, char *arg[]=NULL); 74 73 int InitXt(int narg=0, char *arg[]=NULL); 75 74 76 75 SysDWdg sdw;
Note:
See TracChangeset
for help on using the changeset viewer.