Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TEveShapeEditor.cxx
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Author: Matevz Tadel 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 "TEveShapeEditor.h"
13#include "TEveShape.h"
14
15#include "TColor.h"
16
17#include "TGLabel.h"
18#include "TGButton.h"
19#include "TGNumberEntry.h"
20#include "TGColorSelect.h"
21
22
23/** \class TEveShapeEditor
24\ingroup TEve
25GUI editor for TEveShape.
26*/
27
29
30////////////////////////////////////////////////////////////////////////////////
31/// Constructor.
32
34 UInt_t options, Pixel_t back) :
35 TGedFrame(p, width, height, options | kVerticalFrame, back),
36 fM(nullptr),
37 fLineWidth(nullptr),
38 fLineColor(nullptr),
39 fDrawFrame(nullptr),
40 fHighlightFrame(nullptr)
41{
42 MakeTitle("TEveShape");
43
44 {
46
47 TGLabel *l = new TGLabel(f, "LineColor:");
48 f->AddFrame(l, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
49 fLineColor = new TGColorSelect(f, 0, -1);
50 fLineColor->Connect("ColorSelected(Pixel_t)", "TEveShapeEditor", this, "DoLineColor(Pixel_t)");
51 f->AddFrame(fLineColor, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
52
53 fLineWidth = new TGNumberEntry(f, 0., 4, -1,
56 fLineWidth->GetNumberEntry()->SetToolTipText("Line width of outline.");
57 fLineWidth->Connect("ValueSet(Long_t)", "TEveShapeEditor", this, "DoLineWidth()");
58 f->AddFrame(fLineWidth, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
59
60 AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 0, 0));
61 }
62 {
64
65 fDrawFrame = new TGCheckButton(f, "Draw Frame");
66 f->AddFrame(fDrawFrame, new TGLayoutHints(kLHintsLeft, 1,2,0,0));
67 fDrawFrame->Connect("Toggled(Bool_t)", "TEveShapeEditor", this, "DoDrawFrame()");
68
69 fHighlightFrame = new TGCheckButton(f, "Highlight Frame");
70 f->AddFrame(fHighlightFrame, new TGLayoutHints(kLHintsLeft, 2,1,0,0));
71 fHighlightFrame->Connect("Toggled(Bool_t)", "TEveShapeEditor", this, "DoHighlightFrame()");
72
73 AddFrame(f, new TGLayoutHints(kLHintsTop, 0,0,2,1));
74 }
75}
76
77////////////////////////////////////////////////////////////////////////////////
78/// Set model object.
79
81{
82 fM = dynamic_cast<TEveShape*>(obj);
83
88}
89
90////////////////////////////////////////////////////////////////////////////////
91/// Slot for setting line with of polygon outline.
92
94{
96 Update();
97}
98
99////////////////////////////////////////////////////////////////////////////////
100/// Slot for setting line color of polygon outline.
101
103{
105 Update();
106}
107
108////////////////////////////////////////////////////////////////////////////////
109/// Slot for DrawFrame.
110
112{
114 Update();
115}
116
117////////////////////////////////////////////////////////////////////////////////
118/// Slot for HighlightFrame.
119
121{
123 Update();
124}
@ kVerticalFrame
Definition GuiTypes.h:381
@ kHorizontalFrame
Definition GuiTypes.h:382
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
#define f(i)
Definition RSha256.hxx:104
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
#define ClassImp(name)
Definition Rtypes.h:382
@ kButtonDown
Definition TGButton.h:54
@ kButtonUp
Definition TGButton.h:53
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsTop
Definition TGLayout.h:27
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void pixel
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:2437
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
Definition TColor.cxx:1920
GUI editor for TEveShape.
void DoHighlightFrame()
Slot for HighlightFrame.
TGCheckButton * fDrawFrame
TGNumberEntry * fLineWidth
TEveShapeEditor(const TEveShapeEditor &)
TGColorSelect * fLineColor
void DoLineColor(Pixel_t color)
Slot for setting line color of polygon outline.
void SetModel(TObject *obj) override
Set model object.
void DoLineWidth()
Slot for setting line with of polygon outline.
TGCheckButton * fHighlightFrame
void DoDrawFrame()
Slot for DrawFrame.
Abstract base-class for 2D/3D shapes.
Definition TEveShape.h:26
virtual void SetLineColor(Color_t c)
Definition TEveShape.h:61
Bool_t fDrawFrame
Definition TEveShape.h:42
Bool_t fHighlightFrame
Definition TEveShape.h:43
Float_t fLineWidth
Definition TEveShape.h:40
virtual void SetDrawFrame(Bool_t f)
Definition TEveShape.h:63
Color_t fLineColor
Definition TEveShape.h:39
virtual void SetHighlightFrame(Bool_t f)
Definition TEveShape.h:64
virtual void SetLineWidth(Float_t lw)
Definition TEveShape.h:62
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.
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
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)
@ kNEAPositive
Positive number.
@ kNESRealOne
Fixed fraction real, one digit.
@ 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
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
TLine l
Definition textangle.C:4