Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TEveElementEditor.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 "TEveElementEditor.h"
13#include "TEveElement.h"
14#include "TEveTransEditor.h"
15
16#include "TColor.h"
17
18#include "TGLabel.h"
19#include "TGNumberEntry.h"
20#include "TGColorSelect.h"
21
22/** \class TEveElementEditor
23\ingroup TEve
24Editor for TEveElement class.
25*/
26
28
29////////////////////////////////////////////////////////////////////////////////
30/// Constructor.
31
34 UInt_t options, Pixel_t back) :
35 TGedFrame(p, width, height, options | kVerticalFrame, back),
36
37 fRE (nullptr),
38 fHFrame (nullptr),
39 fPreLabel (nullptr),
40 fRnrSelf (nullptr),
41 fRnrChildren (nullptr),
42 fRnrState (nullptr),
43 fMainColor (nullptr),
44 fTransparency (nullptr),
45 fTrans (nullptr)
46{
47 MakeTitle("TEveElement");
48 fPriority = 0;
49
50 fHFrame = new TGHorizontalFrame(this);
51
52 fPreLabel = new TGLabel(fHFrame, "Show:");
54 fRnrSelf = new TGCheckButton(fHFrame, "Self");
57 ("Toggled(Bool_t)",
58 "TEveElementEditor", this, "DoRnrSelf()");
59
60 fRnrChildren = new TGCheckButton(fHFrame, "Children");
63 ("Toggled(Bool_t)",
64 "TEveElementEditor", this, "DoRnrChildren()");
65
69 ("Toggled(Bool_t)",
70 "TEveElementEditor", this, "DoRnrState()");
71
72 fMainColor = new TGColorSelect(fHFrame, 0, -1);
75 ("ColorSelected(Pixel_t)",
76 "TEveElementEditor", this, "DoMainColor(Pixel_t)");
77
78 fTransparency = new TGNumberEntry(fHFrame, 0., 2, -1,
82 fTransparency->GetNumberEntry()->SetToolTipText("Transparency: 0 is opaque, 100 fully transparent.");
85 ("ValueSet(Long_t)",
86 "TEveElementEditor", this, "DoTransparency()");
87
88 AddFrame(fHFrame, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
89
90 fTrans = new TEveTransSubEditor(this);
91 fTrans->Connect("UseTrans()", "TEveElementEditor", this, "Update()");
92 fTrans->Connect("TransChanged()", "TEveElementEditor", this, "Update()");
94}
95
96////////////////////////////////////////////////////////////////////////////////
97/// Set model object.
98
100{
101 fRE = dynamic_cast<TEveElement*>(obj);
102
107 if (fRE->CanEditElement()) {
109 if (fRE->SingleRnrState()) {
112 } else {
117 }
118 }
119
120 if (fRE->CanEditMainColor()) {
123 } else {
125 }
129 } else {
131 }
132 if (fRE->CanEditMainTrans()) {
134 fTrans->MapWindow();
135 } else {
137 }
138
139 fHFrame->Layout();
140}
141
142////////////////////////////////////////////////////////////////////////////////
143/// Slot for RnrSelf.
144
146{
148 Update();
149}
150
151////////////////////////////////////////////////////////////////////////////////
152/// Slot for RnrChildren.
153
155{
157 Update();
158}
159
160////////////////////////////////////////////////////////////////////////////////
161/// Slot for RnrState.
162
164{
166 Update();
167}
168
169////////////////////////////////////////////////////////////////////////////////
170/// Slot for MainColor.
171
173{
174 fRE->SetMainColorPixel(color);
175 Update();
176}
177
178////////////////////////////////////////////////////////////////////////////////
179/// Slot for Transparency.
180
182{
184 Update();
185}
@ kVerticalFrame
Definition GuiTypes.h:381
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
char Char_t
Definition RtypesCore.h:37
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
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
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
static ULong_t Number2Pixel(Int_t ci)
Static method that given a color index number, returns the corresponding pixel value.
Definition TColor.cxx:2320
Editor for TEveElement class.
void SetModel(TObject *obj) override
Set model object.
TGNumberEntry * fTransparency
void DoTransparency()
Slot for Transparency.
TEveTransSubEditor * fTrans
void DoRnrChildren()
Slot for RnrChildren.
TGCheckButton * fRnrState
void DoMainColor(Pixel_t color)
Slot for MainColor.
void DoRnrState()
Slot for RnrState.
TGHorizontalFrame * fHFrame
TGColorSelect * fMainColor
TGCheckButton * fRnrSelf
TGCheckButton * fRnrChildren
TEveElementEditor(const TEveElementEditor &)
void DoRnrSelf()
Slot for RnrSelf.
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition TEveElement.h:36
virtual TEveTrans * PtrMainTrans(Bool_t create=kTRUE)
Return pointer to main transformation.
virtual Bool_t SingleRnrState() const
void SetMainColorPixel(Pixel_t pixel)
Convert pixel to Color_t and call SetMainColor().
virtual void SetMainTransparency(Char_t t)
Set main-transparency.
virtual Bool_t CanEditMainTransparency() const
virtual Bool_t CanEditElement() const
virtual Bool_t CanEditMainColor() const
virtual Bool_t CanEditMainTrans() const
virtual Bool_t SetRnrChildren(Bool_t rnr)
Set render state of this element's children, i.e.
virtual Bool_t GetRnrState() const
virtual Color_t GetMainColor() const
virtual Bool_t SetRnrState(Bool_t rnr)
Set render state of this element and of its children to the same value.
virtual Bool_t GetRnrChildren() const
virtual Char_t GetMainTransparency() const
virtual Bool_t GetRnrSelf() const
virtual Bool_t SetRnrSelf(Bool_t rnr)
Set render state of this element, i.e.
Sub-editor for TEveTrans class.
void SetModel(TEveTrans *t)
Set model object.
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.
Like a checkbutton but instead of the check mark there is color area with a little down arrow.
void SetColor(Pixel_t color, Bool_t emit=kTRUE)
Set color.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
void Layout() override
Layout the elements of the composite frame.
Definition TGFrame.cxx:1257
void MapWindow() override
map window
Definition TGFrame.h:204
void UnmapWindow() override
unmap window
Definition TGFrame.h:206
virtual void SetHeight(UInt_t h)
Definition TGFrame.h:247
A composite frame that layout their children in horizontal way.
Definition TGFrame.h:385
This class handles GUI labels.
Definition TGLabel.h:24
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
TGNumberEntry is a number entry input widget with up/down buttons.
TGNumberEntryField * GetNumberEntry() const
Get the number entry field.
virtual Double_t GetNumber() const
virtual void SetNumber(Double_t val, Bool_t emit=kTRUE)
@ kNEANonNegative
Non-negative number.
@ kNESInteger
Style of number entry field.
@ kNELLimitMinMax
Both lower and upper limits.
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
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
Int_t fPriority
location in GedEditor
Definition TGedFrame.h:53
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