Logo ROOT  
Reference Guide
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
33 Int_t width, Int_t height,
34 UInt_t options, Pixel_t back) :
35 TGedFrame(p, width, height, options | kVerticalFrame, back),
36
37 fRE (0),
38 fHFrame (0),
39 fPreLabel (0),
40 fRnrSelf (0),
41 fRnrChildren (0),
42 fRnrState (0),
43 fMainColor (0),
44 fTransparency (0),
45 fTrans (0)
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
int Int_t
Definition: RtypesCore.h:45
char Char_t
Definition: RtypesCore.h:33
unsigned int UInt_t
Definition: RtypesCore.h:46
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
@ kLHintsLeft
Definition: TGLayout.h:24
@ kLHintsTop
Definition: TGLayout.h:27
@ kLHintsExpandX
Definition: TGLayout.h:30
static ULong_t Number2Pixel(Int_t ci)
Static method that given a color index number, returns the corresponding pixel value.
Definition: TColor.cxx:2069
Editor for TEveElement class.
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 &)
virtual void SetModel(TObject *obj)
Set model object.
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
Definition: TEveElement.h:255
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
Definition: TEveElement.h:279
virtual Bool_t CanEditElement() const
Definition: TEveElement.h:254
virtual Bool_t CanEditMainColor() const
Definition: TEveElement.h:266
virtual Bool_t CanEditMainTrans() const
Definition: TEveElement.h:286
virtual Bool_t SetRnrChildren(Bool_t rnr)
Set render state of this element's children, i.e.
virtual Bool_t GetRnrState() const
Definition: TEveElement.h:258
virtual Color_t GetMainColor() const
Definition: TEveElement.h:272
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
Definition: TEveElement.h:257
virtual Char_t GetMainTransparency() const
Definition: TEveElement.h:281
virtual Bool_t GetRnrSelf() const
Definition: TEveElement.h:256
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
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
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=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1117
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1257
virtual void MapWindow()
map window
Definition: TGFrame.h:204
virtual void SetHeight(UInt_t h)
Definition: TGFrame.h:247
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:206
A composite frame that layout their children in horizontal way.
Definition: TGFrame.h:386
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
virtual Double_t GetNumber() const
virtual void SetNumber(Double_t val, Bool_t emit=kTRUE)
@ kNEANonNegative
Non-negative number.
Definition: TGNumberEntry.h:42
@ kNESInteger
Style of number entry field.
Definition: TGNumberEntry.h:25
@ kNELLimitMinMax
Both lower and upper limits.
Definition: TGNumberEntry.h:50
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: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