New files, editor for QuadSet gluing together translation and palette sub-editors.
[u/mrichter/AliRoot.git] / EVE / Reve / QuadSetEditor.cxx
1 // $Header$
2
3 #include "QuadSetEditor.h"
4 #include <Reve/QuadSet.h>
5
6 #include <Reve/RGValuators.h>
7 #include <Reve/ZTransEditor.h>
8 #include <Reve/RGBAPaletteEditor.h>
9
10 #include <TVirtualPad.h>
11 #include <TColor.h>
12
13 #include <TGLabel.h>
14 #include <TGButton.h>
15 #include <TGNumberEntry.h>
16 #include <TGColorSelect.h>
17 #include <TGDoubleSlider.h>
18
19 using namespace Reve;
20
21 //______________________________________________________________________
22 // QuadSetEditor
23 //
24
25 ClassImp(QuadSetEditor)
26
27 QuadSetEditor::QuadSetEditor(const TGWindow *p, Int_t width, Int_t height,
28                              UInt_t options, Pixel_t back) :
29   TGedFrame(p, width, height, options | kVerticalFrame, back),
30   fM(0),
31   fHMTrans   (0),
32   fPalette   (0)
33   // Initialize widget pointers to 0
34 {
35   MakeTitle("Transformation matrix");
36
37   fHMTrans = new ZTransSubEditor(this);
38   fHMTrans->Connect("UseTrans()",     "Reve::QuadSetEditor", this, "Update()");
39   fHMTrans->Connect("TransChanged()", "Reve::QuadSetEditor", this, "Update()");
40   AddFrame(fHMTrans, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 0, 0, 0));
41
42   MakeTitle("Palette controls");
43
44   fPalette = new RGBAPaletteSubEditor(this);
45   fPalette->Connect("Changed", "Reve::QuadSetEditor", this, "Update()");
46   AddFrame(fPalette, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 0, 0, 0));
47
48   MakeTitle("QuadSet");
49
50   // Create widgets
51   // fXYZZ = new TGSomeWidget(this, ...);
52   // AddFrame(fXYZZ, new TGLayoutHints(...));
53   // fXYZZ->Connect("SignalName()", "Reve::QuadSetEditor", this, "DoXYZZ()");
54 }
55
56 QuadSetEditor::~QuadSetEditor()
57 {}
58
59 /**************************************************************************/
60
61 void QuadSetEditor::SetModel(TObject* obj)
62 {
63   fM = dynamic_cast<QuadSet*>(obj);
64
65   fHMTrans->SetDataFromTrans(&fM->fHMTrans);
66
67   fPalette->SetModel(fM->fPalette);
68
69   // Set values of widgets
70   // fXYZZ->SetValue(fM->GetXYZZ());
71 }
72
73 /**************************************************************************/
74
75 // Implements callback/slot methods
76
77 // void QuadSetEditor::DoXYZZ()
78 // {
79 //   fM->SetXYZZ(fXYZZ->GetValue());
80 //   Update();
81 // }