Logo ROOT   6.16/01
Reference Guide
TEveProjectionAxesEditor.cxx
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Author: Matevz Tadel 2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
13#include "TEveProjectionAxes.h"
14#include "TEveGValuators.h"
15
16#include "TGComboBox.h"
17#include "TGButton.h"
18#include "TGLabel.h"
19#include "TG3DLine.h"
20
21/** \class TEveProjectionAxesEditor
22\ingroup TEve
23GUI editor for TEveProjectionAxes.
24*/
25
27
28////////////////////////////////////////////////////////////////////////////////
29
31 UInt_t options, Pixel_t back) :
32 TGedFrame(p, width, height, options | kVerticalFrame, back),
33 fM(0),
34
35 fLabMode(0),
36 fAxesMode(0),
37
38 fCenterFrame(0),
39 fDrawCenter(0),
40 fDrawOrigin(0)
41{
42 // Constructor.
43
44 MakeTitle("TEveProjectionAxis");
45 Int_t labw=52;
46
47 {
49
50 TGCompositeFrame *labfr = new TGHorizontalFrame(f, labw, 20, kFixedSize);
51 labfr->AddFrame(new TGLabel(labfr, "Labels:") , new TGLayoutHints(kLHintsLeft | kLHintsBottom));
52 f->AddFrame(labfr, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 0, 1, 1, 1));
53
54 fLabMode = new TGComboBox(f, "Position");
55 fLabMode->AddEntry("Value", 1);
56 fLabMode->AddEntry("Position", 0);
57 fLabMode->GetTextEntry()->SetToolTipText("Set tick-marks on equidistant values/screen position.");
59 lb->Resize(lb->GetWidth(), 2*18);
60 fLabMode->Resize(80, 20);
61 fLabMode->Connect("Selected(Int_t)", "TEveProjectionAxesEditor", this, "DoLabMode(Int_t)");
62 f->AddFrame(fLabMode, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
63 AddFrame(f);
64 }
65
66 {
68 TGCompositeFrame *labfr = new TGHorizontalFrame(f, labw, 20, kFixedSize);
69 labfr->AddFrame(new TGLabel(labfr, "Axes:") , new TGLayoutHints(kLHintsLeft | kLHintsBottom));
70 f->AddFrame(labfr, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 0, 1, 1, 1));
71
72
73 fAxesMode = new TGComboBox(f, "All");
78 lb->Resize(lb->GetWidth(), 2*18);
79 fAxesMode->Resize(80, 20);
80 fAxesMode->Connect("Selected(Int_t)", "TEveProjectionAxesEditor", this, "DoAxesMode(Int_t)");
81 f->AddFrame(fAxesMode, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
82 AddFrame(f);
83 }
84
85 //______________________________________________________________________________
86
87 // center tab
89
90 TGCompositeFrame *title1 = new TGCompositeFrame(fCenterFrame, 180, 10,
95 title1->AddFrame(new TGLabel(title1, "Distortion Center"),
96 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
97 title1->AddFrame(new TGHorizontal3DLine(title1),
98 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
99 fCenterFrame->AddFrame(title1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
100
101
102 {
103
105
106 fDrawOrigin = new TGCheckButton(hf1, "DrawOrigin");
107 hf1->AddFrame(fDrawOrigin, new TGLayoutHints(kLHintsLeft, 2,1,0,4));
108 fDrawOrigin->Connect("Toggled(Bool_t)", "TEveProjectionAxesEditor", this, "DoDrawOrigin()");
109
110
111 fDrawCenter = new TGCheckButton(hf1, "DrawCenter");
112 hf1->AddFrame(fDrawCenter, new TGLayoutHints(kLHintsLeft, 2,1,0,4));
113 fDrawCenter->Connect("Toggled(Bool_t)", "TEveProjectionAxesEditor", this, "DoDrawCenter()");
114
115 fCenterFrame->AddFrame(hf1, new TGLayoutHints(kLHintsTop, 0,0,0,0));
116
117 }
118}
119
120////////////////////////////////////////////////////////////////////////////////
121/// Set model object.
122
124{
125 fM = dynamic_cast<TEveProjectionAxes*>(obj);
126
131
132}
133
134////////////////////////////////////////////////////////////////////////////////
135/// Slot for setting draw of origin.
136
138{
140 Update();
141}
142
143////////////////////////////////////////////////////////////////////////////////
144/// Slot for setting draw of center.
145
147{
149 Update();
150}
151
152////////////////////////////////////////////////////////////////////////////////
153/// Slot for setting tick-mark step mode.
154
156{
158 fM->SetLabMode(em);
159 Update();
160}
161
162////////////////////////////////////////////////////////////////////////////////
163/// Slot for setting number of axes.
164
166{
168 fM->SetAxesMode(em);
169 Update();
170}
ULong_t Pixel_t
Definition: GuiTypes.h:39
#define f(i)
Definition: RSha256.hxx:104
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
#define ClassImp(name)
Definition: Rtypes.h:363
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
@ kButtonDown
Definition: TGButton.h:54
@ kButtonUp
Definition: TGButton.h:53
@ kVerticalFrame
Definition: TGFrame.h:59
@ kFixedWidth
Definition: TGFrame.h:65
@ kHorizontalFrame
Definition: TGFrame.h:60
@ kFixedSize
Definition: TGFrame.h:68
@ kOwnBackground
Definition: TGFrame.h:69
@ kLHintsLeft
Definition: TGLayout.h:31
@ kLHintsBottom
Definition: TGLayout.h:36
@ kLHintsTop
Definition: TGLayout.h:34
@ kLHintsExpandX
Definition: TGLayout.h:37
GUI editor for TEveProjectionAxes.
void DoLabMode(Int_t type)
Slot for setting tick-mark step mode.
void DoAxesMode(Int_t type)
Slot for setting number of axes.
void DoDrawOrigin()
Slot for setting draw of origin.
void DoDrawCenter()
Slot for setting draw of center.
TEveProjectionAxesEditor(const TEveProjectionAxesEditor &)
virtual void SetModel(TObject *obj)
Set model object.
Axes for non-linear projections.
void SetDrawOrigin(Bool_t x)
void SetLabMode(ELabMode x)
Bool_t GetDrawOrigin() const
EAxesMode GetAxesMode() const
void SetAxesMode(EAxesMode x)
Bool_t GetDrawCenter() const
ELabMode GetLabMode() const
void SetDrawCenter(Bool_t x)
virtual Bool_t IsOn() const
Definition: TGButton.h:311
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1200
virtual TGTextEntry * GetTextEntry() const
Definition: TGComboBox.h:131
virtual void AddEntry(TGString *s, Int_t id)
Definition: TGComboBox.h:106
virtual TGListBox * GetListBox() const
Definition: TGComboBox.h:130
virtual void Select(Int_t id, Bool_t emit=kTRUE)
Make the selected item visible in the combo box window and emit signals according to the second param...
Definition: TGComboBox.cxx:443
TGCompositeFrame(const TGCompositeFrame &)
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
UInt_t GetWidth() const
Definition: TGFrame.h:271
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
Definition: TGListBox.cxx:1419
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
Create a vertical frame to be used by 'owner' in extra tab 'name'.
Definition: TGedFrame.cxx:123
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition: TGedFrame.cxx:96
virtual void Update()
Update the current pad when an attribute is changed via GUI.
Definition: TGedFrame.cxx:73
Mother of all ROOT objects.
Definition: TObject.h:37
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition: TQObject.cxx:867