Changeset 1971 in Sophya for trunk/SophyaPI/PIext/pistdimgapp.cc
- Timestamp:
- Apr 30, 2002, 2:34:41 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/pistdimgapp.cc
r1905 r1971 93 93 m[3]->AppendItem("Window", 10411); 94 94 m[3]->AppendItem("Window 2x1", 10421); 95 m[3]->AppendItem("Window 1x2", 10412);95 // m[3]->AppendItem("Window 1x2", 10412); 96 96 m[3]->AppendItem("Window 2x2", 10422); 97 m[3]->AppendItem("Window 3x1", 10431);97 // m[3]->AppendItem("Window 3x1", 10431); 98 98 m[3]->AppendItem("Window 3x3", 10433); 99 99 m[3]->AppendItem("Cur->LastWdg", 10441); 100 100 m[3]->AppendItem("Close CurWin", 10460); 101 m[3]->AppendCheckItem("StatZoomWin", 10470); 102 m[3]->SetStateMsg(10470, true); 101 103 102 104 m[4] = new PIMenu(Menubar(),"PostScript"); … … 138 140 MainWin()->SetSize(msx, msy); 139 141 142 //------------------------------------------------------ 143 // On cree un container intermediaire permettant de gerer 144 // le widget zoom, colormap, stats, ... 145 140 146 int bss = 100+mFgScSz*15; 141 gimv = new PIPixmap(MainWin(), "GloV", bss, bss, 5, 5); 147 148 int statc_szy = bss+10+14+mFgScSz*2+5; 149 statcont = new PIContainer(MainWin(), "ZGCSCont", msx, statc_szy, 0, 0); 150 statcont->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_free); 151 152 gimv = new PIPixmap(statcont, "GloV", bss, bss, 5, 5); 142 153 gimv->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_free, PIBK_free); 143 zoom = new PIPixmap( MainWin(), "Zoom", bss, bss, bss+10, 5);154 zoom = new PIPixmap(statcont, "Zoom", bss, bss, bss+10, 5); 144 155 zoom->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_free, PIBK_free); 145 cmapv = new PICMapView( MainWin(), "CMapView", msx-10, 14+mFgScSz*2, 5, bss+10);156 cmapv = new PICMapView(statcont, "CMapView", msx-10, 14+mFgScSz*2, 5, bss+10); 146 157 cmapv->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_free); 147 148 int cpy = bss+10+14+mFgScSz*2+5; 158 labstat = new PILabel(statcont, "statlabel", msx-2*(bss+20), 20, 2*bss+20, 10); 159 labstat->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_free); 160 labstat->SetLabel("Stat-Zoom-ColMap Window"); 161 labstat->SetForegroundColor(PI_Red); 162 labstat->SetBorderWidth(1); 163 statcont->Show(); 164 // StatZoomWindowSetVisible(true); 165 //------------------------------------------------------ 166 167 //int cpy = bss+10+14+mFgScSz*2+5; 168 int cpy = statc_szy; 149 169 150 170 // Creation d'une console avec gestion des commandes 151 mCons = new PIConsole(MainWin(), "Console", 30200, 512, 132, msx, msy-cpy, 0, cpy ); 171 consolecont = new PIContainer(MainWin(), "ConsoleCont", msx, msy-cpy, 0, cpy ); 172 consolecont->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_fixed); 173 mCons = new PIConsole(consolecont, "Console", 30200, 512, 132, msx, msy-cpy, 0, 0 ); 152 174 mCons->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_fixed); 153 175 mCons->AcceptCmd(true, 50); 176 consolecont->Show(); 154 177 redirecout = false; 155 178 // RedirectStdOutErr(true); pas par defaut … … 200 223 201 224 // Attributs graphiques courants 202 mFCol = mBCol = PI_NotDefColor;203 mLAtt = PI_NotDefLineAtt;204 mFName = PI_DefaultFont;205 mFSz = PI_NotDefFontSize;206 mFAtt = PI_NotDefFontAtt;207 mMSz = -1;208 mMrk = PI_NotDefMarker;209 mCmapid = CMAP_OTHER;210 mRevCmap = false;211 mZoom = 0;212 225 mAxesFlags = kBoxAxes | kExtTicks | kLabels; 213 SetXYLimits(-1, 1., -1., 1.);214 mFXYlim = false;215 226 SetInsetLimits(0.4, 0.6, 0.4, 0.6); 216 SetImageCenterPosition(-1,-1);217 mFImgCenter = false;218 maXlog = maYlog = false;219 227 mAddTitle = true; 220 SaveGraphicAtt();221 228 222 229 // Initialisation … … 269 276 delete gimv; 270 277 delete cmapv; 278 delete labstat; 279 280 delete statcont; 271 281 272 282 delete pfc_fits; … … 275 285 276 286 delete mCons; 287 delete consolecont; 277 288 278 289 delete mObjmgrw; … … 449 460 450 461 /* --Methode-- */ 451 int PIStdImgApp::DispImage(P2DArrayAdapter* nouv, string const & name, int opt, int oid)462 int PIStdImgApp::DispImage(P2DArrayAdapter* nouv, string const & name, string const& sop, int oid) 452 463 { 453 464 PIImage* pii; … … 468 479 } 469 480 470 int zm = 1; 471 if (mZoom == 0) { // Facteur de zoom auto 472 zm = (nouv->XSize() > nouv->YSize()) ? nouv->XSize() : nouv->YSize(); 473 zm = (zm >= 250) ? 250/zm : 1; 474 } 475 else zm = mZoom; 476 477 if (zm == 0) zm = 1; 478 if (zm < -10) zm = -10; 479 if (zm > 10) zm = 10; 480 481 if (zm > 0) { sx = nouv->XSize()*zm; sy = nouv->YSize()*zm; } 482 else { 483 sx = (int)((float)nouv->XSize()*(-1./float(zm))); 484 sy = (int)((float)nouv->YSize()*(-1./float(zm))); 485 } 481 // On decode les options graphiques 482 vector<string> opts; 483 DispWinEnum dwopt = ParseDisplayOption(sop, opts); 484 485 // Pas de same ou inset pour DispImage 486 if ((dwopt == Disp_Same) || (dwopt == Disp_Inset) ) dwopt = Disp_Next; 487 488 // Choix de la taille de fenetre 489 #define MINPIIMGSIZE 100 490 sx = (nouv->XSize() > MINPIIMGSIZE) ? nouv->XSize() : MINPIIMGSIZE; 491 sy = (nouv->YSize() > MINPIIMGSIZE) ? nouv->XSize() : MINPIIMGSIZE; 486 492 if (sx > 400+mFgScSz*100) sx = 400+mFgScSz*100; 487 493 if (sy > 400+mFgScSz*100) sy = 400+mFgScSz*100; 488 494 px = py = 0; 489 win = GetWindow( opt, sx, sy, px, py, flag, (char *)name.c_str());495 win = GetWindow(dwopt, sx, sy, px, py, flag, (char *)name.c_str()); 490 496 pii = new PIImage(win, (char *)name.c_str(), sx, sy, px,py); 491 497 pii->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); … … 493 499 pii->SetGloVWin(gimv, false); 494 500 pii->SetCMapWin(cmapv, false); 495 pii->SetZoom(zm, false);496 if ( mCmapid != CMAP_OTHER ) pii->SetColMapId(mCmapid, mRevCmap, false);497 501 pii->ShowCursor(true); 498 502 pii->SetUserData(NULL, oid); 499 // Centrage eventuel du pave 500 if (mFImgCenter && (mXImgCenter > 0) && (mYImgCenter > 0)) { 501 pii->SetImage(nouv, false); 502 pii->SetPave(mXImgCenter, mYImgCenter, true, true); 503 } 504 else pii->SetImage(nouv, true); 503 504 // decode des options en chaine de caracteres 505 pii->DecodeOptionString(mDefaultAtt, false); // d'abord les options par defaut 506 pii->DecodeOptionString(opts); // ensuite, les options specifies en argument 507 508 509 // On recalcule la taille de la fenetre si Disp_Win 510 if (dwopt == Disp_Win) { 511 int sx2 = (int)((float)nouv->XSize()*pii->GetZoomF()); 512 int sy2 = (int)((float)nouv->YSize()*pii->GetZoomF()); 513 514 if (sx2 > 400+mFgScSz*100) sx2 = 400+mFgScSz*100; 515 if (sy2 > 400+mFgScSz*100) sy2 = 400+mFgScSz*100; 516 if (sx2 < MINPIIMGSIZE) sx = MINPIIMGSIZE; 517 if (sy2 < MINPIIMGSIZE) sy = MINPIIMGSIZE; 518 if ((sx2 != sx) || (sy2 != sy)) win->SetSize(sx2, sy2); 519 } 520 521 pii->SetImage(nouv, false); 522 505 523 // printf("!!DBG!! PIImage Pos= %d %d Size= %d %d \n", pii->XPos(), pii->YPos(), pii->XSize(), pii->YSize() ); 506 524 mCurWin = win; … … 509 527 mBWId++; 510 528 mBWList[mBWId] = pii; 529 pii->Refresh(); 511 530 return(mBWId); 512 531 } … … 514 533 515 534 /* --Methode-- */ 516 int PIStdImgApp::DispScDrawer(PIDrawer* scd, string const & name, int opt, string title, int oid) 535 int PIStdImgApp::DispScDrawer(PIDrawer* scd, string const & name, string const& sop, 536 string title, int oid) 517 537 { 518 538 if (scd == NULL) … … 522 542 } 523 543 524 // Changement d'attributs graphiques courants du drawer 525 if (mFCol != PI_NotDefColor) scd->GetGraphicAtt().SetColAtt(mFCol, mBCol); 526 if (mLAtt != PI_NotDefLineAtt) scd->GetGraphicAtt().SetLineAtt(mLAtt); 527 if ( (mFSz != PI_NotDefFontSize) && (mFAtt != PI_NotDefFontAtt) ) 528 scd->GetGraphicAtt().SetFontAtt(mFSz, mFAtt); 529 if ( mFName != PI_DefaultFont ) 530 scd->GetGraphicAtt().SetFontAtt(mFName, scd->GetGraphicAtt().GetFontSz(), 531 scd->GetGraphicAtt().GetFontAtt()); 532 if ( (mMrk != PI_NotDefMarker) && (mMSz >= 0) ) 533 scd->GetGraphicAtt().SetMarkerAtt(mMSz, mMrk); 534 if ( mCmapid != CMAP_OTHER ) scd->GetGraphicAtt().SetColMapId(mCmapid); 535 536 537 if ( (!mLastWdg) && ( (opt == Disp_Same) || (opt == Disp_Inset) ) ) opt = Disp_Next; 544 // On decode les options graphiques 545 vector<string> opts; 546 DispWinEnum dwopt = ParseDisplayOption(sop, opts); 547 if ( (!mLastWdg) && ( (dwopt == Disp_Same) || (dwopt == Disp_Inset) ) ) dwopt = Disp_Next; 538 548 // Trace en superpoistion 539 if ( (opt == Disp_Same) && (mLastWdg) ) { 549 if ( (dwopt == Disp_Same) && (mLastWdg) ) { 550 // Les options 551 scd->DecodeOptionString(mDefaultAtt, false); 552 scd->DecodeOptionString(opts, true); 553 540 554 if (mLastWdg->kind() == PIScDrawWdg::ClassId) ((PIScDrawWdg*)mLastWdg)->AddScDrawer(scd, true); 541 555 else mLastWdg->AddDrawer(scd, true, true, true); … … 546 560 } 547 561 // Trace en medaillon 548 else if ( ( opt == Disp_Inset) && (mLastWdg) ) {562 else if ( (dwopt == Disp_Inset) && (mLastWdg) ) { 549 563 PIGrCoord x1, x2, y1, y2; 550 564 x1 = mIXmin; x2 = mIXmax; 551 565 y2 = 1.-mIYmin; y1 = 1.-mIYmax; 566 // Les options 567 scd->DecodeOptionString(mDefaultAtt, false); 568 scd->DecodeOptionString(opts, true); 569 552 570 scd->SetAxesFlags(mAxesFlags); 553 if (maXlog || maYlog) scd->SetLogScale(maXlog, maYlog); // Echelle log 554 if (mFXYlim) // Forcage limites XY 555 scd->SetLimits(mXmin, mXmax, mYmin, mYmax); 556 else scd->UpdateLimits(); 571 scd->UpdateLimits(); 557 572 mLastWdg->AddDrawer(scd, x1, y1, x2, y2, true, false, true); 558 573 scd->Refresh(); … … 562 577 } 563 578 579 // Creation d'un nouveau PIScDrawWdg 564 580 PIWindow* win; 565 581 PIScDrawWdg* scw; … … 567 583 sx = 200+mFgScSz*100; 568 584 sy = 200+mFgScSz*100; 569 win = GetWindow(opt, sx, sy, px, py, flag, (char *)name.c_str()); 570 /* 571 if (typeid(*scd) != typeid(PIHisto2D)) 572 else scw = new PIH2DWdg(win, (char *)name.c_str(), sx, sy, px, py); 573 */ 585 win = GetWindow(dwopt, sx, sy, px, py, flag, (char *)name.c_str()); 586 574 587 scw = new PIScDrawWdg(win, (char *)name.c_str(), sx, sy, px, py); 575 588 scw->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 576 589 scw->SetUserData(NULL, oid); 577 if (maXlog || maYlog) scw->SetLogScale(maXlog, maYlog); // Echelle log 578 if (mFXYlim) // Forcage limites XY 579 scw->SetLimits(mXmin, mXmax, mYmin, mYmax);590 591 // Decodage des options : 592 vector<string> scwatt; 580 593 scw->SetAxesFlags(mAxesFlags); 581 // Fonte de trace d'axe 582 scw->BaseDrawer()->GetGraphicAtt().SetFontAtt(mFName, mFSz, mFAtt); 583 /* 584 if (typeid(*scd) != typeid(PIHisto2D)) 585 else ((PIH2DWdg*)scw)->SetPIHisto((PIHisto2D*)scd); 586 */ 587 scw->AddScDrawer(scd, true); 594 if ( mDefaultAtt.size() > 0) { 595 scwatt = mDefaultAtt; 596 scw->DecodeOptionString(scwatt, true); 597 } 598 if ( mAxesAtt.size() > 0) { 599 scwatt = mAxesAtt; 600 scw->DecodeOptionString(scwatt, true); 601 } 602 if (opts.size() > 0) 603 scd->DecodeOptionString(opts, true); 604 if (opts.size() > 0) 605 scw->DecodeOptionString(opts, false); 606 588 607 // Titre du plot 589 608 if (mAddTitle) { … … 592 611 } 593 612 613 scw->AddScDrawer(scd, true); 594 614 // scw->Refresh(); ? Pas necessaire Reza 19/08/98, 05/05/99 $CHECK$ 615 595 616 mCurWin = win; 596 617 mCurWdg = scw; … … 602 623 603 624 /* --Methode-- */ 604 int PIStdImgApp::Disp3DDrawer(PIDrawer3D* dr3, string const & name, int opt, string title, int oid) 625 int PIStdImgApp::Disp3DDrawer(PIDrawer3D* dr3, string const & name, string const& sop, 626 string title, int oid) 605 627 { 606 628 if (dr3 == NULL) … … 610 632 } 611 633 612 // Changement d'attributs graphiques courants du drawer 613 if (mFCol != PI_NotDefColor) dr3->GetGraphicAtt().SetColAtt(mFCol, mBCol); 614 if (mLAtt != PI_NotDefLineAtt) dr3->GetGraphicAtt().SetLineAtt(mLAtt); 615 if ( (mFSz != PI_NotDefFontSize) && (mFAtt != PI_NotDefFontAtt) ) 616 dr3->GetGraphicAtt().SetFontAtt(mFSz, mFAtt); 617 if ( mFName != PI_DefaultFont ) 618 dr3->GetGraphicAtt().SetFontAtt(mFName, dr3->GetGraphicAtt().GetFontSz(), 619 dr3->GetGraphicAtt().GetFontAtt()); 620 if ( (mMrk != PI_NotDefMarker) && (mMSz >= 0) ) 621 dr3->GetGraphicAtt().SetMarkerAtt(mMSz, mMrk); 622 if ( mCmapid != CMAP_OTHER ) dr3->GetGraphicAtt().SetColMapId(mCmapid); 623 624 if ( (!mLastWdg) && ( (opt == Disp_Same) || (opt == Disp_Inset) ) ) opt = Disp_Next; 634 // On decode les options graphiques 635 vector<string> opts; 636 DispWinEnum dwopt = ParseDisplayOption(sop, opts); 637 638 if ( (!mLastWdg) && ( (dwopt == Disp_Same) || (dwopt == Disp_Inset) ) ) dwopt = Disp_Next; 625 639 // Trace en superpoistion 626 if ( (opt == Disp_Same) && (mLastWdg) ) { 640 if ( (dwopt == Disp_Same) && (mLastWdg) ) { 641 // Les options 642 dr3->DecodeOptionString(mDefaultAtt, false); 643 dr3->DecodeOptionString(opts, true); 644 627 645 if (mLastWdg->kind() == PIDraw3DWdg::ClassId) ((PIDraw3DWdg*)mLastWdg)->AddDrawer3D(dr3, true); 628 646 else mLastWdg->AddDrawer(dr3, true, true, true); … … 633 651 } 634 652 // Trace en medaillon 635 else if ( ( opt == Disp_Inset) && (mLastWdg) ) {653 else if ( (dwopt == Disp_Inset) && (mLastWdg) ) { 636 654 PIGrCoord x1, x2, y1, y2; 637 655 x1 = mIXmin; x2 = mIXmax; 638 656 y2 = 1.-mIYmin; y1 = 1.-mIYmax; 657 // Les options 658 dr3->DecodeOptionString(mDefaultAtt, false); 659 dr3->DecodeOptionString(opts, true); 660 639 661 dr3->SetAxesFlags(mAxesFlags); 640 662 dr3->UpdateLimits(); … … 651 673 sx = 200+mFgScSz*100; 652 674 sy = 200+mFgScSz*100; 653 win = GetWindow( opt, sx, sy, px, py, flag, (char *)name.c_str());675 win = GetWindow(dwopt, sx, sy, px, py, flag, (char *)name.c_str()); 654 676 PIDraw3DWdg* wd3 = new PIDraw3DWdg(win, (char *)name.c_str(), sx, sy, px, py); 655 677 wd3->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 656 678 wd3->SetUserData(NULL, oid); 657 wd3->AddDrawer3D(dr3, true); 679 680 // Decodage des options : 681 vector<string> scwatt; 682 // wd3->SetAxesFlags(mAxesFlags); Attributs d'axes 3D a faire 683 if ( mDefaultAtt.size() > 0) { 684 scwatt = mDefaultAtt; 685 wd3->DecodeOptionString(scwatt, true); 686 } 687 if ( mAxesAtt.size() > 0) { 688 scwatt = mAxesAtt; 689 wd3->DecodeOptionString(scwatt, true); 690 } 691 if (opts.size() > 0) 692 dr3->DecodeOptionString(opts, true); 693 if (opts.size() > 0) 694 wd3->DecodeOptionString(opts, false); 695 658 696 // Titre du plot 659 697 if (mAddTitle) { … … 661 699 wd3->SetTitles(title, t2); 662 700 } 701 702 wd3->AddDrawer3D(dr3, true); 663 703 // wd3->Refresh(); ?Pas necessaire $CHECK$ 05/05/99 704 664 705 mCurWin = win; 665 706 mCurWdg = wd3; … … 671 712 672 713 /* --Methode-- */ 673 void PIStdImgApp::AddText(string const & txt, double xp, double yp )714 void PIStdImgApp::AddText(string const & txt, double xp, double yp, string const& sop) 674 715 { 675 716 PIElDrawer *eld=CurrentElDrawer(); 676 717 if (eld == NULL) return; 677 718 678 if ( (mFSz != PI_NotDefFontSize) && (mFAtt != PI_NotDefFontAtt) ) 679 eld->GetGraphicAtt().SetFontAtt(mFSz, mFAtt); 680 if ( mFName != PI_DefaultFont ) 681 eld->GetGraphicAtt().SetFontAtt(mFName, eld->GetGraphicAtt().GetFontSz(), 682 eld->GetGraphicAtt().GetFontAtt()); 683 eld->ElAddText(xp,yp,txt.c_str(),mFCol); 719 vector<string> opts; 720 ParseDisplayOption(sop, opts); 721 PIGraphicAtt gratt(opts); 722 eld->ElAddText(xp,yp,txt.c_str(), gratt.GetColor()); 684 723 eld->Refresh(); 685 724 } 686 725 687 726 /* --Methode-- */ 688 void PIStdImgApp::AddLine(double xp1, double yp1, double xp2, double yp2 )727 void PIStdImgApp::AddLine(double xp1, double yp1, double xp2, double yp2, string const& sop) 689 728 { 690 729 PIElDrawer *eld=CurrentElDrawer(); 691 730 if (eld == NULL) return; 692 731 693 eld->ElAddLine(xp1, yp1, xp2, yp2, mFCol); 732 vector<string> opts; 733 ParseDisplayOption(sop, opts); 734 PIGraphicAtt gratt(opts); 735 eld->ElAddLine(xp1, yp1, xp2, yp2, gratt.GetColor()); 694 736 eld->Refresh(); 695 737 } 696 738 697 739 /* --Methode-- */ 698 void PIStdImgApp::AddRectangle(double xp1, double yp1, double xp2, double yp2, bool fgfill) 740 void PIStdImgApp::AddRectangle(double xp1, double yp1, double xp2, double yp2, 741 string const& sop, bool fgfill) 699 742 { 700 743 PIElDrawer *eld=CurrentElDrawer(); … … 715 758 yp = yp2; dy = yp1-yp2; 716 759 } 717 if (fgfill) eld->ElAddFRect(xp, yp, dx, dy, mFCol); 718 else eld->ElAddRect(xp, yp, dx, dy, mFCol); 760 761 vector<string> opts; 762 ParseDisplayOption(sop, opts); 763 PIGraphicAtt gratt(opts); 764 765 if (fgfill) eld->ElAddFRect(xp, yp, dx, dy, gratt.GetColor()); 766 else eld->ElAddRect(xp, yp, dx, dy, gratt.GetColor()); 719 767 eld->Refresh(); 720 768 } 721 769 722 770 /* --Methode-- */ 723 void PIStdImgApp::AddCircle(double xc, double yc, double r, bool fgfill)771 void PIStdImgApp::AddCircle(double xc, double yc, double r, string const& sop, bool fgfill) 724 772 { 725 773 PIElDrawer *eld=CurrentElDrawer(); 726 774 if (eld == NULL) return; 727 775 728 if (fgfill) eld->ElAddFCirc(xc, yc, r, mFCol); 729 else eld->ElAddCirc(xc, yc, r, mFCol); 776 vector<string> opts; 777 ParseDisplayOption(sop, opts); 778 PIGraphicAtt gratt(opts); 779 780 if (fgfill) eld->ElAddFCirc(xc, yc, r, gratt.GetColor()); 781 else eld->ElAddCirc(xc, yc, r, gratt.GetColor()); 730 782 eld->Refresh(); 731 783 } … … 737 789 if (eld == NULL) return; 738 790 739 if ( (mFSz != PI_NotDefFontSize) && (mFAtt != PI_NotDefFontAtt) )740 eld->GetGraphicAtt().SetFontAtt(mFSz, mFAtt);741 if ( mFName != PI_DefaultFont )742 eld->GetGraphicAtt().SetFontAtt(mFName, eld->GetGraphicAtt().GetFontSz(),743 eld->GetGraphicAtt().GetFontAtt());744 791 eld->SetTitles(titletop, titlebottom); 745 792 eld->Refresh(); … … 815 862 816 863 /* --Methode-- */ 817 PIWindow* PIStdImgApp::GetWindow( inttyp, int& sx, int& sy, int& px, int& py, int& flag, char * nom)864 PIWindow* PIStdImgApp::GetWindow(DispWinEnum typ, int& sx, int& sy, int& px, int& py, int& flag, char * nom) 818 865 { 819 866 PIWindow* rw; … … 821 868 switch (typ) { 822 869 case Disp_Next : // Fenetre graphique courante 870 case Disp_Default : 823 871 { 824 872 if (mGrW == NULL) CreateGraphWin(); … … 993 1041 } 994 1042 1043 /* --Methode-- */ 1044 void PIStdImgApp::StatZoomWindowSetVisible(bool fg) 1045 { 1046 1047 if (fg) { 1048 consolecont->SetBinding(PIBK_free,PIBK_free,PIBK_free, PIBK_free); 1049 int szy = MainWin()->YSize(); 1050 MainWin()->SetSize(MainWin()->XSize(), szy+statcont->YSize()); 1051 consolecont->SetPos(0, statcont->YSize()); 1052 consolecont->SetSize(MainWin()->XSize(), szy); 1053 consolecont->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_fixed); 1054 statcont->Show(); 1055 m[3]->SetStateMsg(10470, true); 1056 } 1057 else { 1058 statcont->Hide(); 1059 consolecont->SetBinding(PIBK_free,PIBK_free,PIBK_free, PIBK_free); 1060 MainWin()->SetSize(MainWin()->XSize(), MainWin()->YSize()-statcont->YSize()); 1061 consolecont->SetPos(0, 0); 1062 consolecont->SetSize(MainWin()->XSize(), MainWin()->YSize()); 1063 consolecont->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_fixed); 1064 m[3]->SetStateMsg(10470, false); 1065 } 1066 1067 } 995 1068 996 1069 /* --Methode-- */ … … 1040 1113 m[4]->SetSensitivityMsg(10516, false); 1041 1114 } 1115 1116 //--------------------------------------------------------------------------- 1117 //--------- Gestion des attributs graphiques et autres options de trace ----- 1118 1119 /* --Methode-- */ 1120 void PIStdImgApp::SetInsetLimits(double xmin, double xmax, double ymin, double ymax) 1121 { 1122 mIXmin = xmin; mIXmax= xmax; 1123 mIYmin = ymin; mIYmax= ymax; 1124 } 1125 1126 /* --Methode-- */ 1127 void PIStdImgApp::SetDefaultGraphicAttributes(string const & opt) 1128 { 1129 ParseDisplayOption(opt, mDefaultAtt); 1130 } 1131 1132 /* --Methode-- */ 1133 void PIStdImgApp::SetDefaultAxesAttributes(string const & opt) 1134 { 1135 ParseDisplayOption(opt, mAxesAtt); 1136 } 1137 1138 /* --Methode-- */ 1139 DispWinEnum PIStdImgApp::ParseDisplayOption(string const & sop, vector<string>& opts) 1140 { 1141 DispWinEnum rc = Disp_Next; 1142 //DBG cerr << " DBG-Parse-A sop=" << sop << " sop.length()= " << sop.length() << endl; 1143 if (opts.size() > 0) opts.erase(opts.begin(), opts.end()); 1144 if (sop.length() < 1) return(rc); 1145 string gratt = sop; 1146 for(int i=0; i<gratt.length(); i++) gratt[i] = tolower(gratt[i]); 1147 if ( (gratt == "def") || (gratt == "default") ) return(rc); 1148 // On separe en mots espaces par des blancs ou tabulation 1149 size_t p = 0; 1150 size_t q = 0; 1151 size_t l = gratt.length(); 1152 string token; 1153 while (q < l) { 1154 p = gratt.find_first_not_of(" \t",q); // au debut d'un token 1155 if (p >= l) break; 1156 q = gratt.find_first_of(" \t",p); // Premier blanc ou tab suivant 1157 if (q<l) token = gratt.substr(p,q-p); 1158 else token = gratt.substr(p); 1159 if (token == "") continue; 1160 // Decodage option fenetre d'affichage (win, next, ...) 1161 if (token == "win") rc = Disp_Win; 1162 else if (token == "same") rc = Disp_Same; 1163 else if (token == "inset") rc = Disp_Inset; 1164 else if (token == "stack") rc = Disp_Stack; 1165 // Option a etre decode par les drawers, etc ... 1166 else opts.push_back(token); 1167 } 1168 1169 //DBG cerr << " DBG-Parse-B opts.size()=" << opts.size() << endl; 1170 return (rc); 1171 } 1172 1173 //--------------------------------------------------------------------------- 1174 //------------ Methodes privees (MBProcessx, ...) ---------- 1042 1175 1043 1176 /* --Methode-- */ … … 1295 1428 DeleteWindow(mCurWin); 1296 1429 break; 1430 case 10470 : 1431 StatZoomWindowSetVisible(m[3]->GetStateMsg(10470)); 1432 break; 1297 1433 default: 1298 1434 cerr << "PIStdImgApp::MBProcess4() BUG?? Msg= " << msg << endl; … … 1461 1597 1462 1598 1463 /* --Methode-- */1464 void PIStdImgApp::SetColAtt(PIColors fg, PIColors bg)1465 {1466 mFCol = fg;1467 mBCol = bg;1468 }1469 /* --Methode-- */1470 void PIStdImgApp::SetLineAtt(PILineAtt lat)1471 {1472 mLAtt = lat;1473 }1474 1475 /* --Methode-- */1476 void PIStdImgApp::SetFontName(PIFontName fn)1477 {1478 mFName = fn;1479 }1480 1481 /* --Methode-- */1482 void PIStdImgApp::SetFontAtt(PIFontSize fsz, PIFontAtt fat)1483 {1484 mFSz = fsz;1485 mFAtt = fat;1486 }1487 /* --Methode-- */1488 void PIStdImgApp::SetMarkerAtt(int sz, PIMarker mrk)1489 {1490 mMSz = sz;1491 mMrk = mrk;1492 }1493 1494 /* --Methode-- */1495 void PIStdImgApp::SetZoomAtt(int zoom)1496 {1497 if ( (zoom > 10) || (zoom < -10) ) zoom = 0;1498 mZoom = zoom;1499 }1500 /* --Methode-- */1501 void PIStdImgApp::SetAxesAtt(unsigned int axfl)1502 {1503 mAxesFlags = axfl;1504 }1505 /* --Methode-- */1506 void PIStdImgApp::SetXYLimits(double xmin, double xmax, double ymin, double ymax)1507 {1508 mXmin = xmin; mXmax= xmax;1509 mYmin = ymin; mYmax= ymax;1510 }1511 /* --Methode-- */1512 void PIStdImgApp::SetInsetLimits(double xmin, double xmax, double ymin, double ymax)1513 {1514 mIXmin = xmin; mIXmax= xmax;1515 mIYmin = ymin; mIYmax= ymax;1516 }1517 /* --Methode-- */1518 void PIStdImgApp::SetImageCenterPosition(int x, int y)1519 {1520 mXImgCenter = x; mYImgCenter = y;1521 }1522 1523 /* --Methode-- */1524 void PIStdImgApp::SaveGraphicAtt()1525 {1526 mSFCol = mFCol;1527 mSBCol = mBCol;1528 mSLAtt = mLAtt;1529 mSFName = mFName;1530 mSFSz = mFSz;1531 mSFAtt = mFAtt;1532 mSMSz = mMSz;1533 mSMrk = mMrk;1534 mSCmapid = mCmapid;1535 mSRevCmap = mRevCmap;1536 mSZoom = mZoom;1537 mSAxesFlags = mAxesFlags;1538 mSXmin = mXmin; mSXmax = mXmax;1539 mSYmin = mYmin; mSYmax = mYmax;1540 mSIXmin = mIXmin; mSIXmax = mIXmax;1541 mSIYmin = mIYmin; mSIYmax = mIYmax;1542 mSFXYlim = mFXYlim;1543 mSXImgCenter = mXImgCenter;1544 mSYImgCenter = mYImgCenter;1545 mSFImgCenter = mFImgCenter;1546 mSaXlog = maXlog;1547 mSaYlog = maYlog;1548 mSAddTitle = mAddTitle;1549 }1550 1551 /* --Methode-- */1552 void PIStdImgApp::RestoreGraphicAtt()1553 {1554 mFCol = mSFCol;1555 mBCol = mSBCol;1556 mLAtt = mSLAtt;1557 mFName = mSFName;1558 mFSz = mSFSz;1559 mFAtt = mSFAtt;1560 mMSz = mSMSz;1561 mMrk = mSMrk;1562 mCmapid = mSCmapid;1563 mRevCmap = mSRevCmap;1564 mZoom = mSZoom;1565 mAxesFlags = mSAxesFlags;1566 mXmin = mSXmin; mXmax = mSXmax;1567 mYmin = mSYmin; mYmax = mSYmax;1568 mIXmin = mSIXmin; mIXmax = mSIXmax;1569 mIYmin = mSIYmin; mIYmax = mSIYmax;1570 mFXYlim = mSFXYlim;1571 mXImgCenter = mSXImgCenter;1572 mYImgCenter = mSYImgCenter;1573 mFImgCenter = mSFImgCenter;1574 maXlog = mSaXlog;1575 maYlog = mSaYlog;1576 mAddTitle = mSAddTitle;1577 }1578 1599 1579 1600 // ------------------------------------------------- … … 1620 1641 string info = "piapp : Interactive analysis program\n"; 1621 1642 info += buff; 1622 info += "(C) LAL-IN2P3/CNRS 1996-200 0\n";1623 info += "(C) SPP-DAPNIA/CEA 1996-200 0\n";1643 info += "(C) LAL-IN2P3/CNRS 1996-2002\n"; 1644 info += "(C) SPP-DAPNIA/CEA 1996-2002\n"; 1624 1645 infow_txt->SetText(info); 1625 1646 }
Note:
See TracChangeset
for help on using the changeset viewer.