Logo ROOT  
Reference Guide
TEveArrowEditor.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 "TEveArrowEditor.h"
13#include "TEveArrow.h"
14#include "TGLabel.h"
15#include "TEveGValuators.h"
16
17/** \class TEveArrowEditor
18\ingroup TEve
19GUI editor for TEveArrow.
20*/
21
23
24////////////////////////////////////////////////////////////////////////////////
25
27 UInt_t options, Pixel_t back) :
28 TGedFrame(p, width, height, options | kVerticalFrame, back),
29 fM(0),
30
31 fTubeR(0),
32 fConeR(0),
33 fConeL(0),
34
35 fOrigin(0),
36 fVector(0)
37{
38 // Constructor.
39
40 MakeTitle("TEveArrow");
41 Int_t labelW = 51;
42
43 fTubeR = new TEveGValuator(this, "TubeR:", 90, 0);
44 fTubeR->SetLabelWidth(labelW);
46 fTubeR->Build();
48 fTubeR->Connect("ValueSet(Double_t)", "TEveArrowEditor", this, "DoTubeR()");
49 AddFrame(fTubeR, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
50
51 fConeR = new TEveGValuator(this, "ConeR:", 90, 0);
52 fConeR->SetLabelWidth(labelW);
54 fConeR->Build();
56 fConeR->Connect("ValueSet(Double_t)", "TEveArrowEditor", this, "DoConeR()");
57 AddFrame(fConeR, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
58
59 fConeL = new TEveGValuator(this, "ConeL:", 90, 0);
60 fConeL->SetLabelWidth(labelW);
62 fConeL->Build();
64 fConeL->Connect("ValueSet(Double_t)", "TEveArrowEditor", this, "DoConeL()");
65 AddFrame(fConeL, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
66
67 TGFont *font = gClient->GetFont("-adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-iso8859-1");
68 {
69 TGHorizontalFrame* hfp = new TGHorizontalFrame(this);
70 TGLabel* labp = new TGLabel(hfp, "Origin");
71 labp->SetTextFont(font);
72 hfp->AddFrame(labp);
73 AddFrame(hfp, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0,0,2,0));
74 fOrigin = new TEveGTriVecValuator(this, "Origin", 160, 20);
76 fOrigin->Build(kFALSE, "", "", "");
79 }
80
81 {
82 TGHorizontalFrame* hfp = new TGHorizontalFrame(this);
83 TGLabel* labp = new TGLabel(hfp, "Vector");
84 labp->SetTextFont(font);
85 hfp->AddFrame(labp);
86 AddFrame(hfp, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0,0,2,0));
87 fVector = new TEveGTriVecValuator(this, "Vector", 160, 20);
89 fVector->Build(kFALSE, "", "", "");
92 }
93
94 fVector->Connect("ValueSet()", "TEveArrowEditor", this, "DoVertex()");
95 fOrigin->Connect("ValueSet()", "TEveArrowEditor", this, "DoVertex()");
96}
97
98////////////////////////////////////////////////////////////////////////////////
99/// Set model object.
100
102{
103 fM = dynamic_cast<TEveArrow*>(obj);
104
108
111}
112
113////////////////////////////////////////////////////////////////////////////////
114/// Slot for TubeR.
115
117{
119 Update();
120}
121
122////////////////////////////////////////////////////////////////////////////////
123/// Slot for ConeR.
124
126{
128 Update();
129}
130
131////////////////////////////////////////////////////////////////////////////////
132/// Slot for ConeL.
133
135{
137 Update();
138}
139
140////////////////////////////////////////////////////////////////////////////////
141/// Slot for origin and vector.
142
144{
145 Double_t v[3];
147 fM->fOrigin.Set(v);
149 fM->fVector.Set(v);
150 fM->StampGeom();
151 Update();
152}
@ kVerticalFrame
Definition: GuiTypes.h:381
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
int Int_t
Definition: RtypesCore.h:45
unsigned int UInt_t
Definition: RtypesCore.h:46
const Bool_t kFALSE
Definition: RtypesCore.h:101
double Double_t
Definition: RtypesCore.h:59
#define ClassImp(name)
Definition: Rtypes.h:364
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
#define gClient
Definition: TGClient.h:157
@ kLHintsTop
Definition: TGLayout.h:27
@ kLHintsExpandX
Definition: TGLayout.h:30
GUI editor for TEveArrow.
TEveGValuator * fConeR
virtual void SetModel(TObject *obj)
Set model object.
void DoConeL()
Slot for ConeL.
TEveArrowEditor(const TEveArrowEditor &)
TEveArrow * fM
void DoVertex()
Slot for origin and vector.
void DoConeR()
Slot for ConeR.
TEveGTriVecValuator * fOrigin
TEveGValuator * fConeL
TEveGTriVecValuator * fVector
void DoTubeR()
Slot for TubeR.
TEveGValuator * fTubeR
Class used for display of a thick arrow.
Definition: TEveArrow.h:25
TEveVector fOrigin
Definition: TEveArrow.h:40
void SetConeR(Float_t x)
Definition: TEveArrow.h:60
Float_t fTubeR
Definition: TEveArrow.h:36
TEveVector fVector
Definition: TEveArrow.h:41
void StampGeom()
Definition: TEveArrow.h:53
void SetConeL(Float_t x)
Definition: TEveArrow.h:61
Float_t fConeL
Definition: TEveArrow.h:38
void SetTubeR(Float_t x)
Definition: TEveArrow.h:59
Composite GUI element for setting three numerical values (label, three number-entries).
void GetValues(Float_t &v0, Float_t &v1, Float_t &v2) const
void SetLimits(Int_t min, Int_t max)
Set limits for all three number-entries, integer values.
void Build(Bool_t vertical, const char *lab0, const char *lab1, const char *lab2)
Create sub-components (label, number entries).
void SetValues(Float_t v0, Float_t v1, Float_t v2)
void SetNELength(Int_t l)
void SetLabelWidth(Int_t w)
void SetNELength(Int_t l)
Composite GUI element for single value selection (supports label, number-entry and slider).
void SetLimits(Int_t min, Int_t max)
Set limits of the represented value for integer values.
virtual void Build(Bool_t connect=kTRUE)
Create sub-components (label, number entry, slider).
Float_t GetValue() const
virtual void SetValue(Float_t v, Bool_t emit=kFALSE)
Set value, optionally emit signal.
void Set(const Float_t *v)
Definition: TEveVector.h:82
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1117
Encapsulate fonts used in the GUI system.
Definition: TGFont.h:140
A composite frame that layout their children in horizontal way.
Definition: TGFrame.h:386
This class handles GUI labels.
Definition: TGLabel.h:24
virtual void SetTextFont(TGFont *font, Bool_t global=kFALSE)
Changes text font specified by pointer to TGFont object.
Definition: TGLabel.cxx:324
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
@ kNESRealThree
Fixed fraction real, three digit.
Definition: TGNumberEntry.h:28
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: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