Changeset 1827 in Sophya
- Timestamp:
- Dec 19, 2001, 6:48:26 PM (24 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pi3ddrw.cc
r1589 r1827 440 440 if (kmod == PIKM_Alt) { 441 441 if (key == 'V' || key == 'v') RequestSelection(); // Pour coller (copier/coller) 442 if (key == 'Z' || key == 'z') { mBDrw->ElDelAll(); Refresh(); } // Pour supprimer tous les signes 443 if (key == 'O' || key == 'o' || key == 'G' || key == 'g') { 444 PIDrwTools::SetCurrentBaseWdg(this); 445 PIDrwTools::ShowPIDrwTools(); // Fentre axes et options de trace 446 } 447 if (key == 'A' || key == 'a') { // On affiche ou on enleve les axes 442 else if (key == 'Z' || key == 'z') { mBDrw->ElDelAll(); Refresh(); } // Pour supprimer tous les signes 443 else if (key == 'O' || key == 'o') { // fenetre des options de controle du drawer actif 444 PIDrawer* actdrw = GetActiveDrawer(); 445 if (actdrw != NULL) actdrw->ShowControlWindow(this); 446 } 447 else if (key == 'G' || key == 'g') // Fenetre des options graphiques de trace 448 PIDrwTools::ShowPIDrwTools(this); 449 450 else if (key == 'A' || key == 'a') { // On affiche ou on enleve les axes 448 451 axfg = !axfg; 449 452 list<int>::iterator it; … … 458 461 } 459 462 // <Alt>S active la sensibilite de la zone centrale pour tourner l'objet 460 if (key == 'S' || key == 's') skcfg = !skcfg;461 if (key == 'R' || key == 'r') Update3DView();463 else if (key == 'S' || key == 's') skcfg = !skcfg; 464 else if (key == 'R' || key == 'r') Update3DView(); 462 465 } 463 466 } -
trunk/SophyaPI/PI/pibwdggen.cc
r1534 r1827 88 88 { 89 89 mDrwId=0; // Compteur des numeros sequentiel des PIDrawer 90 mActDrwId = -1; // Identificateur du drawer actif 90 91 mAdfg=false; // Pour controle d'appel de RemoveDrawer() 91 92 mWGrC = NULL; // PIGraphic (Contexte graphique) associe a la fenetre} … … 377 378 mDrwList.push_back(did); 378 379 drw->Attach(this, mDrwId); 380 mActDrwId = mDrwId; // Le dernier drawer ajoute devient le drawer actif par defaut 379 381 return(mDrwId); 380 382 } … … 394 396 mDrwList.push_back(did); 395 397 drw->Attach(this, mDrwId); 398 mActDrwId = mDrwId; // Le dernier drawer ajoute devient le drawer actif par defaut 396 399 return(mDrwId); 397 400 } … … 428 431 vector<BWDrwId>::iterator it; 429 432 for(it = mDrwList.begin(); it != mDrwList.end(); it++) 430 if ((*it).id == id) 431 { (*it).drw->Detach(this, id); mDrwList.erase(it); break; } 433 if ((*it).id == id) { 434 (*it).drw->Detach(this, id); mDrwList.erase(it); 435 if (id == mActDrwId) { 436 if (NbDrawers() > 0) mActDrwId = (*mDrwList.end()).id; 437 else mActDrwId = -1; 438 } 439 break; 440 } 432 441 return; 433 442 } … … 441 450 if ((*it).ad) delete (*it).drw; 442 451 mDrwList.erase(mDrwList.begin(), mDrwList.end() ); 452 mActDrwId = -1; 443 453 mAdfg = false; 444 454 return; … … 477 487 } 478 488 489 490 /* --Methode-- */ 491 void PIBaseWdgGen::SetActiveDrawerId(int id) 492 { 493 vector<BWDrwId>::iterator it; 494 for(it = mDrwList.begin(); it != mDrwList.end(); it++) 495 if ((*it).id == id) { mActDrwId = id; break; } 496 return; 497 } 498 499 /* --Methode-- */ 500 void PIBaseWdgGen::SetActiveDrawer(int n) 501 { 502 if ( (n >= 0) && (n < mDrwList.size()) ) mActDrwId = mDrwList[n].id; 503 return; 504 } 505 506 /* --Methode-- */ 507 int PIBaseWdgGen::GetActiveDrawerId() 508 { 509 return(mActDrwId); 510 } 511 512 /* --Methode-- */ 513 int PIBaseWdgGen::GetActiveDrawerNum() 514 { 515 if (mActDrwId < 0) return(-1); 516 for(int i=0; i<mDrwList.size(); i++) 517 if (mDrwList[i].id == mActDrwId) return(i); 518 return(-1); 519 } 520 521 /* --Methode-- */ 522 PIDrawer* PIBaseWdgGen::GetActiveDrawer() 523 { 524 if (mActDrwId < 0) return(NULL); 525 else return(GetDrawerId(mActDrwId)); 526 } 479 527 480 528 //++ -
trunk/SophyaPI/PI/pibwdggen.h
r1534 r1827 97 97 virtual int NbDrawers(); 98 98 virtual PIDrawer* GetDrawerId(int id); 99 virtual PIDrawer* GetDrawer(int n); 99 virtual PIDrawer* GetDrawer(int n); 100 101 // Quel est le drawer actif 102 virtual void SetActiveDrawerId(int id); 103 virtual void SetActiveDrawer(int n); 104 virtual int GetActiveDrawerId(); 105 virtual int GetActiveDrawerNum(); 106 virtual PIDrawer* GetActiveDrawer(); 100 107 101 108 // Trace des Drawers ... … … 113 120 bool mAdfg; // Pour la gestion de DeleteDrawers() quand appele par delete de PIBaseWdg 114 121 int mDrwId; // Compteur pour DrawerId 115 vector<BWDrwId> mDrwList; 122 int mActDrwId; // Identificateur du drawer actif 123 vector<BWDrwId> mDrwList; // Liste des drawers et leur Id 116 124 // Definition de la zone de trace et limites UC des drawers par defaut 117 125 PIGrCoord mDrX1, mDrY1, mDrX2, mDrY2; -
trunk/SophyaPI/PI/picmapview.cc
r1538 r1827 136 136 } 137 137 } 138 138 cout << " PICMapView::Draw1 "<<vmin<<" "<<vmax<<endl; 139 139 if (vmin > vmax) return; 140 140 if ( (cmap->Type() == CMAP_GREY32) || (cmap->Type() == CMAP_GREYINV32) || 141 141 (cmap->Type() == CMAP_GREY128) || (cmap->Type() == CMAP_GREYINV128) ) g->SelForeground(PI_Red); 142 142 else g->SelForeground(PI_Green); 143 143 cout << " PICMapView::Draw2 "<<vmin<<" "<<vmax<<endl; 144 144 if (sx > sy) { // horizontal 145 145 int fsz = (sy < 20) ? sy-6 : 14; … … 151 151 else sprintf(buff, "%8.4g", vmin); 152 152 g->DrawString(4, sy-4, buff); 153 cout << " buff "<<buff; 153 154 av = fabs(vmax); 154 155 if ( (av < 1.e6) && (av > 1.e-3) ) sprintf(buff, "%.2f", vmax); 155 156 else sprintf(buff, "%8.4g", vmax); 157 cout << " buff2 "<<buff<<endl; 156 158 g->DrawString(sx-4-(int)g->CalcStringWidth(buff), sy-4, buff); 157 159 } -
trunk/SophyaPI/PI/pidrawer.cc
r1667 r1827 8 8 #include <iostream.h> 9 9 #include "pidrawer.h" 10 11 #include "pidrwtools.h" 10 12 11 13 #include <math.h> … … 311 313 } 312 314 315 void 316 PIDrawer::ShowControlWindow(PIBaseWdgGen* wdg) 317 { 318 // On affiche par defaut la fenetre de gestion des attributs graphiques 319 PIDrwTools::ShowPIDrwTools(wdg); 320 } 321 322 int 323 PIDrawer::DecodeOptionString(vector<string> & opt) 324 { 325 // a faire un jour OP+Reza 30/11/01 326 return(0); 327 } 313 328 314 329 PIGraphicUC* -
trunk/SophyaPI/PI/pidrawer.h
r1631 r1827 90 90 91 91 92 // --- Methode static ---- 92 // Methode permettant l'affichage d'une fenetre de controle specialisee 93 virtual void ShowControlWindow(PIBaseWdgGen* wdg); 94 95 // Methode permettant de decoder des options a partir de chaines 96 virtual int DecodeOptionString(vector<string> & opt); 97 98 // --- Methode- static ---- 93 99 // Calcul des Distances optimales des subdivisions 94 100 static void BestTicks(double rmin,double rmax,int nticks,double& majt); -
trunk/SophyaPI/PI/pidrwtools.cc
r1640 r1827 54 54 55 55 /* --Methode-- */ 56 void PIDrwTools::ShowPIDrwTools(PIBaseWdgGen* cbw) 57 { 58 if (cwdrwt == NULL) cwdrwt = new PIDrwTools(PIApplicationGetApp()); 59 SetCurrentBaseWdg(cbw); 60 cwdrwt->Show(); 61 } 62 63 /* --Methode-- */ 56 64 void PIDrwTools::ShowPIDrwTools() 57 65 { … … 74 82 if (cwdrwt) { 75 83 if (mCurBW != NULL) { 76 cwdrwt->mNDr = mCurBW-> NbDrawers()-1;84 cwdrwt->mNDr = mCurBW->GetActiveDrawerNum(); 77 85 if (cwdrwt->mNDr < 0) cwdrwt->mNDr = 0; 78 86 } … … 248 256 mOpt[7]->AppendItem("Big FontSz", 804); 249 257 mOpt[7]->AppendItem("Huge FontSz", 805); 258 mOpt[7]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 250 259 251 260 cpx = 2*spx; … … 410 419 PIDrawer* drw = mCurBW->GetDrawer(mNDr); 411 420 if (drw == NULL) return; 421 mCurBW->SetActiveDrawer(mNDr); 412 422 int k,ii,jj,kk; 413 423 k = mOpt[0]->GetValue()-100; … … 461 471 case 3200 : 462 472 if ((mCurBW != NULL) && (mCurBW->GetDrawer(mNDr) != NULL) ) { 463 if (mod == PIMsg_Press) mCurBW->GetDrawer(mNDr)->HighLight(true); 473 if (mod == PIMsg_Press) { 474 mCurBW->GetDrawer(mNDr)->HighLight(true); 475 mCurBW->SetActiveDrawer(mNDr); 476 } 464 477 else mCurBW->GetDrawer(mNDr)->HighLight(false); 465 478 } -
trunk/SophyaPI/PI/pidrwtools.h
r1589 r1827 26 26 static PIDrwTools* curlutw; 27 27 static void ShowPIDrwTools(); 28 static void ShowPIDrwTools(PIBaseWdgGen* cbw); 28 29 static void HidePIDrwTools(); 29 30 static void SetCurrentBaseWdg(PIBaseWdgGen* cbw); -
trunk/SophyaPI/PI/piscdrawwdg.cc
r1631 r1827 11 11 #include "piaxestools.h" 12 12 #include "parradapter.h" 13 13 14 14 15 //++ … … 34 35 // * <Alt>I : Affiche et met a jour la fenetre Texte-Info . 35 36 // * <Alt>Z : Supprime les textes et signes ajoutés au dessin. 37 // * <Alt>P : fenetre des options de drawing des contours 36 38 //-- 37 39 //++ … … 117 119 } 118 120 119 void 120 PIScDrawWdg::Keyboard(int key, PIKeyModifier kmod) 121 void PIScDrawWdg::Keyboard(int key, PIKeyModifier kmod) 121 122 { 122 123 if (kmod == PIKM_Alt) { … … 125 126 else if (key == 'V' || key == 'v') RequestSelection(); // Pour coller (copier/coller) 126 127 else if (key == 'Z' || key == 'z') { mBDrw->ElDelAll(); Refresh(); } // Pour supprimer tous les signes 127 else if (key == 'O' || key == 'o') ActivateSpecializedControls(); 128 else if (key == 'G' || key == 'g') { 129 PIDrwTools::SetCurrentBaseWdg(this); 130 PIDrwTools::ShowPIDrwTools(); // Fentre axes et options de trace 131 } 128 else if (key == 'O' || key == 'o') { // fenetre des options de controle du drawer actif 129 PIDrawer* actdrw = GetActiveDrawer(); 130 if (actdrw != NULL) actdrw->ShowControlWindow(this); 131 } 132 else if (key == 'G' || key == 'g') // Fenetre des options graphiques de trace 133 PIDrwTools::ShowPIDrwTools(this); 134 132 135 else if (key == 'A' || key == 'a') { 133 136 PIAxesTools::SetCurrentScDrawWdg(this); 134 137 PIAxesTools::ShowPIAxesTools(); // Fenetre de gestion des axes 135 138 } 139 136 140 else if (key == 'I' || key == 'i') UpdateInfoWindow(); // Fenetre Text-Info 137 141 } -
trunk/SophyaPI/PI/piversion.h
r1641 r1827 2 2 #define PIVERSION_H_SEEN 3 3 4 #define PI_VERSIONNUMBER 3.3 4 #define PI_VERSIONNUMBER 3.35 5 5 6 6 #endif
Note:
See TracChangeset
for help on using the changeset viewer.