Changeset 1850 in Sophya for trunk/SophyaPI/PIext
- Timestamp:
- Jan 7, 2002, 4:56:32 PM (24 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/pihisto2d.cc
r1645 r1850 1 1 #include <stdio.h> 2 #include <stdlib.h> 2 3 #include "piapplgen.h" 3 4 #include "pihisto2d.h" … … 29 30 // Createur d'une classe de dessin pour l'histogramme 2D histo. 30 31 //-- 31 : PIDrawer(), mHisto(histo) 32 { 33 mAdDO = ad; // Flag pour suppression automatique de mHisto 34 35 mLogScale = 10.; 36 mFPoints = 0.5; 37 32 : PIDrawer(), mHisto(histo), mAdDO(ad), mLogScale(10.), mFPoints(0.5) 33 { 34 // mAdDO : Flag pour suppression automatique de mHisto 35 // Attention: mFPoints n'est initialise que si on display par nuages de points 36 // mLogScale n'est initialise que si on utilise une echelle log 37 UseScale(); 38 38 UseColors(); 39 39 UseDisplay(); … … 48 48 //-- 49 49 { 50 if(mAdDO ) delete mHisto;51 } 52 53 //++ 54 void PIHisto2D::UseColors(bool fg, CMapIdcmap)50 if(mAdDO && mHisto!=NULL) delete mHisto; 51 } 52 53 //++ 54 void PIHisto2D::UseColors(bool fg,CMapId cmap,bool revcmap) 55 55 // 56 56 // Choix de la couleur si fg=true avec la color map cmap. … … 61 61 // en couleur. Cette option est incontournable dans le cas 62 62 // d'un display par des carres de taille fixe. 63 // revcmap doit etre mis a "true" si on veut avoir une color map 64 // inversee. 63 65 //| -**- gestion dans H2WinArg par menu deroulant Black&White etc... 64 66 //-- 65 67 { 66 mFgCol = fg; mCmap = cmap; 68 mFgCol = fg; mCmap = cmap; mRevCmap = revcmap; 67 69 } 68 70 … … 89 91 //-- 90 92 { 91 if(type==0) mTypScal = 0; 92 if(type==1) { 93 mTypScal = 1; 94 if(logscale>1.) mLogScale = logscale; 95 } else mTypScal = 0; 96 } 97 98 //++ 99 void PIHisto2D::UseDisplay(unsigned short type, float fnpt) 93 if(type==0) mTypScal=0; 94 else if(type==1) {mTypScal=1; if(logscale>1.) mLogScale=logscale;} 95 else mTypScal=0; 96 } 97 98 //++ 99 void PIHisto2D::UseDisplay(unsigned short type,float fnpt) 100 100 // 101 101 // Type de Display … … 112 112 //-- 113 113 { 114 if(fnpt<0.) fnpt=0; else if(fnpt>1.) fnpt=1.; 115 if(type==0) mTypDisp = 0; 116 else if(type==1) { mTypDisp = 1; mFPoints = fnpt;} 117 else if(type==2) mTypDisp = 2; 118 else if(type==3) mTypDisp = 3; 119 else mTypDisp = 1; 120 } 121 122 //++ 123 void PIHisto2D::UseDyn(float hmin, float hmax) 114 if(type==0) mTypDisp = 0; 115 else if(type==1) { 116 mTypDisp = 1; 117 if(fnpt<0.) mFPoints = 0.; 118 else if(fnpt>1.) mFPoints = 1.; 119 else mFPoints = fnpt; 120 } 121 else if(type==2) mTypDisp = 2; 122 else if(type==3) mTypDisp = 3; 123 else mTypDisp = 1; 124 } 125 126 //++ 127 void PIHisto2D::UseDyn(float hmin,float hmax) 124 128 // 125 129 // Gestion de la dynamique a representer: … … 133 137 //-- 134 138 { 135 if(hmin>=hmax) {hmin = mHisto->VMin(); hmax = mHisto->VMax();} 139 if(mHisto) 140 if(hmin>=hmax) {hmin = mHisto->VMin(); hmax = mHisto->VMax();} 136 141 if(hmin>=hmax) hmax = hmin+1.; 137 142 mHMin = hmin; mHMax = hmax; … … 139 144 140 145 //++ 141 void PIHisto2D::UseFrac(float frmin, 146 void PIHisto2D::UseFrac(float frmin,float frmax) 142 147 // 143 148 // Pour definir la fraction de la dynamique a dessiner: … … 167 172 //-- 168 173 { 169 printf("PIHisto2D::Print FgCol=%d Cmap=%d TypScal=%d TypDisp=%d (FPoints=%g)\n"170 ,(int)mFgCol,(int)mCmap, mTypScal,mTypDisp,mFPoints);174 printf("PIHisto2D::Print FgCol=%d Cmap=%d (Rev=%d) TypScal=%d TypDisp=%d (FPoints=%g)\n" 175 ,(int)mFgCol,(int)mCmap,(int)mRevCmap,mTypScal,mTypDisp,mFPoints); 171 176 printf(" Dyn=%g,%g Frac=%g,%g LogSc=%g H=%lx\n" 172 177 ,mHMin,mHMax,mFracMin,mFracMax,mLogScale,(long)mHisto); … … 182 187 //-- 183 188 { 184 if(!mHisto) return; 185 SetLimits(mHisto->XMin(), mHisto->XMax(), mHisto->YMin() , mHisto->YMax()); 186 // SetAxesFlags(kBoxAxes | kExtTicks | kLabels); Ne pas faire - Reza 11/99 187 } 188 189 //++ 190 void PIHisto2D::Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax) 189 if(!mHisto) return; 190 SetLimits(mHisto->XMin(), mHisto->XMax(), mHisto->YMin() , mHisto->YMax()); 191 } 192 193 //++ 194 void PIHisto2D::Draw(PIGraphicUC* g,double xmin,double ymin,double xmax,double ymax) 191 195 // 192 196 // Dessin de l'histogramme. … … 210 214 //-- 211 215 { 212 213 216 if (axesFlags != kAxesNone) DrawAxes(g); 214 217 … … 228 231 int ncol = 0; 229 232 if (mFgCol) { 230 cmap = new PIColorMap(mCmap); ncol = cmap->NCol(); 233 cmap = new PIColorMap(mCmap); 234 cmap->ReverseColorIndex(mRevCmap); 235 ncol = cmap->NCol(); 231 236 if(mTypDisp==3) fracmin=-1.; 232 237 } … … 261 266 262 267 // Plot de l'histogramme 263 for 264 for(int j=0; j<mHisto->NBinY(); j++) {268 for(int i=0; i<mHisto->NBinX(); i++) 269 for(int j=0; j<mHisto->NBinY(); j++) { 265 270 266 271 r_8 left0,bottom0; … … 449 454 : PIScDrawWdg(par,nom,sx,sy,px,py) 450 455 { 451 if 456 if(!h2dWinArg) h2dWinArg = new H2WinArg(this); 452 457 nb_h2dWinArg++; 453 458 if(dbg) printf("PIH2DWdg::PIH2DWdg %lx h2dWinArg=%lx %d\n" … … 465 470 { 466 471 nb_h2dWinArg--; 467 if 472 if(nb_h2dWinArg == 0) { 468 473 h2dWinArg->Hide(); 469 474 delete h2dWinArg; … … 472 477 if(dbg) printf("PIH2DWdg::~PIH2DWdg h2dWinArg=%lx %d\n" 473 478 ,(long)h2dWinArg,nb_h2dWinArg); 474 if 479 if(mPih) delete mPih; 475 480 } 476 481 … … 481 486 //-- 482 487 { 483 if 484 if 488 if(!histo) return; 489 if(mPih) delete mPih; 485 490 mPih = new PIHisto2D(histo, true); 486 491 AddScDrawer(mPih); … … 494 499 //-- 495 500 { 496 if 497 if 501 if(!pih2) return; 502 if(mPih) delete mPih; 498 503 mPih = pih2; 499 504 AddScDrawer(mPih); … … 511 516 char str[128]; 512 517 513 if 518 if((!mPih) || (!mPih->Histogram())) { 514 519 sprintf(str,"X=%g Y=%g ???",x,y); 515 520 return((string)str); … … 617 622 //| et de l'histogramme. 618 623 //-- 619 : PIWindow((PIMsgHandler *)par, "Options", PIWK_dialog,250,260,150,150) 624 : PIWindow((PIMsgHandler *)par,"Options",PIWK_dialog,250,260,150,150) 625 , mH2Wdg(NULL) 626 , mFgCol(false), mCmap(CMAP_GREYINV32), mRevCmap(false) 627 , mTypScal(0) , mLogScale(10.) 628 , mTypDisp(0) , mFPoints(0.5) 629 , mHMin(1.) , mHMax(-1.) 630 , mFracMin(0.1), mFracMax(0.9) 620 631 { 621 632 string sdum; 622 633 if(dbg) printf("H2WinArg::H2WinArg %lx par=%lx\n",(long)this,(long)par); 623 624 mH2Wdg = NULL;625 626 // Valeurs par defaut627 mFgCol = false;628 mCmap = CMAP_GREYINV32;629 mTypScal = 0;630 mTypDisp = 0;631 mFPoints = 0.5;632 mHMin = 1.;633 mHMax = -1.;634 mFracMin = 0.1;635 mFracMax = 0.9;636 mLogScale = 10.;637 634 638 635 // Taille automatique … … 642 639 int spy = (bsy>=5) ? bsy/5 : 1; // intervalle entre lettres Y 643 640 int wszx = 5*spx+bsx+int(2.5*bsx); // Taille fenetre en X 644 int wszy = 11*spy+ 8.5*bsy;// Taille fenetre en Y641 int wszy = 11*spy+int(8.5*bsy); // Taille fenetre en Y 645 642 SetSize(wszx, wszy); 646 643 647 644 // menu du style de display des bins 648 645 int cpx = 2*spx, cpy = 2*spy; 649 mOPop[0] = new PIOptMenu(this, "optmen-h2d-1",2*bsx,bsy,cpx,cpy);650 mOPop[0]->AppendItem("Carres Var." , 651 mOPop[0]->AppendItem("....." , 652 mOPop[0]->AppendItem(".+12..Z*" , 653 mOPop[0]->AppendItem("Carres Pleins", 646 mOPop[0] = new PIOptMenu(this,"optmen-h2d-1",2*bsx,bsy,cpx,cpy); 647 mOPop[0]->AppendItem("Carres Var." ,6101); 648 mOPop[0]->AppendItem("....." ,6102); 649 mOPop[0]->AppendItem(".+12..Z*" ,6103); 650 mOPop[0]->AppendItem("Carres Pleins",6104); 654 651 sdum = "Carres Var."; mOPop[0]->SetValueStr(sdum); 655 652 mOPop[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); … … 657 654 // Menu du choix de la dynamique 658 655 cpy += bsy+spy; 659 mOPop[1] = new PIOptMenu(this, 660 mOPop[1]->AppendItem("Lineaire", 661 mOPop[1]->AppendItem("Log10" , 656 mOPop[1] = new PIOptMenu(this,"optmen-h2d-2",2*bsx,bsy,cpx,cpy); 657 mOPop[1]->AppendItem("Lineaire",6201); 658 mOPop[1]->AppendItem("Log10" ,6202); 662 659 sdum = "Lineaire"; mOPop[1]->SetValueStr(sdum); 663 660 mOPop[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); … … 665 662 // Menu du choix des couleurs 666 663 cpy += bsy+spy; 667 mOPop[2] = new PIOptMenu(this, 664 mOPop[2] = new PIOptMenu(this,"optmen-h2d-3",2*bsx,bsy,cpx,cpy); 668 665 mOPop[2]->AppendItem("Black&White",7000); 669 mCasc[0] = new PIMenu(mOPop[2]->Menu(), 670 mCasc[1] = new PIMenu(mOPop[2]->Menu(), 666 mCasc[0] = new PIMenu(mOPop[2]->Menu(),"PIStd-128Col"); 667 mCasc[1] = new PIMenu(mOPop[2]->Menu(),"MIDAS-CMap"); 671 668 int kcc,nsct1=5,nsct2=9,nsct3=PIColorMap::NumberStandardColorMaps()-1; 672 669 for(kcc=0; kcc<nsct1; kcc++) … … 679 676 mOPop[2]->AppendPDMenu(mCasc[1]); 680 677 for(kcc=nsct3; kcc<PIColorMap::NumberStandardColorMaps(); kcc++) 681 mOPop[2]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(),7001+kcc);678 mOPop[2]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(),7001+kcc); 682 679 mOPop[2]->SetValue(7000); 683 680 mOPop[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 684 681 682 // Reverse color map 683 cpy += bsy+spy; 684 mCkb = new PICheckBox(this,"Reverse CMap",8001,2*bsx,bsy,cpx,cpy); 685 mCkb->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 686 685 687 // Labels et zones de saisie texte 686 cpy += 2*(bsy+spy);687 mLab[0] = new PILabel(this, 688 cpy += bsy+spy; 689 mLab[0] = new PILabel(this," Dyn: ",bsx,bsy,cpx,cpy); 688 690 mLab[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 689 mText[0] = new PIText(this, "Dynamique",int(2.5*bsx),bsy,cpx+bsx+spx,cpy);691 mText[0] = new PIText(this,"Dynamique",int(2.5*bsx),bsy,cpx+bsx+spx,cpy); 690 692 mText[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 691 693 cpy += bsy+spy; 692 mLab[1] = new PILabel(this, 694 mLab[1] = new PILabel(this," Frac: ",bsx,bsy,cpx,cpy); 693 695 mLab[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 694 mText[1] = new PIText(this, "Fraction",int(2.5*bsx),bsy,cpx+bsx+spx,cpy);696 mText[1] = new PIText(this,"Fraction",int(2.5*bsx),bsy,cpx+bsx+spx,cpy); 695 697 mText[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 696 698 cpy += bsy+spy; 697 mLab[2] = new PILabel(this, 699 mLab[2] = new PILabel(this," LogScal: ",bsx,bsy,cpx,cpy); 698 700 mLab[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 699 mText[2] = new PIText(this, "LogScale",int(2.5*bsx),bsy,cpx+bsx+spx,cpy);701 mText[2] = new PIText(this,"LogScale",int(2.5*bsx),bsy,cpx+bsx+spx,cpy); 700 702 mText[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 701 SetText();702 703 703 704 // Labels et curseur mobile 704 705 cpy += bsy+spy; 705 mLab[3] = new PILabel(this, " PerPt: ",bsx,bsy,cpx,cpy+0.25*bsy);706 mLab[3] = new PILabel(this," PerPt: ",bsx,bsy,cpx,cpy+int(0.25*bsy)); 706 707 mLab[3]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 707 708 mPScal = new PIScale(this,"FracPoints",6401,kSDirLtoR 708 ,int(2.5*bsx), 1.25*bsy,cpx+bsx+spx,cpy);709 ,int(2.5*bsx),int(1.25*bsy),cpx+bsx+spx,cpy); 709 710 mPScal->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 710 711 mPScal->SetMinMax(0,100); 711 int imfp = mFPoints*100.f; mPScal->SetValue(imfp);712 SetText(); 712 713 713 714 // Boutons 714 715 cpx = 2*bsx+5*spx, cpy = 2*spy; 715 mBut[0] = new PIButton(this, "Apply",6001,bsx,bsy,cpx,cpy);716 mBut[0] = new PIButton(this,"Apply",6001,bsx,bsy,cpx,cpy); 716 717 mBut[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 717 718 cpy += bsy+spy; 718 mBut[1] = new PIButton(this, 719 mBut[1] = new PIButton(this,"Dismiss",6002,bsx,bsy,cpx,cpy); 719 720 mBut[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 720 721 cpy += bsy+spy; 721 mBut[2] = new PIButton(this, "Get" ,6003,bsx,bsy,cpx,cpy);722 mBut[2] = new PIButton(this,"Get",6003,bsx,bsy,cpx,cpy); 722 723 mBut[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 723 724 cpy += bsy+spy; 724 mBut[3] = new PIButton(this, "Print",6004,bsx,bsy,cpx,cpy);725 mBut[3] = new PIButton(this,"Print",6004,bsx,bsy,cpx,cpy); 725 726 mBut[3]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 726 727 // FinishCreate(); … … 740 741 for(i=0;i<4;i++) delete mLab[i]; 741 742 for(i=0;i<3;i++) delete mText[i]; 743 delete mCkb; 742 744 delete mPScal; 743 745 } … … 758 760 mText[2]->SetText(str); 759 761 760 if(mTypDisp==0) { 761 else if(mTypDisp==1) { 762 else if(mTypDisp==2) { 763 else if(mTypDisp==3) { 764 765 if(mTypScal==0) { 766 else if(mTypScal==1) { 762 if(mTypDisp==0) {sdum="Carres Var."; mOPop[0]->SetValueStr(sdum);} 763 else if(mTypDisp==1) {sdum="....."; mOPop[0]->SetValueStr(sdum);} 764 else if(mTypDisp==2) {sdum=".+12..Z*"; mOPop[0]->SetValueStr(sdum);} 765 else if(mTypDisp==3) {sdum="Carres Pleins"; mOPop[0]->SetValueStr(sdum);} 766 767 if(mTypScal==0) {sdum="Lineaire"; mOPop[1]->SetValueStr(sdum);} 768 else if(mTypScal==1) {sdum="Log10"; mOPop[1]->SetValueStr(sdum);} 767 769 768 770 if(!mFgCol) {mOPop[2]->SetValue(7000);} … … 772 774 {mOPop[2]->SetValue(7001+kk); break;} 773 775 } 776 mCkb->SetState(mRevCmap); 777 778 mPScal->SetValue(int(mFPoints*100.)); 774 779 775 780 if(dbg)printf("H2WinArg::SetText\n"); 776 }777 778 //++779 void H2WinArg::GetText()780 //781 // Gestion des fenetres de saisie de texte.782 //--783 {784 sscanf(mText[0]->GetText().c_str(),"%g %g",&mHMin,&mHMax);785 sscanf(mText[1]->GetText().c_str(),"%g %g",&mFracMin,&mFracMax);786 sscanf(mText[2]->GetText().c_str(),"%g",&mLogScale);787 if(dbg) printf("H2WinArg::GetText\n");788 781 } 789 782 … … 806 799 { 807 800 if(dbg) printf("PIH2DWdg::Process(%d-%d , %lx ...) \n" 808 ,(int)UserMsg(msg),(int)ModMsg(msg), 801 ,(int)UserMsg(msg),(int)ModMsg(msg),(long)sender); 809 802 810 803 if(!mH2Wdg) return; … … 813 806 814 807 int opt = UserMsg(msg); 815 if (opt == 6101) { mTypDisp = 0;}816 else if (opt == 6102) { mTypDisp = 1;}817 else if (opt == 6103) { mTypDisp = 2;}818 else if (opt == 6104) { mTypDisp = 3;}819 820 else if (opt == 6201) { mTypScal = 0;}821 else if (opt == 6202) { mTypScal = 1;}822 823 else if (opt == 7000) { mFgCol = false;}824 825 else if 808 if(opt == 6101) {mTypDisp = 0;} 809 else if(opt == 6102) {mTypDisp = 1;} 810 else if(opt == 6103) {mTypDisp = 2;} 811 else if(opt == 6104) {mTypDisp = 3;} 812 813 else if(opt == 6201) {mTypScal = 0;} 814 else if(opt == 6202) {mTypScal = 1;} 815 816 else if(opt == 7000) {mFgCol = false;} 817 818 else if(opt >= 7001 && opt <8000) { 826 819 int k = opt-7001; 827 820 mFgCol = true; … … 829 822 } 830 823 831 else if (opt == 6401) mFPoints = mPScal->GetValue()/100.; 832 833 else if (opt==6001) { 834 GetText(); 835 mpih->UseColors(mFgCol, mCmap); 824 else if(opt == 8001) mRevCmap = mCkb->GetState(); 825 826 else if(opt == 6401) mFPoints = mPScal->GetValue()/100.; 827 828 else if(opt==6001) { 829 sscanf(mText[0]->GetText().c_str(),"%g %g",&mHMin,&mHMax); 830 sscanf(mText[1]->GetText().c_str(),"%g %g",&mFracMin,&mFracMax); 831 sscanf(mText[2]->GetText().c_str(),"%g",&mLogScale); 832 mpih->UseColors(mFgCol,mCmap,mRevCmap); 836 833 mpih->UseScale(mTypScal,mLogScale); 837 834 mpih->UseDisplay(mTypDisp,mFPoints); … … 840 837 mH2Wdg->Refresh(); // On rafraichit le dessin (tout le PIScDrawWdg) 841 838 } 842 else if (opt==6002) { 843 this->Hide(); 844 } 839 else if(opt==6002) this->Hide(); 845 840 else if (opt==6003) { 846 mFgCol = mpih->Color(); 847 mCmap = mpih->ColMap(); 848 mTypScal = mpih->TypScale(); 849 mTypDisp = mpih->TypDisplay(); 850 mFPoints = mpih->FPoints(); 851 mHMin = mpih->HMin(); 852 mHMax = mpih->HMax(); 853 mFracMin = mpih->FMin(); 854 mFracMax = mpih->FMax(); 855 mLogScale = mpih->LogScale(); 841 mFgCol = mpih->Color(); mCmap = mpih->ColMap(); 842 mRevCmap = mpih->IsColMapRev(); 843 mTypScal = mpih->TypScale(); mLogScale = mpih->LogScale(); 844 mTypDisp = mpih->TypDisplay(); mFPoints = mpih->FPoints(); 845 mHMin = mpih->HMin(); mHMax = mpih->HMax(); 846 mFracMin = mpih->FMin(); mFracMax = mpih->FMax(); 856 847 SetText(); 857 848 } 858 else if (opt==6004) { 859 mpih->Print(2); 860 } 849 else if(opt==6004) mpih->Print(2); 861 850 862 851 if(dbg) { 863 printf("H2WinArg::Process opt=%d col=%d,%d scal=%d disp=%d npt=%g\n"864 ,opt,(int) mFgCol,(int) mCmap,mTypScal,mTypDisp,mFPoints);852 printf("H2WinArg::Process opt=%d col=%d,%d,%d scal=%d disp=%d npt=%g\n" 853 ,opt,(int)mFgCol,(int)mCmap,(int)mRevCmap,mTypScal,mTypDisp,mFPoints); 865 854 printf(" min,max= %g,%g frac= %g,%g logsc= %g\n" 866 855 ,mHMin,mHMax,mFracMin,mFracMax,mLogScale); -
trunk/SophyaPI/PIext/pihisto2d.h
r1297 r1850 18 18 class PIHisto2D : public PIDrawer { 19 19 public: 20 PIHisto2D(Histo2D* histo, bool ad=false); 21 virtual ~PIHisto2D(); 22 void UseColors(bool fg=false, CMapId cmap=CMAP_GREYINV32); 23 void UseScale(unsigned short type=0,float logscale=10.); 24 void UseDisplay(unsigned short type=0, float fnpt=0.5); 25 void UseDyn(float hmin=1., float hmax=-1.); 26 void UseFrac(float frmin=0.1, float frmax=0.9); 27 void Print(int lp=0); 28 virtual void Draw(PIGraphicUC* g,double xmin,double ymin,double xmax,double ymax); 29 virtual void UpdateLimits(); 30 virtual void DrawStats(PIGraphicUC* g); 20 PIHisto2D(Histo2D* histo, bool ad=false); 21 virtual ~PIHisto2D(); 31 22 32 inline Histo2D* Histogram() { return(mHisto); } 33 inline bool Color() { return(mFgCol); } 34 inline CMapId ColMap() { return(mCmap); } 35 inline unsigned short TypScale() { return(mTypScal); } 36 inline unsigned short TypDisplay() { return(mTypDisp); } 37 inline float FPoints() { return(mFPoints); } 38 inline float HMax() { return(mHMax);} 39 inline float HMin() { return(mHMin);} 40 inline float FMax() { return(mFracMax);} 41 inline float FMin() { return(mFracMin);} 42 inline float LogScale() { return(mLogScale);} 23 void UseColors(bool fg=false,CMapId cmap=CMAP_GREYINV32,bool revcmap=false); 24 void UseScale(unsigned short type=0,float logscale=10.); 25 void UseDisplay(unsigned short type=0,float fnpt=0.5); 26 void UseDyn(float hmin=1.,float hmax=-1.); 27 void UseFrac(float frmin=0.1,float frmax=0.9); 28 void Print(int lp=0); 29 30 virtual void Draw(PIGraphicUC* g,double xmin,double ymin,double xmax,double ymax); 31 virtual void UpdateLimits(); 32 virtual void DrawStats(PIGraphicUC* g); 33 34 inline Histo2D* Histogram() {return(mHisto);} 35 inline bool Color() {return(mFgCol);} 36 inline CMapId ColMap() {return(mCmap);} 37 inline bool IsColMapRev() {return(mRevCmap);} 38 inline unsigned short TypScale() {return(mTypScal);} 39 inline unsigned short TypDisplay() {return(mTypDisp);} 40 inline float FPoints() {return(mFPoints);} 41 inline float HMax() {return(mHMax);} 42 inline float HMin() {return(mHMin);} 43 inline float FMax() {return(mFracMax);} 44 inline float FMin() {return(mFracMin);} 45 inline float LogScale() {return(mLogScale);} 43 46 44 47 protected: … … 48 51 Histo2D* mHisto; 49 52 bool mAdDO; 50 bool mFgCol; 51 CMapId mCmap; 52 unsigned short mTypScal; 53 unsigned short mTypDisp; 54 float mFPoints; 53 bool mFgCol; CMapId mCmap; bool mRevCmap; 54 unsigned short mTypScal; float mLogScale; 55 unsigned short mTypDisp; float mFPoints; 55 56 float mHMin,mHMax; 56 57 float mFracMin,mFracMax; 57 float mLogScale;58 58 }; 59 59 … … 61 61 class PIH2DWdg : public PIScDrawWdg { 62 62 public: 63 PIH2DWdg(PIContainerGen *par, const char *nom, int sx=300, int sy=300, 64 int px=0, int py=0); 65 ~PIH2DWdg(); 63 PIH2DWdg(PIContainerGen *par,const char *nom,int sx=300,int sy=300,int px=0,int py=0); 64 ~PIH2DWdg(); 66 65 67 void SetHisto(Histo2D* histo); 68 void SetPIHisto(PIHisto2D* pih2); 69 inline PIHisto2D* GetPIHisto() {return mPih;} 66 void SetHisto(Histo2D* histo); 67 void SetPIHisto(PIHisto2D* pih2); 70 68 71 virtual string GetClickText(double x, double y); 72 virtual void ActivateSpecializedControls(); // Pour activer des controles specifiques 73 virtual void But3Press(int x, int y); 69 inline PIHisto2D* GetPIHisto() {return mPih;} 70 71 virtual string GetClickText(double x, double y); 72 virtual void ActivateSpecializedControls(); // Pour activer des controles specifiques 73 virtual void But3Press(int x, int y); 74 74 75 75 protected: 76 76 PIHisto2D* mPih; 77 78 77 }; 79 78 … … 81 80 class H2WinArg : public PIWindow { 82 81 public : 83 H2WinArg(PIH2DWdg *par); 84 ~H2WinArg(); 85 void SetPIH2DWdg(PIH2DWdg* h2wdg); 86 void SetText(); 87 void GetText(); 88 virtual void Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL); 82 H2WinArg(PIH2DWdg *par); 83 ~H2WinArg(); 84 85 void SetPIH2DWdg(PIH2DWdg* h2wdg); 86 void SetText(); 87 88 virtual void Process(PIMessage msg,PIMsgHandler* sender,void* data=NULL); 89 89 90 90 protected: … … 97 97 PIText * mText[3]; 98 98 PIScale * mPScal; 99 PICheckBox* mCkb; 99 100 100 bool mFgCol; 101 CMapId mCmap; 102 unsigned short mTypScal; 103 unsigned short mTypDisp; 104 float mFPoints; 101 bool mFgCol; CMapId mCmap; bool mRevCmap; 102 unsigned short mTypScal; float mLogScale; 103 unsigned short mTypDisp; float mFPoints; 105 104 float mHMin,mHMax; 106 105 float mFracMin,mFracMax; 107 float mLogScale;108 106 }; 109 107
Note:
See TracChangeset
for help on using the changeset viewer.