forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TEveLineEditor.cxx
98 lines (78 loc) · 2.97 KB
/
TEveLineEditor.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// @(#)root/eve:$Id$
// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
/*************************************************************************
* Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#include "TEveLineEditor.h"
#include "TEveLine.h"
#include "TVirtualPad.h"
#include "TColor.h"
#include "TGLabel.h"
#include "TGButton.h"
#include "TGNumberEntry.h"
#include "TGColorSelect.h"
#include "TGDoubleSlider.h"
/** \class TEveLineEditor
\ingroup TEve
Editor for TEveLine class.
*/
ClassImp(TEveLineEditor);
////////////////////////////////////////////////////////////////////////////////
/// Constructor.
TEveLineEditor::TEveLineEditor(const TGWindow *p, Int_t width, Int_t height,
UInt_t options, Pixel_t back) :
TGedFrame (p, width, height, options | kVerticalFrame, back),
fM (0),
fRnrLine (0),
fRnrPoints (0),
fSmooth (0)
{
fPriority = 20;
{
TGHorizontalFrame* f = new TGHorizontalFrame(this);
fRnrPoints = new TGCheckButton(f, "Draw Marker");
f->AddFrame(fRnrPoints, new TGLayoutHints(kLHintsLeft, 2,1,0,0));
fRnrPoints->Connect("Toggled(Bool_t)", "TEveLineEditor", this, "DoRnrPoints()");
fRnrLine = new TGCheckButton(f, "Draw Line");
f->AddFrame(fRnrLine, new TGLayoutHints(kLHintsLeft, 1,2,0,0));
fRnrLine->Connect("Toggled(Bool_t)", "TEveLineEditor", this, "DoRnrLine()");
AddFrame(f, new TGLayoutHints(kLHintsTop, 0,0,2,1));
}
fSmooth = new TGCheckButton(this, "Smooth line");
AddFrame(fSmooth, new TGLayoutHints(kLHintsNormal, 2,1,2,1));
fSmooth->Connect("Toggled(Bool_t)", "TEveLineEditor", this, "DoSmooth()");
}
////////////////////////////////////////////////////////////////////////////////
/// Set model object.
void TEveLineEditor::SetModel(TObject* obj)
{
fM = dynamic_cast<TEveLine*>(obj);
fRnrLine ->SetState(fM->fRnrLine ? kButtonDown : kButtonUp);
fRnrPoints->SetState(fM->fRnrPoints ? kButtonDown : kButtonUp);
fSmooth->SetState(fM->fSmooth ? kButtonDown : kButtonUp);
}
////////////////////////////////////////////////////////////////////////////////
/// Slot for RnrLine.
void TEveLineEditor::DoRnrLine()
{
fM->SetRnrLine(fRnrLine->IsOn());
Update();
}
////////////////////////////////////////////////////////////////////////////////
/// Slot for RnrPoints.
void TEveLineEditor::DoRnrPoints()
{
fM->SetRnrPoints(fRnrPoints->IsOn());
Update();
}
////////////////////////////////////////////////////////////////////////////////
/// Slot for anti-alias.
void TEveLineEditor::DoSmooth()
{
fM->SetSmooth(fSmooth->IsOn());
Update();
}