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
28
29////////////////////////////////////////////////////////////////////////////////
30/// Constructor.
31
33 UInt_t options, Pixel_t back) :
34 TGedFrame(p, width, height, options | kVerticalFrame, back),
35 fM(nullptr),
36 fLineWidth(nullptr),
37 fLineColor(nullptr),
38 fDrawFrame(nullptr),
39 fHighlightFrame(nullptr)
40{
41 MakeTitle("TEveShape");
42
43 {
45
46 TGLabel *l = new TGLabel(f, "LineColor:");
47 f->AddFrame(l, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
48 fLineColor = new TGColorSelect(f, 0, -1);
49 fLineColor->Connect("ColorSelected(Pixel_t)", "TEveShapeEditor", this, "DoLineColor(Pixel_t)");
50 f->AddFrame(fLineColor, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
51
52 fLineWidth = new TGNumberEntry(f, 0., 4, -1,
55 fLineWidth->GetNumberEntry()->SetToolTipText("Line width of outline.");
56 fLineWidth->Connect("ValueSet(Long_t)", "TEveShapeEditor", this, "DoLineWidth()");
57 f->AddFrame(fLineWidth, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
58
59 AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 0, 0));
60 }
61 {
63
64 fDrawFrame = new TGCheckButton(f, "Draw Frame");
65 f->AddFrame(fDrawFrame, new TGLayoutHints(kLHintsLeft, 1,2,0,0));
66 fDrawFrame->Connect("Toggled(Bool_t)", "TEveShapeEditor", this, "DoDrawFrame()");
67
68 fHighlightFrame = new TGCheckButton(f, "Highlight Frame");
69 f->AddFrame(fHighlightFrame, new TGLayoutHints(kLHintsLeft, 2,1,0,0));
70 fHighlightFrame->Connect("Toggled(Bool_t)", "TEveShapeEditor", this, "DoHighlightFrame()");
71
72 AddFrame(f, new TGLayoutHints(kLHintsTop, 0,0,2,1));
73 }
74}
75
76////////////////////////////////////////////////////////////////////////////////
77/// Set model object.
78
88
89////////////////////////////////////////////////////////////////////////////////
90/// Slot for setting line with of polygon outline.
91
97
98////////////////////////////////////////////////////////////////////////////////
99/// Slot for setting line color of polygon outline.
100
106
107////////////////////////////////////////////////////////////////////////////////
108/// Slot for DrawFrame.
109
115
116////////////////////////////////////////////////////////////////////////////////
117/// Slot for HighlightFrame.
118
@ 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:108
@ 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:2445
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:1926
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:289
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
TGCompositeFrame(const TGCompositeFrame &)=delete
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)
@ 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:94
virtual void Update()
Update the current pad when an attribute is changed via GUI.
Definition TGedFrame.cxx:71
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
TLine l
Definition textangle.C:4