]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Reve/PointSetArrayEditor.cxx
Fix effc++ warnings.
[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 PointSetArrayEditor::PointSetArrayEditor(const TGWindow *p, Int_t id, Int_t width, Int_t height,
25              UInt_t options, Pixel_t back) :
26   TGedFrame(p, id, width, height, options | kVerticalFrame, back),
27   fM(0),
28   fRange(0)
29 {
30   fM = 0;
31   MakeTitle("PointSetArray");
32
33   fRange = new RGDoubleValuator(this,"Range", 200, 0);
34   fRange->SetNELength(6);
35   //fRange->SetLabelWidth(labelW);
36   fRange->Build();
37   fRange->GetSlider()->SetWidth(224);
38   fRange->Connect("ValueSet()",
39                  "Reve::PointSetArrayEditor", this, "DoRange()");
40   AddFrame(fRange, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
41
42   // Register the editor.
43   TClass *cl = PointSetArray::Class();
44   TGedElement *ge = new TGedElement;
45   ge->fGedFrame = this;
46   ge->fCanvas = 0;
47   cl->GetEditorList()->Add(ge);
48 }
49
50 PointSetArrayEditor::~PointSetArrayEditor()
51 {}
52
53 /**************************************************************************/
54
55 void PointSetArrayEditor::SetModel(TVirtualPad* pad, TObject* obj, Int_t )
56 {
57   fModel = 0;
58   fPad   = 0;
59
60   if (!obj || !obj->InheritsFrom(PointSetArray::Class()) || obj->InheritsFrom(TVirtualPad::Class())) {
61     SetActive(kFALSE);
62     return;
63   }
64
65   fModel = obj;
66   fPad   = pad;
67
68   fM = dynamic_cast<PointSetArray*>(fModel);
69
70   // printf("FullRange(%f, %f) Selected(%f,%f)\n",
71   //        fM->GetMin(), fM->GetMax(), fM->GetCurMin(), fM->GetCurMax());
72
73   fRange->SetLimits(fM->fMin, fM->fMax, TGNumberFormat::kNESRealTwo);
74   fRange->SetValues(fM->fCurMin, fM->fCurMax);
75
76   SetActive();
77 }
78
79 /**************************************************************************/
80
81 void PointSetArrayEditor::DoRange()
82 {
83   fM->SetRange(fRange->GetMin(), fRange->GetMax());
84 }