Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
22
23////////////////////////////////////////////////////////////////////////////////
24
26 UInt_t options, Pixel_t back) :
27 TGedFrame(p, width, height, options | kVerticalFrame, back),
28 fM(nullptr),
29
30 fTubeR(nullptr),
31 fConeR(nullptr),
32 fConeL(nullptr),
33
34 fOrigin(nullptr),
35 fVector(nullptr)
36{
37 // Constructor.
38
39 MakeTitle("TEveArrow");
40 Int_t labelW = 51;
41
42 fTubeR = new TEveGValuator(this, "TubeR:", 90, 0);
45 fTubeR->Build();
47 fTubeR->Connect("ValueSet(Double_t)", "TEveArrowEditor", this, "DoTubeR()");
48 AddFrame(fTubeR, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
49
50 fConeR = new TEveGValuator(this, "ConeR:", 90, 0);
53 fConeR->Build();
55 fConeR->Connect("ValueSet(Double_t)", "TEveArrowEditor", this, "DoConeR()");
56 AddFrame(fConeR, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
57
58 fConeL = new TEveGValuator(this, "ConeL:", 90, 0);
61 fConeL->Build();
63 fConeL->Connect("ValueSet(Double_t)", "TEveArrowEditor", this, "DoConeL()");
64 AddFrame(fConeL, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
65
66 TGFont *font = gClient->GetFont("-adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-iso8859-1");
67 {
69 TGLabel* labp = new TGLabel(hfp, "Origin");
70 labp->SetTextFont(font);
71 hfp->AddFrame(labp);
73 fOrigin = new TEveGTriVecValuator(this, "Origin", 160, 20);
75 fOrigin->Build(kFALSE, "", "", "");
78 }
79
80 {
82 TGLabel* labp = new TGLabel(hfp, "Vector");
83 labp->SetTextFont(font);
84 hfp->AddFrame(labp);
86 fVector = new TEveGTriVecValuator(this, "Vector", 160, 20);
88 fVector->Build(kFALSE, "", "", "");
91 }
92
93 fVector->Connect("ValueSet()", "TEveArrowEditor", this, "DoVertex()");
94 fOrigin->Connect("ValueSet()", "TEveArrowEditor", this, "DoVertex()");
95}
96
97////////////////////////////////////////////////////////////////////////////////
98/// Set model object.
99
101{
102 fM = dynamic_cast<TEveArrow*>(obj);
103
107
110}
111
112////////////////////////////////////////////////////////////////////////////////
113/// Slot for TubeR.
114
116{
118 Update();
119}
120
121////////////////////////////////////////////////////////////////////////////////
122/// Slot for ConeR.
123
125{
127 Update();
128}
129
130////////////////////////////////////////////////////////////////////////////////
131/// Slot for ConeL.
132
134{
136 Update();
137}
138
139////////////////////////////////////////////////////////////////////////////////
140/// Slot for origin and vector.
141
143{
144 Double_t v[3];
146 fM->fOrigin.Set(v);
148 fM->fVector.Set(v);
149 fM->StampGeom();
150 Update();
151}
@ kVerticalFrame
Definition GuiTypes.h:381
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
#define gClient
Definition TGClient.h:157
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
winID h TVirtualViewer3D TVirtualGLPainter p
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
TEveGValuator * fConeR
void DoConeL()
Slot for ConeL.
TEveArrowEditor(const TEveArrowEditor &)
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
void SetModel(TObject *obj) override
Set model object.
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 Build(Bool_t connect=kTRUE) override
Create sub-components (label, number entry, slider).
void SetLimits(Int_t min, Int_t max)
Set limits of the represented value for integer values.
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=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
Encapsulate fonts used in the GUI system.
Definition TGFont.h:140
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
@ kNESRealThree
Fixed fraction real, three digit.
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