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
23
24////////////////////////////////////////////////////////////////////////////////
25/// Constructor.
26
29 UInt_t options, Pixel_t back) :
30 TGedFrame(p,width, height, options | kVerticalFrame, back),
31
32 fNodeRE (nullptr),
33
34 fVizNode(nullptr),
35 fVizNodeDaughters(nullptr),
36 fVizVolume(nullptr),
37 fVizVolumeDaughters(nullptr)
38{
39 MakeTitle("GeoNode");
40
41 // --- Visibility control
42
43 fVizNode = new TGCheckButton(this, "VizNode");
44 AddFrame(fVizNode, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
46 ("Toggled(Bool_t)",
47 "TEveGeoNodeEditor", this, "DoVizNode()");
48
49 fVizNodeDaughters = new TGCheckButton(this, "VizNodeDaughters");
52 ("Toggled(Bool_t)",
53 "TEveGeoNodeEditor", this, "DoVizNodeDaughters()");
54
55 fVizVolume = new TGCheckButton(this, "VizVolume");
58 ("Toggled(Bool_t)",
59 "TEveGeoNodeEditor", this, "DoVizVolume()");
60
61 fVizVolumeDaughters = new TGCheckButton(this, "VizVolumeDaughters");
64 ("Toggled(Bool_t)",
65 "TEveGeoNodeEditor", this, "DoVizVolumeDaughters()");
66}
67
68////////////////////////////////////////////////////////////////////////////////
69/// Set model object.
70
72{
73 fNodeRE = dynamic_cast<TEveGeoNode*>(obj);
74 TGeoNode* node = fNodeRE->fNode;
75 TGeoVolume* vol = node->GetVolume();
76
77 fVizNode->SetState(node->TGeoAtt::IsVisible() ? kButtonDown : kButtonUp);
78 fVizNodeDaughters->SetState(node->TGeoAtt::IsVisDaughters() ? kButtonDown : kButtonUp);
81}
82
83////////////////////////////////////////////////////////////////////////////////
84/// Slot for VizNode.
85
91
92////////////////////////////////////////////////////////////////////////////////
93/// Slot for VizNodeDaughters.
94
100
101////////////////////////////////////////////////////////////////////////////////
102/// Slot for VizVolume.
103
109
110////////////////////////////////////////////////////////////////////////////////
111/// Slot for VizVolumeDaughters.
112
118
119/** \class TEveGeoTopNodeEditor
120\ingroup TEve
121Editor for TEveGeoTopNode class.
122*/
123
124
125////////////////////////////////////////////////////////////////////////////////
126/// Constructor.
127
130 UInt_t options, Pixel_t back) :
131 TGedFrame(p, width, height, options | kVerticalFrame, back),
132
133 fTopNodeRE (nullptr),
134 fVisOption (nullptr),
135 fVisLevel (nullptr),
136 fMaxVisNodes (nullptr)
137{
138 MakeTitle("GeoTopNode");
139
140 Int_t labelW = 64;
141
142 fVisOption = new TEveGValuator(this, "VisOption:", 90, 0);
146 fVisOption->Build();
148 fVisOption->SetToolTip("Visualization option passed to TGeoPainter.");
149 fVisOption->Connect("ValueSet(Double_t)", "TEveGeoTopNodeEditor", this, "DoVisOption()");
150 AddFrame(fVisOption, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
151
152 fVisLevel = new TEveGValuator(this, "VisLevel:", 90, 0);
156 fVisLevel->Build();
158 fVisLevel->SetToolTip("Level (depth) to which the geometry is traversed.\nWhen zero, maximum number of nodes to draw can be specified.");
159 fVisLevel->Connect("ValueSet(Double_t)", "TEveGeoTopNodeEditor", this, "DoVisLevel()");
160 AddFrame(fVisLevel, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
161
162 fMaxVisNodes = new TEveGValuator(this, "MaxNodes:", 90, 0);
168 fMaxVisNodes->SetToolTip("Maximum number of nodes to draw.");
169 fMaxVisNodes->Connect("ValueSet(Double_t)", "TEveGeoTopNodeEditor", this, "DoMaxVisNodes()");
171}
172
173////////////////////////////////////////////////////////////////////////////////
174/// Set model object.
175
188
189////////////////////////////////////////////////////////////////////////////////
190/// Slot for VisOption.
191
197
198////////////////////////////////////////////////////////////////////////////////
199/// Slot for VisLevel.
200
206
207////////////////////////////////////////////////////////////////////////////////
208/// Slot for MaxVisNodes.
209
@ kVerticalFrame
Definition GuiTypes.h:381
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
@ 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.
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
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:1109
void MapWindow() override
map window
Definition TGFrame.h:206
void UnmapWindow() override
unmap window
Definition TGFrame.h:208
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:94
virtual void Update()
Update the current pad when an attribute is changed via GUI.
Definition TGedFrame.cxx:71
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:865