ROOT logo
// @(#)root/gl:$Id: TGL5DDataSetEditor.h 29602 2009-07-28 10:23:20Z brun $
// Author: Bertrand Bellenot 2009

/*************************************************************************
 * Copyright (C) 1995-2009, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TGL5DDataSetEditor
#define ROOT_TGL5DDataSetEditor

#ifndef ROOT_TGedFrame
#include "TGedFrame.h"
#endif
#ifndef ROOT_GuiTypes
#include "GuiTypes.h"
#endif
#ifndef ROOT_TGLUtil
#include "TGLUtil.h"
#endif

class TGNumberEntryField;
class TGDoubleHSlider;
class TGNumberEntry;
class TGCheckButton;
class TGColorSelect;
class TGTextButton;
class TGL5DPainter;
class TGL5DDataSet;
class TGListBox;
class TGHSlider;

class TGL5DDataSetEditor : public TGedFrame {
private:
   //Widgets for "Grid" tab.
   TGNumberEntry      *fNCellsXEntry;    //Number of cells along X.
   TGNumberEntry      *fNCellsYEntry;    //Number of cells along Y.
   TGNumberEntry      *fNCellsZEntry;    //Number of cells along Z.

   TGDoubleHSlider    *fXRangeSlider;    //Slider for X range.
   TGNumberEntryField *fXRangeSliderMin; //Number entry for slider's min.
   TGNumberEntryField *fXRangeSliderMax; //Number entry for slider's max.

   TGDoubleHSlider    *fYRangeSlider;    //Slider for Y range.
   TGNumberEntryField *fYRangeSliderMin; //Number entry for slider's min.
   TGNumberEntryField *fYRangeSliderMax; //Number entry for slider's max.

   TGDoubleHSlider    *fZRangeSlider;    //Slider for Z range.
   TGNumberEntryField *fZRangeSliderMin; //Number entry for slider's min.
   TGNumberEntryField *fZRangeSliderMax; //Number entry for slider's max.

   TGTextButton       *fCancelGridBtn;   //"Cancel" button.
   TGTextButton       *fOkGridBtn;       //"Apply" button.

   //Widgets for "Surfaces" tab.
   TGNumberEntryField *fV4MinEntry;      //Read only widget.
   TGNumberEntryField *fV4MaxEntry;      //Read only widget.

   TGCheckButton      *fHighlightCheck;  //Highlight selected surface.
   TGListBox          *fIsoList;         //List box to select surface.

   TGCheckButton      *fVisibleCheck;    //Show/hide surface.
   TGCheckButton      *fShowCloud;       //Show/hide points for surface.

   TGColorSelect      *fSurfColorSelect; //Open color dialog.
   TGHSlider          *fSurfAlphaSlider; //Slider to control transparency.
   TGTextButton       *fSurfRemoveBtn;   //Remove selected surface.

   TGNumberEntry      *fNewIsoEntry;     //Set the iso-level for new surface.
   TGTextButton       *fAddNewIsoBtn;    //Button to add new iso.

   //Widgets for "Style" tab.
   TGCheckButton      *fShowBoxCut;
   TGNumberEntry      *fNumberOfPlanes;
   TGNumberEntry      *fAlpha;
   TGCheckButton      *fLogScale;
   TGDoubleHSlider    *fSlideRange;

   TGTextButton       *fApplyAlpha;
   TGTextButton       *fApplyPlanes;

   //Model
   TGL5DDataSet       *fDataSet;         //Data adapter for TTree.
   TGL5DPainter       *fPainter;         //Painter.

   void ConnectSignals2Slots();

   //Copy ctor and copy-assignment operator. Only
   //declarations, no definitions.
   TGL5DDataSetEditor(const TGL5DDataSetEditor &);
   TGL5DDataSetEditor &operator = (const TGL5DDataSetEditor &);

   void CreateStyleTab();
   void CreateGridTab();
   void CreateIsoTab();

   void SetStyleTabWidgets();
   void SetGridTabWidgets();
   void SetIsoTabWidgets();

   void EnableGridTabButtons();
   void DisableGridTabButtons();

   void EnableSurfaceControls();
   void DisableSurfaceControls();

   //This will hold vector of list iterators
   //(list of surfaces). I use this to avoid
   //including TGL5DPainter here (SurfIter_t
   //is a typedef inside TGL5DPainter).
   class TGL5DEditorPrivate;
   TGL5DEditorPrivate *fHidden;

   Int_t               fSelectedSurface;

public:
   TGL5DDataSetEditor(const TGWindow *p = 0, Int_t width = 140, Int_t height = 30,
                      UInt_t options = kChildFrame, Pixel_t back = GetDefaultFrameBackground());
   ~TGL5DDataSetEditor();

   virtual void   SetModel(TObject* obj);

   //Slots for "Grid" tab events.
   void GridParametersChanged();
   void XSliderChanged();
   void YSliderChanged();
   void ZSliderChanged();
   void XSliderSetMin();
   void XSliderSetMax();
   void YSliderSetMin();
   void YSliderSetMax();
   void ZSliderSetMin();
   void ZSliderSetMax();
   void RollbackGridParameters();
   void ApplyGridParameters();
   //Slots for "Surfaces" tab events.
   void HighlightClicked();
   void SurfaceSelected(Int_t id);
   void VisibleClicked();
   void ColorChanged(Pixel_t pixelColor);
   void AlphaChanged(Int_t alpha);
   void RemoveSurface();
   void AddNewSurface();
   //Slots for "Style" tab events.
   void ApplyAlpha();
   void ApplyPlanes();
   void BoxCutToggled();
   void AlphaChanged();
   void NContoursChanged();


   ClassDef(TGL5DDataSetEditor, 0); //GUI for editing OpenGL 5D Viewer attributes
};

#endif
 TGL5DDataSetEditor.h:1
 TGL5DDataSetEditor.h:2
 TGL5DDataSetEditor.h:3
 TGL5DDataSetEditor.h:4
 TGL5DDataSetEditor.h:5
 TGL5DDataSetEditor.h:6
 TGL5DDataSetEditor.h:7
 TGL5DDataSetEditor.h:8
 TGL5DDataSetEditor.h:9
 TGL5DDataSetEditor.h:10
 TGL5DDataSetEditor.h:11
 TGL5DDataSetEditor.h:12
 TGL5DDataSetEditor.h:13
 TGL5DDataSetEditor.h:14
 TGL5DDataSetEditor.h:15
 TGL5DDataSetEditor.h:16
 TGL5DDataSetEditor.h:17
 TGL5DDataSetEditor.h:18
 TGL5DDataSetEditor.h:19
 TGL5DDataSetEditor.h:20
 TGL5DDataSetEditor.h:21
 TGL5DDataSetEditor.h:22
 TGL5DDataSetEditor.h:23
 TGL5DDataSetEditor.h:24
 TGL5DDataSetEditor.h:25
 TGL5DDataSetEditor.h:26
 TGL5DDataSetEditor.h:27
 TGL5DDataSetEditor.h:28
 TGL5DDataSetEditor.h:29
 TGL5DDataSetEditor.h:30
 TGL5DDataSetEditor.h:31
 TGL5DDataSetEditor.h:32
 TGL5DDataSetEditor.h:33
 TGL5DDataSetEditor.h:34
 TGL5DDataSetEditor.h:35
 TGL5DDataSetEditor.h:36
 TGL5DDataSetEditor.h:37
 TGL5DDataSetEditor.h:38
 TGL5DDataSetEditor.h:39
 TGL5DDataSetEditor.h:40
 TGL5DDataSetEditor.h:41
 TGL5DDataSetEditor.h:42
 TGL5DDataSetEditor.h:43
 TGL5DDataSetEditor.h:44
 TGL5DDataSetEditor.h:45
 TGL5DDataSetEditor.h:46
 TGL5DDataSetEditor.h:47
 TGL5DDataSetEditor.h:48
 TGL5DDataSetEditor.h:49
 TGL5DDataSetEditor.h:50
 TGL5DDataSetEditor.h:51
 TGL5DDataSetEditor.h:52
 TGL5DDataSetEditor.h:53
 TGL5DDataSetEditor.h:54
 TGL5DDataSetEditor.h:55
 TGL5DDataSetEditor.h:56
 TGL5DDataSetEditor.h:57
 TGL5DDataSetEditor.h:58
 TGL5DDataSetEditor.h:59
 TGL5DDataSetEditor.h:60
 TGL5DDataSetEditor.h:61
 TGL5DDataSetEditor.h:62
 TGL5DDataSetEditor.h:63
 TGL5DDataSetEditor.h:64
 TGL5DDataSetEditor.h:65
 TGL5DDataSetEditor.h:66
 TGL5DDataSetEditor.h:67
 TGL5DDataSetEditor.h:68
 TGL5DDataSetEditor.h:69
 TGL5DDataSetEditor.h:70
 TGL5DDataSetEditor.h:71
 TGL5DDataSetEditor.h:72
 TGL5DDataSetEditor.h:73
 TGL5DDataSetEditor.h:74
 TGL5DDataSetEditor.h:75
 TGL5DDataSetEditor.h:76
 TGL5DDataSetEditor.h:77
 TGL5DDataSetEditor.h:78
 TGL5DDataSetEditor.h:79
 TGL5DDataSetEditor.h:80
 TGL5DDataSetEditor.h:81
 TGL5DDataSetEditor.h:82
 TGL5DDataSetEditor.h:83
 TGL5DDataSetEditor.h:84
 TGL5DDataSetEditor.h:85
 TGL5DDataSetEditor.h:86
 TGL5DDataSetEditor.h:87
 TGL5DDataSetEditor.h:88
 TGL5DDataSetEditor.h:89
 TGL5DDataSetEditor.h:90
 TGL5DDataSetEditor.h:91
 TGL5DDataSetEditor.h:92
 TGL5DDataSetEditor.h:93
 TGL5DDataSetEditor.h:94
 TGL5DDataSetEditor.h:95
 TGL5DDataSetEditor.h:96
 TGL5DDataSetEditor.h:97
 TGL5DDataSetEditor.h:98
 TGL5DDataSetEditor.h:99
 TGL5DDataSetEditor.h:100
 TGL5DDataSetEditor.h:101
 TGL5DDataSetEditor.h:102
 TGL5DDataSetEditor.h:103
 TGL5DDataSetEditor.h:104
 TGL5DDataSetEditor.h:105
 TGL5DDataSetEditor.h:106
 TGL5DDataSetEditor.h:107
 TGL5DDataSetEditor.h:108
 TGL5DDataSetEditor.h:109
 TGL5DDataSetEditor.h:110
 TGL5DDataSetEditor.h:111
 TGL5DDataSetEditor.h:112
 TGL5DDataSetEditor.h:113
 TGL5DDataSetEditor.h:114
 TGL5DDataSetEditor.h:115
 TGL5DDataSetEditor.h:116
 TGL5DDataSetEditor.h:117
 TGL5DDataSetEditor.h:118
 TGL5DDataSetEditor.h:119
 TGL5DDataSetEditor.h:120
 TGL5DDataSetEditor.h:121
 TGL5DDataSetEditor.h:122
 TGL5DDataSetEditor.h:123
 TGL5DDataSetEditor.h:124
 TGL5DDataSetEditor.h:125
 TGL5DDataSetEditor.h:126
 TGL5DDataSetEditor.h:127
 TGL5DDataSetEditor.h:128
 TGL5DDataSetEditor.h:129
 TGL5DDataSetEditor.h:130
 TGL5DDataSetEditor.h:131
 TGL5DDataSetEditor.h:132
 TGL5DDataSetEditor.h:133
 TGL5DDataSetEditor.h:134
 TGL5DDataSetEditor.h:135
 TGL5DDataSetEditor.h:136
 TGL5DDataSetEditor.h:137
 TGL5DDataSetEditor.h:138
 TGL5DDataSetEditor.h:139
 TGL5DDataSetEditor.h:140
 TGL5DDataSetEditor.h:141
 TGL5DDataSetEditor.h:142
 TGL5DDataSetEditor.h:143
 TGL5DDataSetEditor.h:144
 TGL5DDataSetEditor.h:145
 TGL5DDataSetEditor.h:146
 TGL5DDataSetEditor.h:147
 TGL5DDataSetEditor.h:148
 TGL5DDataSetEditor.h:149
 TGL5DDataSetEditor.h:150
 TGL5DDataSetEditor.h:151
 TGL5DDataSetEditor.h:152
 TGL5DDataSetEditor.h:153
 TGL5DDataSetEditor.h:154
 TGL5DDataSetEditor.h:155
 TGL5DDataSetEditor.h:156
 TGL5DDataSetEditor.h:157
 TGL5DDataSetEditor.h:158