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
19 GUI 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);
45  fTubeR->SetNELength(6);
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);
53  fConeR->SetNELength(6);
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);
61  fConeL->SetNELength(6);
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);
75  fOrigin->SetNELength(6);
76  fOrigin->Build(kFALSE, "", "", "");
78  AddFrame(fOrigin, new TGLayoutHints(kLHintsTop , 0,0,0,0));
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);
88  fVector->SetNELength(6);
89  fVector->Build(kFALSE, "", "", "");
91  AddFrame(fVector, new TGLayoutHints(kLHintsTop , 0,0,0,0));
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 
109  fOrigin->SetValues(&fM->fOrigin[0]);
110  fVector->SetValues(&fM->fVector[0]);
111 }
112 
113 ////////////////////////////////////////////////////////////////////////////////
114 /// Slot for TubeR.
115 
117 {
118  fM->SetTubeR(fTubeR->GetValue());
119  Update();
120 }
121 
122 ////////////////////////////////////////////////////////////////////////////////
123 /// Slot for ConeR.
124 
126 {
127  fM->SetConeR(fConeR->GetValue());
128  Update();
129 }
130 
131 ////////////////////////////////////////////////////////////////////////////////
132 /// Slot for ConeL.
133 
135 {
136  fM->SetConeL(fConeL->GetValue());
137  Update();
138 }
139 
140 ////////////////////////////////////////////////////////////////////////////////
141 /// Slot for origin and vector.
142 
144 {
145  Double_t v[3];
146  fOrigin->GetValues(v);
147  fM->fOrigin.Set(v);
148  fVector->GetValues(v);
149  fM->fVector.Set(v);
150  fM->StampGeom();
151  Update();
152 }
TGWindow
Definition: TGWindow.h:31
TEveArrowEditor::fConeL
TEveGValuator * fConeL
Definition: TEveArrowEditor.h:32
TEveGTriVecValuator::SetValues
void SetValues(Float_t v0, Float_t v1, Float_t v2)
Definition: TEveGValuators.h:181
TEveGTriVecValuator
Definition: TEveGValuators.h:150
TEveArrow::fConeL
Float_t fConeL
Definition: TEveArrow.h:44
TEveArrow::StampGeom
void StampGeom()
Definition: TEveArrow.h:59
TEveGTriVecValuator::Build
void Build(Bool_t vertical, const char *lab0, const char *lab1, const char *lab2)
Create sub-components (label, number entries).
Definition: TEveGValuators.cxx:437
kLHintsTop
@ kLHintsTop
Definition: TGLayout.h:40
Pixel_t
ULong_t Pixel_t
Definition: GuiTypes.h:39
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TEveArrow::SetConeR
void SetConeR(Float_t x)
Definition: TEveArrow.h:66
kVerticalFrame
@ kVerticalFrame
Definition: GuiTypes.h:381
TEveGValuator
Definition: TEveGValuators.h:57
TGNumberFormat::kNESRealThree
@ kNESRealThree
Definition: TGNumberEntry.h:49
TGLabel
Definition: TGLabel.h:32
TEveArrowEditor::fOrigin
TEveGTriVecValuator * fOrigin
Definition: TEveArrowEditor.h:34
width
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
TEveArrow
Definition: TEveArrow.h:21
TEveGTriVecValuator::GetValues
void GetValues(Float_t &v0, Float_t &v1, Float_t &v2) const
Definition: TEveGValuators.h:174
TEveGValuator::GetValue
Float_t GetValue() const
Definition: TEveGValuators.h:80
TGHorizontalFrame
Definition: TGFrame.h:423
TEveArrowEditor::fConeR
TEveGValuator * fConeR
Definition: TEveArrowEditor.h:31
TGedFrame::Update
virtual void Update()
Update the current pad when an attribute is changed via GUI.
Definition: TGedFrame.cxx:73
v
@ v
Definition: rootcling_impl.cxx:3635
TEveGValuators.h
TEveGValuator::Build
virtual void Build(Bool_t connect=kTRUE)
Create sub-components (label, number entry, slider).
Definition: TEveGValuators.cxx:74
TEveArrow::fOrigin
TEveVector fOrigin
Definition: TEveArrow.h:46
TEveGValuator::SetLimits
void SetLimits(Int_t min, Int_t max)
Set limits of the represented value for integer values.
Definition: TEveGValuators.cxx:151
gClient
#define gClient
Definition: TGClient.h:166
TEveArrowEditor::DoConeR
void DoConeR()
Slot for ConeR.
Definition: TEveArrowEditor.cxx:125
TEveArrowEditor::SetModel
virtual void SetModel(TObject *obj)
Set model object.
Definition: TEveArrowEditor.cxx:101
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TEveArrowEditor::fVector
TEveGTriVecValuator * fVector
Definition: TEveArrowEditor.h:35
TEveArrowEditor::DoVertex
void DoVertex()
Slot for origin and vector.
Definition: TEveArrowEditor.cxx:143
TGLayoutHints
Definition: TGLayout.h:57
TEveArrowEditor::fM
TEveArrow * fM
Definition: TEveArrowEditor.h:28
TEveGTriVecValuator::SetNELength
void SetNELength(Int_t l)
Definition: TEveGValuators.h:192
TEveGValuatorBase::SetNELength
void SetNELength(Int_t l)
Definition: TEveGValuators.h:46
TEveGValuator::SetValue
virtual void SetValue(Float_t v, Bool_t emit=kFALSE)
Set value, optionally emit signal.
Definition: TEveGValuators.cxx:206
TEveArrow::fVector
TEveVector fVector
Definition: TEveArrow.h:47
TGedFrame::MakeTitle
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition: TGedFrame.cxx:96
TEveArrowEditor::fTubeR
TEveGValuator * fTubeR
Definition: TEveArrowEditor.h:30
TEveArrow::SetTubeR
void SetTubeR(Float_t x)
Definition: TEveArrow.h:65
unsigned int
TGLabel::SetTextFont
virtual void SetTextFont(TGFont *font, Bool_t global=kFALSE)
Changes text font specified by pointer to TGFont object.
Definition: TGLabel.cxx:323
TEveArrowEditor::DoTubeR
void DoTubeR()
Slot for TubeR.
Definition: TEveArrowEditor.cxx:116
TEveArrowEditor
Definition: TEveArrowEditor.h:21
TGedFrame
Definition: TGedFrame.h:33
TGLabel.h
Double_t
double Double_t
Definition: RtypesCore.h:59
TQObject::Connect
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:864
TEveGTriVecValuator::SetLimits
void SetLimits(Int_t min, Int_t max)
Set limits for all three number-entries, integer values.
Definition: TEveGValuators.cxx:470
TObject
Definition: TObject.h:37
TEveGValuatorBase::SetLabelWidth
void SetLabelWidth(Int_t w)
Definition: TEveGValuators.h:42
TEveArrow::fTubeR
Float_t fTubeR
Definition: TEveArrow.h:42
TEveArrow::SetConeL
void SetConeL(Float_t x)
Definition: TEveArrow.h:67
kLHintsExpandX
@ kLHintsExpandX
Definition: TGLayout.h:43
TEveArrowEditor.h
TGFont
Definition: TGFont.h:149
TEveArrowEditor::DoConeL
void DoConeL()
Slot for ConeL.
Definition: TEveArrowEditor.cxx:134
TEveArrow.h
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1102
TEveVectorT::Set
void Set(const Float_t *v)
Definition: TEveVector.h:82
int
TEveArrowEditor::TEveArrowEditor
TEveArrowEditor(const TEveArrowEditor &)