File indexing completed on 2025-01-18 10:12:08
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TH2Editor
0013 #define ROOT_TH2Editor
0014
0015
0016 #include "TGedFrame.h"
0017
0018 class TH2;
0019 class TGComboBox;
0020 class TGLabel;
0021 class TGTextEntry;
0022 class TGCheckButton;
0023 class TString;
0024 class TGDoubleHSlider;
0025 class TGHSlider;
0026 class TGNumberEntry;
0027 class TGHButtonGroup;
0028 class TGRadioButton;
0029 class TGNumberEntryField;
0030 class TGColorSelect;
0031 class TGedPatternSelect;
0032 class TGTextButton;
0033
0034 class TH2Editor : public TGedFrame {
0035
0036 protected:
0037 TH2 *fHist;
0038 TGCompositeFrame *fBin;
0039 TGCompositeFrame *fFit;
0040 TGTextEntry *fTitle;
0041 TGComboBox *fTypeCombo;
0042 TGComboBox *fCoordsCombo;
0043 TGComboBox *fContCombo;
0044 TGLabel *fColContLbl;
0045 TGLabel *fColContLbl1;
0046 Int_t fTitlePrec;
0047 TGHButtonGroup *fDimGroup;
0048 TGRadioButton *fDim;
0049 TGRadioButton *fDim0;
0050 TGLayoutHints *fDimlh;
0051 TGLayoutHints *fDim0lh;
0052 TGCompositeFrame *f6;
0053 TGCompositeFrame *f9;
0054 TGCompositeFrame *f12;
0055 TGCompositeFrame *f13;
0056 TGCompositeFrame *f38;
0057 TGCheckButton *fAddError;
0058 TGCheckButton *fAddPalette;
0059 TGCheckButton *fAddPalette1;
0060 TGCheckButton *fAddArr;
0061 TGCheckButton *fAddBox;
0062 TGCheckButton *fAddScat;
0063 TGCheckButton *fAddCol;
0064 TGCheckButton *fAddFB;
0065 TGCheckButton *fAddBB;
0066 TGCheckButton *fAddText;
0067 TGNumberEntry *fContLevels;
0068 TGNumberEntry *fContLevels1;
0069 TGNumberEntry *fBarWidth;
0070 TGNumberEntry *fBarOffset;
0071 TGCompositeFrame *fBinXCont;
0072 TGHSlider *fBinXSlider;
0073 TGNumberEntryField *fBinXNumberEntry;
0074 TGHSlider *fBinYSlider;
0075 TGNumberEntryField *fBinYNumberEntry;
0076 TGTextButton *fApply;
0077 TGTextButton *fCancel;
0078 TGCompositeFrame *fBinXCont1;
0079 TGHSlider *fBinXSlider1;
0080 TGNumberEntryField *fBinXNumberEntry1;
0081 TGNumberEntryField *fXOffsetNumberEntry;
0082 TGHSlider *fXBinOffsetSld;
0083
0084 TGCompositeFrame *fBinYCont1;
0085 TGHSlider *fBinYSlider1;
0086 TGNumberEntryField *fBinYNumberEntry1;
0087 TGNumberEntryField *fYOffsetNumberEntry;
0088 TGHSlider *fYBinOffsetSld;
0089 TGDoubleHSlider *fSliderX;
0090 TGNumberEntryField *fSldXMin;
0091 TGNumberEntryField *fSldXMax;
0092 TGDoubleHSlider *fSliderY;
0093 TGNumberEntryField *fSldYMin;
0094 TGNumberEntryField *fSldYMax;
0095 TGCheckButton *fDelaydraw;
0096 TGColorSelect *fFrameColor;
0097 TGedPatternSelect *fFramePattern;
0098 TString fCutString;
0099
0100 static TGComboBox *BuildHistTypeComboBox(TGFrame *parent, Int_t id);
0101 static TGComboBox *BuildHistCoordsComboBox(TGFrame *parent, Int_t id);
0102 static TGComboBox *BuildHistContComboBox(TGFrame* parent, Int_t id);
0103
0104 virtual void ConnectSignals2Slots();
0105 void CreateBinTab();
0106
0107 private:
0108 void PaintBox3D(Float_t *p1, Float_t *p2,Float_t *p3, Float_t *p4);
0109 TString GetHistTypeLabel();
0110 TString GetHistCoordsLabel();
0111 TString GetHistContLabel();
0112 TString GetHistAdditiveLabel();
0113 TString GetCutOptionString();
0114
0115 Int_t fPx1old,
0116 fPy1old,
0117 fPx2old,
0118 fPy2old;
0119 Float_t fP1oldx[3],
0120 fP2oldx[3],
0121 fP3oldx[3],
0122 fP4oldx[3],
0123 fP5oldx[3],
0124 fP6oldx[3],
0125 fP7oldx[3],
0126 fP8oldx[3];
0127 Float_t fP1oldy[3],
0128 fP2oldy[3],
0129 fP3oldy[3],
0130 fP4oldy[3],
0131 fP5oldy[3],
0132 fP6oldy[3],
0133 fP7oldy[3],
0134 fP8oldy[3];
0135 TH2 *fBinHist;
0136 Double_t fOldXOffset;
0137 Double_t fOldYOffset;
0138
0139 public:
0140 TH2Editor(const TGWindow *p = nullptr,
0141 Int_t width = 140, Int_t height = 30,
0142 UInt_t options = kChildFrame,
0143 Pixel_t back = GetDefaultFrameBackground());
0144 ~TH2Editor() override;
0145
0146 Bool_t AcceptModel(TObject* model) override;
0147 void SetModel(TObject* obj) override;
0148 void ActivateBaseClassEditors(TClass* cl) override;
0149
0150 virtual void DoTitle(const char *text);
0151 virtual void DoHistView();
0152 virtual void DoHistSimple();
0153 virtual void DoHistComplex();
0154 virtual void DoHistChanges();
0155 virtual void DoAddArr(Bool_t on);
0156 virtual void DoAddBox(Bool_t on);
0157 virtual void DoAddCol(Bool_t on);
0158 virtual void DoAddScat(Bool_t on);
0159 virtual void DoAddText(Bool_t on);
0160 virtual void DoAddError(Bool_t on);
0161 virtual void DoAddPalette(Bool_t on);
0162 virtual void DoAddFB();
0163 virtual void DoAddBB();
0164 virtual void DoContLevel();
0165 virtual void DoContLevel1();
0166 virtual void DoBarWidth();
0167 virtual void DoBarOffset();
0168 virtual void DoBinPressed();
0169 virtual void DoBinMoved();
0170 virtual void DoBinReleased();
0171 virtual void DoBinLabel();
0172 virtual void DoApply();
0173 virtual void DoCancel();
0174 virtual void DoBinReleased1();
0175 virtual void DoBinMoved1();
0176 virtual void DoBinLabel1();
0177 virtual void DoOffsetMoved();
0178 virtual void DoOffsetReleased();
0179 virtual void DoOffsetPressed();
0180 virtual void DoBinOffset();
0181 virtual void DoSliderXMoved();
0182 virtual void DoSliderXPressed();
0183 virtual void DoSliderXReleased();
0184 virtual void DoXAxisRange();
0185 virtual void DoSliderYMoved();
0186 virtual void DoSliderYPressed();
0187 virtual void DoSliderYReleased();
0188 virtual void DoYAxisRange();
0189 virtual void DoFillColor(Pixel_t);
0190 virtual void DoFillPattern(Style_t);
0191
0192 Int_t* Dividers(Int_t n);
0193
0194 void RecursiveRemove(TObject* obj) override;
0195
0196 ClassDefOverride(TH2Editor,0)
0197 };
0198
0199 #endif
0200