Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TGL5DDataSetEditor.h
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Bertrand Bellenot 2009
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2009, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TGL5DDataSetEditor
13 #define ROOT_TGL5DDataSetEditor
14 
15 #include "TGedFrame.h"
16 #include "GuiTypes.h"
17 #include "TGLUtil.h"
18 
19 class TGNumberEntryField;
20 class TGDoubleHSlider;
21 class TGNumberEntry;
22 class TGCheckButton;
23 class TGColorSelect;
24 class TGTextButton;
25 class TGL5DPainter;
26 class TGL5DDataSet;
27 class TGListBox;
28 class TGHSlider;
29 
30 class TGL5DDataSetEditor : public TGedFrame {
31 private:
32  //Widgets for "Grid" tab.
33  TGNumberEntry *fNCellsXEntry; //Number of cells along X.
34  TGNumberEntry *fNCellsYEntry; //Number of cells along Y.
35  TGNumberEntry *fNCellsZEntry; //Number of cells along Z.
36 
37  TGDoubleHSlider *fXRangeSlider; //Slider for X range.
38  TGNumberEntryField *fXRangeSliderMin; //Number entry for slider's min.
39  TGNumberEntryField *fXRangeSliderMax; //Number entry for slider's max.
40 
41  TGDoubleHSlider *fYRangeSlider; //Slider for Y range.
42  TGNumberEntryField *fYRangeSliderMin; //Number entry for slider's min.
43  TGNumberEntryField *fYRangeSliderMax; //Number entry for slider's max.
44 
45  TGDoubleHSlider *fZRangeSlider; //Slider for Z range.
46  TGNumberEntryField *fZRangeSliderMin; //Number entry for slider's min.
47  TGNumberEntryField *fZRangeSliderMax; //Number entry for slider's max.
48 
49  TGTextButton *fCancelGridBtn; //"Cancel" button.
50  TGTextButton *fOkGridBtn; //"Apply" button.
51 
52  //Widgets for "Surfaces" tab.
53  TGNumberEntryField *fV4MinEntry; //Read only widget.
54  TGNumberEntryField *fV4MaxEntry; //Read only widget.
55 
56  TGCheckButton *fHighlightCheck; //Highlight selected surface.
57  TGListBox *fIsoList; //List box to select surface.
58 
59  TGCheckButton *fVisibleCheck; //Show/hide surface.
60  TGCheckButton *fShowCloud; //Show/hide points for surface.
61 
62  TGColorSelect *fSurfColorSelect; //Open color dialog.
63  TGHSlider *fSurfAlphaSlider; //Slider to control transparency.
64  TGTextButton *fSurfRemoveBtn; //Remove selected surface.
65 
66  TGNumberEntry *fNewIsoEntry; //Set the iso-level for new surface.
67  TGTextButton *fAddNewIsoBtn; //Button to add new iso.
68 
69  //Widgets for "Style" tab.
70  TGCheckButton *fShowBoxCut;
71  TGNumberEntry *fNumberOfPlanes;
72  TGNumberEntry *fAlpha;
73  TGCheckButton *fLogScale;
74  TGDoubleHSlider *fSlideRange;
75 
76  TGTextButton *fApplyAlpha;
77  TGTextButton *fApplyPlanes;
78 
79  //Model
80  TGL5DDataSet *fDataSet; //Data adapter for TTree.
81  TGL5DPainter *fPainter; //Painter.
82 
83  void ConnectSignals2Slots();
84 
85  //Copy ctor and copy-assignment operator. Only
86  //declarations, no definitions.
87  TGL5DDataSetEditor(const TGL5DDataSetEditor &);
88  TGL5DDataSetEditor &operator = (const TGL5DDataSetEditor &);
89 
90  void CreateStyleTab();
91  void CreateGridTab();
92  void CreateIsoTab();
93 
94  void SetStyleTabWidgets();
95  void SetGridTabWidgets();
96  void SetIsoTabWidgets();
97 
98  void EnableGridTabButtons();
99  void DisableGridTabButtons();
100 
101  void EnableSurfaceControls();
102  void DisableSurfaceControls();
103 
104  //This will hold vector of list iterators
105  //(list of surfaces). I use this to avoid
106  //including TGL5DPainter here (SurfIter_t
107  //is a typedef inside TGL5DPainter).
108  class TGL5DEditorPrivate;
109  TGL5DEditorPrivate *fHidden;
110 
111  Int_t fSelectedSurface;
112 
113 public:
114  TGL5DDataSetEditor(const TGWindow *p = 0, Int_t width = 140, Int_t height = 30,
115  UInt_t options = kChildFrame, Pixel_t back = GetDefaultFrameBackground());
116  ~TGL5DDataSetEditor();
117 
118  virtual void SetModel(TObject* obj);
119 
120  //Slots for "Grid" tab events.
121  void GridParametersChanged();
122  void XSliderChanged();
123  void YSliderChanged();
124  void ZSliderChanged();
125  void XSliderSetMin();
126  void XSliderSetMax();
127  void YSliderSetMin();
128  void YSliderSetMax();
129  void ZSliderSetMin();
130  void ZSliderSetMax();
131  void RollbackGridParameters();
132  void ApplyGridParameters();
133  //Slots for "Surfaces" tab events.
134  void HighlightClicked();
135  void SurfaceSelected(Int_t id);
136  void VisibleClicked();
137  void ColorChanged(Pixel_t pixelColor);
138  void AlphaChanged(Int_t alpha);
139  void RemoveSurface();
140  void AddNewSurface();
141  //Slots for "Style" tab events.
142  void ApplyAlpha();
143  void ApplyPlanes();
144  void BoxCutToggled();
145  void AlphaChanged();
146  void NContoursChanged();
147 
148 
149  ClassDef(TGL5DDataSetEditor, 0); //GUI for editing OpenGL 5D Viewer attributes
150 };
151 
152 #endif