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 "TVirtualPad.h"
15#include "TGLabel.h"
16#include "TEveGValuators.h"
17
18/** \class TEveArrowEditor
19\ingroup TEve
20GUI editor for TEveArrow.
21*/
22
24
25////////////////////////////////////////////////////////////////////////////////
26
28 UInt_t options, Pixel_t back) :
29 TGedFrame(p, width, height, options | kVerticalFrame, back),
30 fM(0),
31
32 fTubeR(0),
33 fConeR(0),
34 fConeL(0),
35
36 fOrigin(0),
37 fVector(0)
38{
39 // Constructor.
40
41 MakeTitle("TEveArrow");
42 Int_t labelW = 51;
43
44 fTubeR = new TEveGValuator(this, "TubeR:", 90, 0);
45 fTubeR->SetLabelWidth(labelW);
47 fTubeR->Build();
49 fTubeR->Connect("ValueSet(Double_t)", "TEveArrowEditor", this, "DoTubeR()");
50 AddFrame(fTubeR, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
51
52 fConeR = new TEveGValuator(this, "ConeR:", 90, 0);
53 fConeR->SetLabelWidth(labelW);
55 fConeR->Build();
57 fConeR->Connect("ValueSet(Double_t)", "TEveArrowEditor", this, "DoConeR()");
58 AddFrame(fConeR, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
59
60 fConeL = new TEveGValuator(this, "ConeL:", 90, 0);
61 fConeL->SetLabelWidth(labelW);
63 fConeL->Build();
65 fConeL->Connect("ValueSet(Double_t)", "TEveArrowEditor", this, "DoConeL()");
66 AddFrame(fConeL, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
67
68 TGFont *font = gClient->GetFont("-adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-iso8859-1");
69 {
70 TGHorizontalFrame* hfp = new TGHorizontalFrame(this);
71 TGLabel* labp = new TGLabel(hfp, "Origin");
72 labp->SetTextFont(font);
73 hfp->AddFrame(labp);
74 AddFrame(hfp, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0,0,2,0));
75 fOrigin = new TEveGTriVecValuator(this, "Origin", 160, 20);
77 fOrigin->Build(kFALSE, "", "", "");
80 }
81
82 {
83 TGHorizontalFrame* hfp = new TGHorizontalFrame(this);
84 TGLabel* labp = new TGLabel(hfp, "Vector");
85 labp->SetTextFont(font);
86 hfp->AddFrame(labp);
87 AddFrame(hfp, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0,0,2,0));
88 fVector = new TEveGTriVecValuator(this, "Vector", 160, 20);
90 fVector->Build(kFALSE, "", "", "");
93 }
94
95 fVector->Connect("ValueSet()", "TEveArrowEditor", this, "DoVertex()");
96 fOrigin->Connect("ValueSet()", "TEveArrowEditor", this, "DoVertex()");
97}
98
99////////////////////////////////////////////////////////////////////////////////
100/// Set model object.
101
103{
104 fM = dynamic_cast<TEveArrow*>(obj);
105
109
112}
113
114////////////////////////////////////////////////////////////////////////////////
115/// Slot for TubeR.
116
118{
120 Update();
121}
122
123////////////////////////////////////////////////////////////////////////////////
124/// Slot for ConeR.
125
127{
129 Update();
130}
131
132////////////////////////////////////////////////////////////////////////////////
133/// Slot for ConeL.
134
136{
138 Update();
139}
140
141////////////////////////////////////////////////////////////////////////////////
142/// Slot for origin and vector.
143
145{
146 Double_t v[3];
148 fM->fOrigin.Set(v);
150 fM->fVector.Set(v);
151 fM->StampGeom();
152 Update();
153}
@ kVerticalFrame
Definition: GuiTypes.h:381
ULong_t Pixel_t
Definition: GuiTypes.h:39
const Bool_t kFALSE
Definition: RtypesCore.h:90
double Double_t
Definition: RtypesCore.h:57
#define ClassImp(name)
Definition: Rtypes.h:361
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
#define gClient
Definition: TGClient.h:166
@ kLHintsTop
Definition: TGLayout.h:34
@ kLHintsExpandX
Definition: TGLayout.h:37
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:81
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1101
Definition: TGFont.h:149
virtual void SetTextFont(TGFont *font, Bool_t global=kFALSE)
Changes text font specified by pointer to TGFont object.
Definition: TGLabel.cxx:322
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:866