Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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/** \class TEveGeoNodeEditor
19\ingroup TEve
20Editor for TEveGeoNode class.
21*/
22
24
25////////////////////////////////////////////////////////////////////////////////
26/// Constructor.
27
30 UInt_t options, Pixel_t back) :
31 TGedFrame(p,width, height, options | kVerticalFrame, back),
32
33 fNodeRE (nullptr),
34
35 fVizNode(nullptr),
36 fVizNodeDaughters(nullptr),
37 fVizVolume(nullptr),
38 fVizVolumeDaughters(nullptr)
39{
40 MakeTitle("GeoNode");
41
42 // --- Visibility control
43
44 fVizNode = new TGCheckButton(this, "VizNode");
45 AddFrame(fVizNode, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
46 fVizNode->Connect
47 ("Toggled(Bool_t)",
48 "TEveGeoNodeEditor", this, "DoVizNode()");
49
50 fVizNodeDaughters = new TGCheckButton(this, "VizNodeDaughters");
52 fVizNodeDaughters->Connect
53 ("Toggled(Bool_t)",
54 "TEveGeoNodeEditor", this, "DoVizNodeDaughters()");
55
56 fVizVolume = new TGCheckButton(this, "VizVolume");
58 fVizVolume->Connect
59 ("Toggled(Bool_t)",
60 "TEveGeoNodeEditor", this, "DoVizVolume()");
61
62 fVizVolumeDaughters = new TGCheckButton(this, "VizVolumeDaughters");
64 fVizVolumeDaughters->Connect
65 ("Toggled(Bool_t)",
66 "TEveGeoNodeEditor", this, "DoVizVolumeDaughters()");
67}
68
69////////////////////////////////////////////////////////////////////////////////
70/// Set model object.
71
73{
74 fNodeRE = dynamic_cast<TEveGeoNode*>(obj);
75 TGeoNode* node = fNodeRE->fNode;
76 TGeoVolume* vol = node->GetVolume();
77
78 fVizNode->SetState(node->TGeoAtt::IsVisible() ? kButtonDown : kButtonUp);
79 fVizNodeDaughters->SetState(node->TGeoAtt::IsVisDaughters() ? kButtonDown : kButtonUp);
80 fVizVolume->SetState(vol->IsVisible() ? kButtonDown : kButtonUp);
82}
83
84////////////////////////////////////////////////////////////////////////////////
85/// Slot for VizNode.
86
88{
89 fNodeRE->SetRnrSelf(fVizNode->IsOn());
90 Update();
91}
92
93////////////////////////////////////////////////////////////////////////////////
94/// Slot for VizNodeDaughters.
95
97{
98 fNodeRE->SetRnrChildren(fVizNodeDaughters->IsOn());
99 Update();
100}
101
102////////////////////////////////////////////////////////////////////////////////
103/// Slot for VizVolume.
104
106{
107 fNodeRE->fNode->GetVolume()->SetVisibility(fVizVolume->IsOn());
108 Update();
109}
110
111////////////////////////////////////////////////////////////////////////////////
112/// Slot for VizVolumeDaughters.
113
115{
116 fNodeRE->fNode->GetVolume()->VisibleDaughters(fVizVolumeDaughters->IsOn());
117 Update();
118}
119
120/** \class TEveGeoTopNodeEditor
121\ingroup TEve
122Editor for TEveGeoTopNode class.
123*/
124
126
127////////////////////////////////////////////////////////////////////////////////
128/// Constructor.
129
132 UInt_t options, Pixel_t back) :
133 TGedFrame(p, width, height, options | kVerticalFrame, back),
134
135 fTopNodeRE (nullptr),
136 fVisOption (nullptr),
137 fVisLevel (nullptr),
138 fMaxVisNodes (nullptr)
139{
140 MakeTitle("GeoTopNode");
141
142 Int_t labelW = 64;
143
144 fVisOption = new TEveGValuator(this, "VisOption:", 90, 0);
145 fVisOption->SetLabelWidth(labelW);
146 fVisOption->SetShowSlider(kFALSE);
147 fVisOption->SetNELength(4);
148 fVisOption->Build();
149 fVisOption->SetLimits(0, 2, 10, TGNumberFormat::kNESInteger);
150 fVisOption->SetToolTip("Visualization option passed to TGeoPainter.");
151 fVisOption->Connect("ValueSet(Double_t)", "TEveGeoTopNodeEditor", this, "DoVisOption()");
152 AddFrame(fVisOption, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
153
154 fVisLevel = new TEveGValuator(this, "VisLevel:", 90, 0);
155 fVisLevel->SetLabelWidth(labelW);
156 fVisLevel->SetShowSlider(kFALSE);
157 fVisLevel->SetNELength(4);
158 fVisLevel->Build();
159 fVisLevel->SetLimits(0, 30, 31, TGNumberFormat::kNESInteger);
160 fVisLevel->SetToolTip("Level (depth) to which the geometry is traversed.\nWhen zero, maximum number of nodes to draw can be specified.");
161 fVisLevel->Connect("ValueSet(Double_t)", "TEveGeoTopNodeEditor", this, "DoVisLevel()");
162 AddFrame(fVisLevel, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
163
164 fMaxVisNodes = new TEveGValuator(this, "MaxNodes:", 90, 0);
165 fMaxVisNodes->SetLabelWidth(labelW);
166 fMaxVisNodes->SetShowSlider(kFALSE);
167 fMaxVisNodes->SetNELength(6);
168 fMaxVisNodes->Build();
169 fMaxVisNodes->SetLimits(100, 999999, 0, TGNumberFormat::kNESInteger);
170 fMaxVisNodes->SetToolTip("Maximum number of nodes to draw.");
171 fMaxVisNodes->Connect("ValueSet(Double_t)", "TEveGeoTopNodeEditor", this, "DoMaxVisNodes()");
173}
174
175////////////////////////////////////////////////////////////////////////////////
176/// Set model object.
177
179{
180 fTopNodeRE = dynamic_cast<TEveGeoTopNode*>(obj);
181
182 fVisOption ->SetValue(fTopNodeRE->GetVisOption());
183 fVisLevel ->SetValue(fTopNodeRE->GetVisLevel());
184 fMaxVisNodes->SetValue(fTopNodeRE->GetMaxVisNodes());
185 if (fTopNodeRE->GetVisLevel() > 0)
186 fMaxVisNodes->UnmapWindow();
187 else
188 fMaxVisNodes->MapWindow();
189}
190
191////////////////////////////////////////////////////////////////////////////////
192/// Slot for VisOption.
193
195{
196 fTopNodeRE->SetVisOption(Int_t(fVisOption->GetValue()));
197 Update();
198}
199
200////////////////////////////////////////////////////////////////////////////////
201/// Slot for VisLevel.
202
204{
205 fTopNodeRE->SetVisLevel(Int_t(fVisLevel->GetValue()));
206 Update();
207}
208
209////////////////////////////////////////////////////////////////////////////////
210/// Slot for MaxVisNodes.
211
213{
214 fTopNodeRE->SetMaxVisNodes(Int_t(fMaxVisNodes->GetValue()));
215 Update();
216}
@ kVerticalFrame
Definition GuiTypes.h:381
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
int Int_t
Definition RtypesCore.h:45
unsigned int UInt_t
Definition RtypesCore.h:46
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
#define ClassImp(name)
Definition Rtypes.h:377
@ kButtonDown
Definition TGButton.h:54
@ kButtonUp
Definition TGButton.h:53
@ kLHintsTop
Definition TGLayout.h:27
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Composite GUI element for single value selection (supports label, number-entry and slider).
Editor for TEveGeoNode class.
void DoVizNodeDaughters()
Slot for VizNodeDaughters.
TGCheckButton * fVizNode
void SetModel(TObject *obj) override
Set model object.
void DoVizVolume()
Slot for VizVolume.
TGCheckButton * fVizVolumeDaughters
TEveGeoNodeEditor(const TEveGeoNodeEditor &)
void DoVizNode()
Slot for VizNode.
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:30
Editor for TEveGeoTopNode class.
TEveGValuator * fMaxVisNodes
TEveGeoTopNode * fTopNodeRE
void DoVisLevel()
Slot for VisLevel.
TEveGValuator * fVisLevel
void DoVisOption()
Slot for VisOption.
TEveGeoTopNodeEditor(const TEveGeoTopNodeEditor &)
void SetModel(TObject *obj) override
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:90
Selects different options.
Definition TGButton.h:264
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
@ kNESInteger
Style of number entry field.
ROOT GUI Window base class.
Definition TGWindow.h:23
TGedFrame(const TGedFrame &)=delete
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition TGedFrame.cxx:95
virtual void Update()
Update the current pad when an attribute is changed via GUI.
Definition TGedFrame.cxx:72
Bool_t IsVisDaughters() const
Definition TGeoAtt.h:84
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Definition TGeoNode.h:39
TGeoVolume * GetVolume() const
Definition TGeoNode.h:99
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:43
virtual Bool_t IsVisible() const
Definition TGeoVolume.h:155
Mother of all ROOT objects.
Definition TObject.h:41