]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Reve/PointSetArrayEditor.cxx
First big commit of the mchview program and its accompanying library,
[u/mrichter/AliRoot.git] / EVE / Reve / PointSetArrayEditor.cxx
1 // $Header$
2
3 #include "PointSetArrayEditor.h"
4 #include <Reve/PointSet.h>
5 #include <Reve/RGValuators.h>
6
7 #include <TVirtualPad.h>
8 #include <TColor.h>
9
10 #include <TGLabel.h>
11 #include <TGButton.h>
12 #include <TGNumberEntry.h>
13 #include <TGColorSelect.h>
14 #include <TGDoubleSlider.h>
15
16 using namespace Reve;
17
18 //______________________________________________________________________
19 // PointSetArrayEditor
20 //
21
22 ClassImp(PointSetArrayEditor)
23
24 //______________________________________________________________________________
25 PointSetArrayEditor::PointSetArrayEditor(const TGWindow *p,
26                                          Int_t width, Int_t height,
27                                          UInt_t options, Pixel_t back) :
28   TGedFrame(p,width, height, options | kVerticalFrame, back),
29   fM(0),
30   fRange(0)
31 {
32   // Constructor.
33
34   fM = 0;
35   MakeTitle("PointSetArray");
36
37   fRange = new RGDoubleValuator(this,"Range", 200, 0);
38   fRange->SetNELength(6);
39   //fRange->SetLabelWidth(labelW);
40   fRange->Build();
41   fRange->GetSlider()->SetWidth(224);
42   fRange->Connect("ValueSet()",
43                  "Reve::PointSetArrayEditor", this, "DoRange()");
44   AddFrame(fRange, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
45 }
46
47 //______________________________________________________________________________
48 PointSetArrayEditor::~PointSetArrayEditor()
49 {
50   // Destructor.
51 }
52
53 /**************************************************************************/
54
55 //______________________________________________________________________________
56 void PointSetArrayEditor::SetModel(TObject* obj)
57 {
58   // Set model object.
59
60   fM = dynamic_cast<PointSetArray*>(obj);
61
62   // printf("FullRange(%f, %f) Selected(%f,%f)\n",
63   //        fM->GetMin(), fM->GetMax(), fM->GetCurMin(), fM->GetCurMax());
64
65   fRange->SetLimits(fM->fMin, fM->fMax, TGNumberFormat::kNESRealTwo);
66   fRange->SetValues(fM->fCurMin, fM->fCurMax);
67 }
68
69 /**************************************************************************/
70
71 //______________________________________________________________________________
72 void PointSetArrayEditor::DoRange()
73 {
74   // Slot for setting the range of the separating quantity.
75
76   fM->SetRange(fRange->GetMin(), fRange->GetMax());
77   Update();
78 }