Logo ROOT  
Reference Guide
TEveGeoNodeEditor.cxx
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 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
12#include "TEveGeoNodeEditor.h"
13#include "TEveGValuators.h"
14
15#include "TEveGeoNode.h"
16#include "TGeoNode.h"
17
18#include "TVirtualPad.h"
19#include "TColor.h"
20
21#include "TGLabel.h"
22#include "TGButton.h"
23#include "TGNumberEntry.h"
24#include "TGColorSelect.h"
25#include "TGDoubleSlider.h"
26
27/** \class TEveGeoNodeEditor
28\ingroup TEve
29Editor for TEveGeoNode class.
30*/
31
33
34////////////////////////////////////////////////////////////////////////////////
35/// Constructor.
36
38 Int_t width, Int_t height,
39 UInt_t options, Pixel_t back) :
40 TGedFrame(p,width, height, options | kVerticalFrame, back),
41
42 fNodeRE (0),
43
44 fVizNode(0),
45 fVizNodeDaughters(0),
46 fVizVolume(0),
47 fVizVolumeDaughters(0)
48{
49 MakeTitle("GeoNode");
50
51 // --- Visibility control
52
53 fVizNode = new TGCheckButton(this, "VizNode");
54 AddFrame(fVizNode, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
56 ("Toggled(Bool_t)",
57 "TEveGeoNodeEditor", this, "DoVizNode()");
58
59 fVizNodeDaughters = new TGCheckButton(this, "VizNodeDaughters");
62 ("Toggled(Bool_t)",
63 "TEveGeoNodeEditor", this, "DoVizNodeDaughters()");
64
65 fVizVolume = new TGCheckButton(this, "VizVolume");
68 ("Toggled(Bool_t)",
69 "TEveGeoNodeEditor", this, "DoVizVolume()");
70
71 fVizVolumeDaughters = new TGCheckButton(this, "VizVolumeDaughters");
74 ("Toggled(Bool_t)",
75 "TEveGeoNodeEditor", this, "DoVizVolumeDaughters()");
76}
77
78////////////////////////////////////////////////////////////////////////////////
79/// Set model object.
80
82{
83 fNodeRE = dynamic_cast<TEveGeoNode*>(obj);
84 TGeoNode* node = fNodeRE->fNode;
85 TGeoVolume* vol = node->GetVolume();
86
87 fVizNode->SetState(node->TGeoAtt::IsVisible() ? kButtonDown : kButtonUp);
88 fVizNodeDaughters->SetState(node->TGeoAtt::IsVisDaughters() ? kButtonDown : kButtonUp);
91}
92
93////////////////////////////////////////////////////////////////////////////////
94/// Slot for VizNode.
95
97{
99 Update();
100}
101
102////////////////////////////////////////////////////////////////////////////////
103/// Slot for VizNodeDaughters.
104
106{
108 Update();
109}
110
111////////////////////////////////////////////////////////////////////////////////
112/// Slot for VizVolume.
113
115{
117 Update();
118}
119
120////////////////////////////////////////////////////////////////////////////////
121/// Slot for VizVolumeDaughters.
122
124{
126 Update();
127}
128
129/** \class TEveGeoTopNodeEditor
130\ingroup TEve
131Editor for TEveGeoTopNode class.
132*/
133
135
136////////////////////////////////////////////////////////////////////////////////
137/// Constructor.
138
140 Int_t width, Int_t height,
141 UInt_t options, Pixel_t back) :
142 TGedFrame(p, width, height, options | kVerticalFrame, back),
143
144 fTopNodeRE (0),
145 fVisOption (0),
146 fVisLevel (0),
147 fMaxVisNodes (0)
148{
149 MakeTitle("GeoTopNode");
150
151 Int_t labelW = 64;
152
153 fVisOption = new TEveGValuator(this, "VisOption:", 90, 0);
154 fVisOption->SetLabelWidth(labelW);
157 fVisOption->Build();
159 fVisOption->SetToolTip("Visualization option passed to TGeoPainter.");
160 fVisOption->Connect("ValueSet(Double_t)", "TEveGeoTopNodeEditor", this, "DoVisOption()");
161 AddFrame(fVisOption, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
162
163 fVisLevel = new TEveGValuator(this, "VisLevel:", 90, 0);
164 fVisLevel->SetLabelWidth(labelW);
167 fVisLevel->Build();
169 fVisLevel->SetToolTip("Level (depth) to which the geometry is traversed.\nWhen zero, maximum number of nodes to draw can be specified.");
170 fVisLevel->Connect("ValueSet(Double_t)", "TEveGeoTopNodeEditor", this, "DoVisLevel()");
171 AddFrame(fVisLevel, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
172
173 fMaxVisNodes = new TEveGValuator(this, "MaxNodes:", 90, 0);
179 fMaxVisNodes->SetToolTip("Maximum number of nodes to draw.");
180 fMaxVisNodes->Connect("ValueSet(Double_t)", "TEveGeoTopNodeEditor", this, "DoMaxVisNodes()");
182}
183
184////////////////////////////////////////////////////////////////////////////////
185/// Set model object.
186
188{
189 fTopNodeRE = dynamic_cast<TEveGeoTopNode*>(obj);
190
194 if (fTopNodeRE->GetVisLevel() > 0)
196 else
198}
199
200////////////////////////////////////////////////////////////////////////////////
201/// Slot for VisOption.
202
204{
206 Update();
207}
208
209////////////////////////////////////////////////////////////////////////////////
210/// Slot for VisLevel.
211
213{
215 Update();
216}
217
218////////////////////////////////////////////////////////////////////////////////
219/// Slot for MaxVisNodes.
220
222{
224 Update();
225}
@ kVerticalFrame
Definition: GuiTypes.h:381
ULong_t Pixel_t
Definition: GuiTypes.h:39
int Int_t
Definition: RtypesCore.h:43
const Bool_t kFALSE
Definition: RtypesCore.h:90
#define ClassImp(name)
Definition: Rtypes.h:361
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
@ kLHintsTop
Definition: TGLayout.h:34
virtual Bool_t SetRnrChildren(Bool_t rnr)
Set render state of this element's children, i.e.
virtual Bool_t SetRnrSelf(Bool_t rnr)
Set render state of this element, i.e.
void SetLabelWidth(Int_t w)
void SetShowSlider(Bool_t s=kTRUE)
void SetNELength(Int_t l)
Composite GUI element for single value selection (supports label, number-entry and slider).
void SetToolTip(const char *tip)
Set the tooltip of the number-entry.
void SetLimits(Int_t min, Int_t max)
Set limits of the represented value for integer values.
virtual void Build(Bool_t connect=kTRUE)
Create sub-components (label, number entry, slider).
Float_t GetValue() const
virtual void SetValue(Float_t v, Bool_t emit=kFALSE)
Set value, optionally emit signal.
Editor for TEveGeoNode class.
void DoVizNodeDaughters()
Slot for VizNodeDaughters.
TGCheckButton * fVizNode
void DoVizVolume()
Slot for VizVolume.
TGCheckButton * fVizVolumeDaughters
TEveGeoNodeEditor(const TEveGeoNodeEditor &)
void DoVizNode()
Slot for VizNode.
virtual void SetModel(TObject *obj)
Set model object.
TGCheckButton * fVizVolume
TEveGeoNode * fNodeRE
void DoVizVolumeDaughters()
Slot for VizVolumeDaughters.
TGCheckButton * fVizNodeDaughters
Wrapper for TGeoNode that allows it to be shown in GUI and controlled as a TEveElement.
Definition: TEveGeoNode.h:33
TGeoNode * fNode
Definition: TEveGeoNode.h:40
Editor for TEveGeoTopNode class.
TEveGValuator * fMaxVisNodes
TEveGeoTopNode * fTopNodeRE
void DoVisLevel()
Slot for VisLevel.
TEveGValuator * fVisLevel
void DoVisOption()
Slot for VisOption.
TEveGeoTopNodeEditor(const TEveGeoTopNodeEditor &)
virtual void SetModel(TObject *obj)
Set model object.
void DoMaxVisNodes()
Slot for MaxVisNodes.
TEveGValuator * fVisOption
A wrapper over a TGeoNode, possibly displaced with a global trasformation stored in TEveElement.
Definition: TEveGeoNode.h:93
Int_t GetVisOption() const
Definition: TEveGeoNode.h:112
void SetVisLevel(Int_t vl)
Definition: TEveGeoNode.h:115
void SetMaxVisNodes(Int_t mvn)
Definition: TEveGeoNode.h:117
void SetVisOption(Int_t vo)
Definition: TEveGeoNode.h:113
Int_t GetVisLevel() const
Definition: TEveGeoNode.h:114
Int_t GetMaxVisNodes() const
Definition: TEveGeoNode.h:116
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:1202
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1101
virtual void MapWindow()
map window
Definition: TGFrame.h:229
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:231
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
Bool_t IsVisDaughters() const
Definition: TGeoAtt.h:89
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Definition: TGeoNode.h:41
TGeoVolume * GetVolume() const
Definition: TGeoNode.h:97
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:47
void VisibleDaughters(Bool_t vis=kTRUE)
set visibility for daughters
virtual void SetVisibility(Bool_t vis=kTRUE)
set visibility of this volume
virtual Bool_t IsVisible() const
Definition: TGeoVolume.h:151
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:866