TH2Editor.h

Go to the documentation of this file.
00001 // @(#)root/ged:$Id: TH2Editor.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Carsten Hof 08/08/04
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TH2Editor
00013 #define ROOT_TH2Editor
00014 
00015 //////////////////////////////////////////////////////////////////////////
00016 //                                                                      //
00017 //  TH2Editor                                                           //
00018 //                                                                      //
00019 //  Editor changing histogram attributes                                //
00020 //                                                                      //
00021 //////////////////////////////////////////////////////////////////////////
00022 
00023 #ifndef ROOT_TGedFrame
00024 #include "TGedFrame.h"
00025 #endif
00026 
00027 class TH2;
00028 class TGComboBox;
00029 class TGLabel;
00030 class TGTextEntry;
00031 class TGCheckButton;
00032 class TString;
00033 class TGDoubleHSlider;
00034 class TGHSlider;
00035 class TGNumberEntry;
00036 class TGHButtonGroup;
00037 class TGRadioButton;
00038 class TGNumberEntryField;
00039 class TGColorSelect;
00040 class TGedPatternSelect;
00041 class TGTextButton;
00042 
00043 class TH2Editor : public TGedFrame {
00044 
00045 protected:
00046    TH2                 *fHist;            // histogram object
00047    TGCompositeFrame    *fBin;             // Contains the Binning Widgets
00048    TGCompositeFrame    *fFit;             // Contains the Fitting Widgets
00049    TGTextEntry         *fTitle;           // histogram title input field
00050    TGComboBox          *fTypeCombo;       // histogram type combo box
00051    TGComboBox          *fCoordsCombo;     // Coordinate System combo box
00052    TGComboBox          *fContCombo;       // Contour selecting combo box
00053    TGLabel             *fColContLbl;      // No. of Contours Label 1
00054    TGLabel             *fColContLbl1;     // No. of Contours Label 2
00055    Int_t                fTitlePrec;       // font precision level
00056    TGHButtonGroup      *fDimGroup;        // Radiobuttongroup to change 2D <-> 3D-Plot
00057    TGRadioButton       *fDim;             // 2D-Plot RadioButton
00058    TGRadioButton       *fDim0;            // 3D-Plot RadioButton
00059    TGLayoutHints       *fDimlh;           // layout hints for 2D-Plot RadioButton
00060    TGLayoutHints       *fDim0lh;          // layout hints for 3D-Plot RadioButton
00061    TGCompositeFrame    *f6;               // Frame that contains the 2D CheckBox DrawOptions
00062    TGCompositeFrame    *f9;               // Frame that contains the 3D CheckBox DrawOptions
00063    TGCompositeFrame    *f12;              // Frame that contains the Bar-Title
00064    TGCompositeFrame    *f13;              // Frame that contains the Bar Width/Offset NumberEntries
00065    TGCompositeFrame    *f38;              // Frame that contains the Frame Fill widgets
00066    TGCheckButton       *fAddError;        // CheckBox connected to error bars
00067    TGCheckButton       *fAddPalette;      // CheckBox connected to Z option (2D)
00068    TGCheckButton       *fAddPalette1;     // CheckBox connected to Z option (3D)
00069    TGCheckButton       *fAddArr;          // CheckBox connected to Arr-Option
00070    TGCheckButton       *fAddBox;          // CheckBox connected to Box-Option
00071    TGCheckButton       *fAddScat;         // CheckBox connected to Scat-Option
00072    TGCheckButton       *fAddCol;          // CheckBox connected to Col-Option
00073    TGCheckButton       *fAddFB;           // Draw front box (or not)
00074    TGCheckButton       *fAddBB;           // Draw back box (or not)
00075    TGCheckButton       *fAddText;         // Draw bin contents as text
00076    TGNumberEntry       *fContLevels;      // Set number of contour levels
00077    TGNumberEntry       *fContLevels1;     // Set number of contour levels
00078    TGNumberEntry       *fBarWidth;        // Set bar width of histogram
00079    TGNumberEntry       *fBarOffset;       // Set bar offset of histogram
00080    TGCompositeFrame    *fBinXCont;        // Contains the rebin widgets for case 1
00081    TGHSlider           *fBinXSlider;      // Slider to set rebinning x integer value
00082    TGNumberEntryField  *fBinXNumberEntry; // Label which shows the rebinned bin number
00083    TGHSlider           *fBinYSlider;      // Slider to set rebinning y integer value
00084    TGNumberEntryField  *fBinYNumberEntry; // Label which shows the rebinned bin number
00085    TGTextButton        *fApply;           // Apply-Button to accept the rebinned histogram
00086    TGTextButton        *fCancel;          // Cancel-Button to reprobate the rebinned histogram
00087    TGCompositeFrame    *fBinXCont1;       // Contains the X Rebin Widgets for case 2
00088    TGHSlider           *fBinXSlider1;     // Slider to set x rebinning integer value
00089    TGNumberEntryField  *fBinXNumberEntry1;// Label which shows the rebinned x bin number
00090    TGNumberEntryField  *fXOffsetNumberEntry; // Shows the offset to the x origin of the histogram
00091    TGHSlider           *fXBinOffsetSld;   // Add an x-offset to the origin of the histogram
00092 
00093    TGCompositeFrame    *fBinYCont1;       // Contains the Y Rebin Widgets for case 2
00094    TGHSlider           *fBinYSlider1;     // Slider to set y rebinning integer value
00095    TGNumberEntryField  *fBinYNumberEntry1;// Label which shows the rebinned y bin number
00096    TGNumberEntryField  *fYOffsetNumberEntry; // Shows the offset to the y origin of the histogram
00097    TGHSlider           *fYBinOffsetSld;   // Add an y-offset to the origin of the histogram
00098    TGDoubleHSlider     *fSliderX;         // Slider to set x-axis range
00099    TGNumberEntryField  *fSldXMin;         // Contains the minimum value of the x-Axis
00100    TGNumberEntryField  *fSldXMax;         // Contains the maximum value of the x-Axis
00101    TGDoubleHSlider     *fSliderY;         // Slider to set y-axis range
00102    TGNumberEntryField  *fSldYMin;         // Contains the minimum value of the y-Axis
00103    TGNumberEntryField  *fSldYMax;         // Contains the maximum value of the y-Axis
00104    TGCheckButton       *fDelaydraw;       // Delayed drawing of the new axis range
00105    TGColorSelect       *fFrameColor;      // Select the Frame Color
00106    TGedPatternSelect   *fFramePattern;    // Select the Frame Pattern Style
00107    TString              fCutString;       // Contais info about graphical cuts (if any)
00108 
00109    static  TGComboBox *BuildHistTypeComboBox(TGFrame *parent, Int_t id);
00110    static  TGComboBox *BuildHistCoordsComboBox(TGFrame *parent, Int_t id);
00111    static  TGComboBox *BuildHistContComboBox(TGFrame* parent, Int_t id);
00112 
00113    virtual void   ConnectSignals2Slots();
00114            void   CreateBinTab();       // Creates the Bin Tab (part of the SetGedEditor)
00115 
00116 private:
00117    void    PaintBox3D(Float_t *p1, Float_t *p2,Float_t *p3, Float_t *p4);
00118    TString GetHistTypeLabel();
00119    TString GetHistCoordsLabel();
00120    TString GetHistContLabel();
00121    TString GetHistAdditiveLabel();
00122    TString GetCutOptionString();
00123 
00124    Int_t     fPx1old,
00125              fPy1old,
00126              fPx2old,
00127              fPy2old;
00128    Float_t   fP1oldx[3],
00129              fP2oldx[3],
00130              fP3oldx[3],
00131              fP4oldx[3],
00132              fP5oldx[3],
00133              fP6oldx[3],
00134              fP7oldx[3],
00135              fP8oldx[3];
00136    Float_t   fP1oldy[3],
00137              fP2oldy[3],
00138              fP3oldy[3],
00139              fP4oldy[3],
00140              fP5oldy[3],
00141              fP6oldy[3],
00142              fP7oldy[3],
00143              fP8oldy[3];
00144    TH2      *fBinHist;         // Cloned histogram for rebin
00145    Double_t  fOldXOffset;      // saves the old x offset of the histogram
00146    Double_t  fOldYOffset;      // saves the old y offset of the histogram
00147 
00148 public:
00149    TH2Editor(const TGWindow *p = 0, 
00150              Int_t width = 140, Int_t height = 30,
00151              UInt_t options = kChildFrame,
00152              Pixel_t back = GetDefaultFrameBackground());
00153    virtual ~TH2Editor();
00154 
00155    virtual Bool_t AcceptModel(TObject* model);
00156    virtual void   SetModel(TObject* obj);
00157    virtual void   ActivateBaseClassEditors(TClass* cl);
00158 
00159    virtual void DoTitle(const char *text);
00160    virtual void DoHistView();
00161    virtual void DoHistSimple();
00162    virtual void DoHistComplex();
00163    virtual void DoHistChanges();
00164    virtual void DoAddArr(Bool_t on);
00165    virtual void DoAddBox(Bool_t on);
00166    virtual void DoAddCol(Bool_t on);
00167    virtual void DoAddScat(Bool_t on);
00168    virtual void DoAddText(Bool_t on);
00169    virtual void DoAddError(Bool_t on);
00170    virtual void DoAddPalette(Bool_t on);
00171    virtual void DoAddFB();
00172    virtual void DoAddBB();
00173    virtual void DoContLevel();
00174    virtual void DoContLevel1();
00175    virtual void DoBarWidth();
00176    virtual void DoBarOffset();
00177    virtual void DoBinPressed();
00178    virtual void DoBinMoved();
00179    virtual void DoBinReleased();
00180    virtual void DoBinLabel();
00181    virtual void DoApply();
00182    virtual void DoCancel();
00183    virtual void DoBinReleased1();
00184    virtual void DoBinMoved1();
00185    virtual void DoBinLabel1();
00186    virtual void DoOffsetMoved();
00187    virtual void DoOffsetReleased();
00188    virtual void DoOffsetPressed();
00189    virtual void DoBinOffset();
00190    virtual void DoSliderXMoved();
00191    virtual void DoSliderXPressed();
00192    virtual void DoSliderXReleased();
00193    virtual void DoXAxisRange();
00194    virtual void DoSliderYMoved();
00195    virtual void DoSliderYPressed();
00196    virtual void DoSliderYReleased();
00197    virtual void DoYAxisRange();
00198    virtual void DoFillColor(Pixel_t);
00199    virtual void DoFillPattern(Style_t);
00200 
00201    Int_t* Dividers(Int_t n);
00202 
00203    ClassDef(TH2Editor,0)  // TH2 editor
00204 };
00205 
00206 #endif
00207 

Generated on Tue Jul 5 14:19:26 2011 for ROOT_528-00b_version by  doxygen 1.5.1