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/** \class TEveGeoNodeEditor
19\ingroup TEve
20Editor for TEveGeoNode class.
21*/
22
24
25////////////////////////////////////////////////////////////////////////////////
26/// Constructor.
27
29 Int_t width, Int_t height,
30 UInt_t options, Pixel_t back) :
31 TGedFrame(p,width, height, options | kVerticalFrame, back),
32
33 fNodeRE (0),
34
35 fVizNode(0),
36 fVizNodeDaughters(0),
37 fVizVolume(0),
38 fVizVolumeDaughters(0)
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
131 Int_t width, Int_t height,
132 UInt_t options, Pixel_t back) :
133 TGedFrame(p, width, height, options | kVerticalFrame, back),
134
135 fTopNodeRE (0),
136 fVisOption (0),
137 fVisLevel (0),
138 fMaxVisNodes (0)
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}
int Int_t
Definition: CPyCppyy.h:43
unsigned int UInt_t
Definition: CPyCppyy.h:44
@ kVerticalFrame
Definition: GuiTypes.h:381
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
const Bool_t kFALSE
Definition: RtypesCore.h:101
#define ClassImp(name)
Definition: Rtypes.h:364
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:27
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: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 &)
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:90
Int_t GetVisOption() const
Definition: TEveGeoNode.h:109
void SetVisLevel(Int_t vl)
Definition: TEveGeoNode.h:112
void SetMaxVisNodes(Int_t mvn)
Definition: TEveGeoNode.h:114
void SetVisOption(Int_t vo)
Definition: TEveGeoNode.h:110
Int_t GetVisLevel() const
Definition: TEveGeoNode.h:111
Int_t GetMaxVisNodes() const
Definition: TEveGeoNode.h:113
Selects different options.
Definition: TGButton.h:264
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:1250
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1117
virtual void MapWindow()
map window
Definition: TGFrame.h:204
virtual void UnmapWindow()
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.
Definition: TGNumberEntry.h:25
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: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:49
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:153
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:869