Logo ROOT  
Reference Guide
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// Cleanup these includes:
18#include "TGLabel.h"
19#include "TGButton.h"
20#include "TGNumberEntry.h"
21#include "TGColorSelect.h"
22#include "TGColorDialog.h"
23
24
25/** \class TEveShapeEditor
26\ingroup TEve
27GUI editor for TEveShape.
28*/
29
31
32////////////////////////////////////////////////////////////////////////////////
33/// Constructor.
34
36 UInt_t options, Pixel_t back) :
37 TGedFrame(p, width, height, options | kVerticalFrame, back),
38 fM(0),
39 fLineWidth(0),
40 fLineColor(0),
41 fDrawFrame(0),
42 fHighlightFrame(0)
43{
44 MakeTitle("TEveShape");
45
46 {
48
49 TGLabel *l = new TGLabel(f, "LineColor:");
50 f->AddFrame(l, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 0));
51 fLineColor = new TGColorSelect(f, 0, -1);
52 fLineColor->Connect("ColorSelected(Pixel_t)", "TEveShapeEditor", this, "DoLineColor(Pixel_t)");
53 f->AddFrame(fLineColor, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
54
55 fLineWidth = new TGNumberEntry(f, 0., 4, -1,
58 fLineWidth->GetNumberEntry()->SetToolTipText("Line width of outline.");
59 fLineWidth->Connect("ValueSet(Long_t)", "TEveShapeEditor", this, "DoLineWidth()");
60 f->AddFrame(fLineWidth, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
61
62 AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 0, 0));
63 }
64 {
66
67 fDrawFrame = new TGCheckButton(f, "Draw Frame");
68 f->AddFrame(fDrawFrame, new TGLayoutHints(kLHintsLeft, 1,2,0,0));
69 fDrawFrame->Connect("Toggled(Bool_t)", "TEveShapeEditor", this, "DoDrawFrame()");
70
71 fHighlightFrame = new TGCheckButton(f, "Highlight Frame");
72 f->AddFrame(fHighlightFrame, new TGLayoutHints(kLHintsLeft, 2,1,0,0));
73 fHighlightFrame->Connect("Toggled(Bool_t)", "TEveShapeEditor", this, "DoHighlightFrame()");
74
75 AddFrame(f, new TGLayoutHints(kLHintsTop, 0,0,2,1));
76 }
77}
78
79////////////////////////////////////////////////////////////////////////////////
80/// Set model object.
81
83{
84 fM = dynamic_cast<TEveShape*>(obj);
85
90}
91
92////////////////////////////////////////////////////////////////////////////////
93/// Slot for setting line with of polygon outline.
94
96{
98 Update();
99}
100
101////////////////////////////////////////////////////////////////////////////////
102/// Slot for setting line color of polygon outline.
103
105{
107 Update();
108}
109
110////////////////////////////////////////////////////////////////////////////////
111/// Slot for DrawFrame.
112
114{
116 Update();
117}
118
119////////////////////////////////////////////////////////////////////////////////
120/// Slot for HighlightFrame.
121
123{
125 Update();
126}
ULong_t Pixel_t
Definition: GuiTypes.h:39
#define f(i)
Definition: RSha256.hxx:104
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
#define ClassImp(name)
Definition: Rtypes.h:365
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
@ kVerticalFrame
Definition: TGFrame.h:59
@ kHorizontalFrame
Definition: TGFrame.h:60
@ kLHintsLeft
Definition: TGLayout.h:31
@ kLHintsTop
Definition: TGLayout.h:34
static ULong_t Number2Pixel(Int_t ci)
Static method that given a color index number, returns the corresponding pixel value.
Definition: TColor.cxx:2003
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:1764
GUI editor for TEveShape.
void DoHighlightFrame()
Slot for HighlightFrame.
TGCheckButton * fDrawFrame
TGNumberEntry * fLineWidth
virtual void SetModel(TObject *obj)
Set model object.
TEveShapeEditor(const TEveShapeEditor &)
TGColorSelect * fLineColor
void DoLineColor(Pixel_t color)
Slot for setting line color of polygon outline.
void DoLineWidth()
Slot for setting line with of polygon outline.
TEveShape * fM
TGCheckButton * fHighlightFrame
void DoDrawFrame()
Slot for DrawFrame.
Abstract base-class for 2D/3D shapes.
Definition: TEveShape.h:25
virtual void SetLineColor(Color_t c)
Definition: TEveShape.h:60
Bool_t fDrawFrame
Definition: TEveShape.h:41
Bool_t fHighlightFrame
Definition: TEveShape.h:42
Float_t fLineWidth
Definition: TEveShape.h:39
virtual void SetDrawFrame(Bool_t f)
Definition: TEveShape.h:62
Color_t fLineColor
Definition: TEveShape.h:38
virtual void SetHighlightFrame(Bool_t f)
Definition: TEveShape.h:63
virtual void SetLineWidth(Float_t lw)
Definition: TEveShape.h:61
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:1200
void SetColor(Pixel_t color, Bool_t emit=kTRUE)
Set color.
TGCompositeFrame(const TGCompositeFrame &)
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
virtual void SetNumber(Double_t val)
TGNumberEntryField * GetNumberEntry() const
virtual Double_t GetNumber() const
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition: TGedFrame.cxx:96
virtual void Update()
Update the current pad when an attribute is changed via GUI.
Definition: TGedFrame.cxx:73
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:867
auto * l
Definition: textangle.C:4