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));
47 ("Toggled(Bool_t)",
48 "TEveGeoNodeEditor", this, "DoVizNode()");
49
50 fVizNodeDaughters = new TGCheckButton(this, "VizNodeDaughters");
53 ("Toggled(Bool_t)",
54 "TEveGeoNodeEditor", this, "DoVizNodeDaughters()");
55
56 fVizVolume = new TGCheckButton(this, "VizVolume");
59 ("Toggled(Bool_t)",
60 "TEveGeoNodeEditor", this, "DoVizVolume()");
61
62 fVizVolumeDaughters = new TGCheckButton(this, "VizVolumeDaughters");
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);
82}
83
84////////////////////////////////////////////////////////////////////////////////
85/// Slot for VizNode.
86
88{
90 Update();
91}
92
93////////////////////////////////////////////////////////////////////////////////
94/// Slot for VizNodeDaughters.
95
97{
99 Update();
100}
101
102////////////////////////////////////////////////////////////////////////////////
103/// Slot for VizVolume.
104
106{
108 Update();
109}
110
111////////////////////////////////////////////////////////////////////////////////
112/// Slot for VizVolumeDaughters.
113
115{
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);
148 fVisOption->Build();
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);
158 fVisLevel->Build();
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);
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
185 if (fTopNodeRE->GetVisLevel() > 0)
187 else
189}
190
191////////////////////////////////////////////////////////////////////////////////
192/// Slot for VisOption.
193
195{
197 Update();
198}
199
200////////////////////////////////////////////////////////////////////////////////
201/// Slot for VisLevel.
202
204{
206 Update();
207}
208
209////////////////////////////////////////////////////////////////////////////////
210/// Slot for MaxVisNodes.
211
213{
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
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
#define ClassImp(name)
Definition Rtypes.h:382
@ kButtonDown
Definition TGButton.h:54
@ kButtonUp
Definition TGButton.h:53
@ kLHintsTop
Definition TGLayout.h:27
winID h TVirtualViewer3D TVirtualGLPainter p
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
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 Build(Bool_t connect=kTRUE) override
Create sub-components (label, number entry, 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.
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 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
TGeoNode * fNode
Definition TEveGeoNode.h:37
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
Int_t GetVisOption() const
void SetVisLevel(Int_t vl)
void SetMaxVisNodes(Int_t mvn)
void SetVisOption(Int_t vo)
Int_t GetVisLevel() const
Int_t GetMaxVisNodes() const
Selects different options.
Definition TGButton.h:264
Bool_t IsOn() const override
Definition TGButton.h:310
void SetState(EButtonState state, Bool_t emit=kFALSE) override
Set check button state.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
void MapWindow() override
map window
Definition TGFrame.h:204
void UnmapWindow() override
unmap window
Definition TGFrame.h:206
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
Base frame for implementing GUI - a service class.
Definition TGedFrame.h:27
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
void SetVisibility(Bool_t vis=kTRUE) override
set visibility of this volume
void VisibleDaughters(Bool_t vis=kTRUE)
set visibility for daughters
virtual Bool_t IsVisible() const
Definition TGeoVolume.h:155
Mother of all ROOT objects.
Definition TObject.h:41
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:869