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
27
28////////////////////////////////////////////////////////////////////////////////
29/// Constructor.
30
33 UInt_t options, Pixel_t back) :
34 TGedFrame(p, width, height, options | kVerticalFrame, back),
35
36 fRE (nullptr),
37 fHFrame (nullptr),
38 fPreLabel (nullptr),
39 fRnrSelf (nullptr),
40 fRnrChildren (nullptr),
41 fRnrState (nullptr),
42 fMainColor (nullptr),
43 fTransparency (nullptr),
44 fTrans (nullptr)
45{
46 MakeTitle("TEveElement");
47 fPriority = 0;
48
49 fHFrame = new TGHorizontalFrame(this);
50
51 fPreLabel = new TGLabel(fHFrame, "Show:");
53 fRnrSelf = new TGCheckButton(fHFrame, "Self");
56 ("Toggled(Bool_t)",
57 "TEveElementEditor", this, "DoRnrSelf()");
58
59 fRnrChildren = new TGCheckButton(fHFrame, "Children");
62 ("Toggled(Bool_t)",
63 "TEveElementEditor", this, "DoRnrChildren()");
64
68 ("Toggled(Bool_t)",
69 "TEveElementEditor", this, "DoRnrState()");
70
71 fMainColor = new TGColorSelect(fHFrame, 0, -1);
74 ("ColorSelected(Pixel_t)",
75 "TEveElementEditor", this, "DoMainColor(Pixel_t)");
76
77 fTransparency = new TGNumberEntry(fHFrame, 0., 2, -1,
81 fTransparency->GetNumberEntry()->SetToolTipText("Transparency: 0 is opaque, 100 fully transparent.");
84 ("ValueSet(Long_t)",
85 "TEveElementEditor", this, "DoTransparency()");
86
87 AddFrame(fHFrame, new TGLayoutHints(kLHintsTop, 0, 0, 0, 0));
88
89 fTrans = new TEveTransSubEditor(this);
90 fTrans->Connect("UseTrans()", "TEveElementEditor", this, "Update()");
91 fTrans->Connect("TransChanged()", "TEveElementEditor", this, "Update()");
93}
94
95////////////////////////////////////////////////////////////////////////////////
96/// Set model object.
97
99{
100 fRE = dynamic_cast<TEveElement*>(obj);
101
106 if (fRE->CanEditElement()) {
108 if (fRE->SingleRnrState()) {
111 } else {
116 }
117 }
118
119 if (fRE->CanEditMainColor()) {
122 } else {
124 }
128 } else {
130 }
131 if (fRE->CanEditMainTrans()) {
133 fTrans->MapWindow();
134 } else {
136 }
137
138 fHFrame->Layout();
139}
140
141////////////////////////////////////////////////////////////////////////////////
142/// Slot for RnrSelf.
143
149
150////////////////////////////////////////////////////////////////////////////////
151/// Slot for RnrChildren.
152
158
159////////////////////////////////////////////////////////////////////////////////
160/// Slot for RnrState.
161
167
168////////////////////////////////////////////////////////////////////////////////
169/// Slot for MainColor.
170
172{
173 fRE->SetMainColorPixel(color);
174 Update();
175}
176
177////////////////////////////////////////////////////////////////////////////////
178/// Slot for Transparency.
179
@ kVerticalFrame
Definition GuiTypes.h:381
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
char Char_t
Character 1 byte (char)
Definition RtypesCore.h:51
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
@ 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:2445
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:1109
void Layout() override
Layout the elements of the composite frame.
Definition TGFrame.cxx:1249
void MapWindow() override
map window
Definition TGFrame.h:206
void UnmapWindow() override
unmap window
Definition TGFrame.h:208
virtual void SetHeight(UInt_t h)
Definition TGFrame.h:249
A composite frame that layout their children in horizontal way.
Definition TGFrame.h:387
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:94
virtual void Update()
Update the current pad when an attribute is changed via GUI.
Definition TGedFrame.cxx:71
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:865