Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TCurlyArcEditor.cxx
Go to the documentation of this file.
1// @(#)root/ged:$Id$
2// Author: Ilka Antcheva, Otto Schaile 15/12/04
3
4/*************************************************************************
5 * Copyright (C) 1995-2004, 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
13/** \class TCurlyArcEditor
14 \ingroup ged
15
16Implements GUI for editing CurlyArc attributes: radius, phi1, phi2.
17
18*/
19
20
21#include "TCurlyArcEditor.h"
22#include "TGLabel.h"
23#include "TGNumberEntry.h"
24#include "TCurlyArc.h"
25#include <iostream>
26
27
35
36////////////////////////////////////////////////////////////////////////////////
37/// Constructor of CurlyArc GUI.
38
40 Int_t height, UInt_t options, Pixel_t back)
41 : TGedFrame(p, width, height, options | kVerticalFrame, back)
42{
43 fCurlyArc = 0;
44
45 MakeTitle("Curly Arc");
46
47 TGCompositeFrame *f3 = new TGCompositeFrame(this, 80, 20, kHorizontalFrame);
48 AddFrame(f3, new TGLayoutHints(kLHintsTop, 1, 1, 2, 0));
49
50 TGCompositeFrame *f3a = new TGCompositeFrame(f3, 80, 20);
51 f3->AddFrame(f3a, new TGLayoutHints(kLHintsTop, 1, 1, 0, 0));
52
53 TGLabel *fRadiusLabel = new TGLabel(f3a, "Radius:");
54 f3a->AddFrame(fRadiusLabel, new TGLayoutHints(kLHintsNormal, 8, 0, 5, 5));
55
56 TGLabel *fPhiminLabel = new TGLabel(f3a, "Phimin:");
57 f3a->AddFrame(fPhiminLabel, new TGLayoutHints(kLHintsNormal, 8, 0, 5, 5));
58
59 TGLabel *fPhimaxLabel = new TGLabel(f3a, "Phimax:");
60 f3a->AddFrame(fPhimaxLabel, new TGLayoutHints(kLHintsNormal, 8, 0, 5, 5));
61
62 TGLabel *fCenterXLabel = new TGLabel(f3a, "Center X:");
63 f3a->AddFrame(fCenterXLabel, new TGLayoutHints(kLHintsNormal, 8, 0, 6, 5));
64
65 TGLabel *fCenterYLabel = new TGLabel(f3a, "Y:");
66 f3a->AddFrame(fCenterYLabel, new TGLayoutHints(kLHintsNormal, 49, 0, 6, 0));
67
68 TGCompositeFrame *f3b = new TGCompositeFrame(f3, 80, 20);
69 f3->AddFrame(f3b, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
70
75 fRadiusEntry->GetNumberEntry()->SetToolTipText("Set radius of arc.");
76 f3b->AddFrame(fRadiusEntry, new TGLayoutHints(kLHintsLeft, 6, 1, 3, 1));
77
82 fPhiminEntry->GetNumberEntry()->SetToolTipText("Set Phimin in degrees.");
83 f3b->AddFrame(fPhiminEntry, new TGLayoutHints(kLHintsLeft, 6, 1, 3, 1));
84
89 fPhimaxEntry->GetNumberEntry()->SetToolTipText("Set Phimax in degrees.");
90 f3b->AddFrame(fPhimaxEntry, new TGLayoutHints(kLHintsLeft, 6, 1, 3, 1));
91
96 fCenterXEntry->GetNumberEntry()->SetToolTipText("Set center X coordinate.");
97 f3b->AddFrame(fCenterXEntry, new TGLayoutHints(kLHintsLeft, 6, 1, 3, 1));
98
103 fCenterYEntry->GetNumberEntry()->SetToolTipText("Set center Y coordinate.");
104 f3b->AddFrame(fCenterYEntry, new TGLayoutHints(kLHintsLeft, 6, 1, 3, 1));
105
106}
107
108////////////////////////////////////////////////////////////////////////////////
109/// Destructor of CurlyArc editor.
110
114
115////////////////////////////////////////////////////////////////////////////////
116/// Connect signals to slots.
117
119{
120 fCenterXEntry->Connect("ValueSet(Long_t)", "TCurlyArcEditor", this, "DoCenterXY()");
121 (fCenterXEntry->GetNumberEntry())->Connect("ReturnPressed()", "TCurlyArcEditor", this, "DoCenterXY()");
122 fCenterYEntry->Connect("ValueSet(Long_t)", "TCurlyArcEditor", this, "DoCenterXY()");
123 (fCenterYEntry->GetNumberEntry())->Connect("ReturnPressed()", "TCurlyArcEditor", this, "DoCenterXY()");
124 fRadiusEntry->Connect("ValueSet(Long_t)", "TCurlyArcEditor", this, "DoRadius()");
125 (fRadiusEntry->GetNumberEntry())->Connect("ReturnPressed()", "TCurlyArcEditor", this, "DoRadius()");
126 fPhiminEntry->Connect("ValueSet(Long_t)", "TCurlyArcEditor", this, "DoPhimin()");
127 (fPhiminEntry->GetNumberEntry())->Connect("ReturnPressed()", "TCurlyArcEditor", this, "DoPhimin()");
128 fPhimaxEntry->Connect("ValueSet(Long_t)", "TCurlyArcEditor", this, "DoPhimax()");
129 (fPhimaxEntry->GetNumberEntry())->Connect("ReturnPressed()", "TCurlyArcEditor", this, "DoPhimax()");
130
131 fInit = kFALSE;
132}
133
134////////////////////////////////////////////////////////////////////////////////
135/// Pick up the used curly arc attributes.
136
138{
139 fCurlyArc = (TCurlyArc *)obj;
141
144
145 val = fCurlyArc->GetPhimin();
147
148 val = fCurlyArc->GetPhimax();
150
151 val = fCurlyArc->GetStartX();
153
154 val = fCurlyArc->GetStartY();
156
158
160}
161
162////////////////////////////////////////////////////////////////////////////////
163/// Slot connected to set center .
164
172
173////////////////////////////////////////////////////////////////////////////////
174/// Slot connected to the radius setting.
175
183
184////////////////////////////////////////////////////////////////////////////////
185/// Slot connected to the phimin setting.
186
194
195////////////////////////////////////////////////////////////////////////////////
196/// Slot connected to the phimax setting.
197
@ kVerticalFrame
Definition GuiTypes.h:381
@ kHorizontalFrame
Definition GuiTypes.h:382
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
ECurlyArcWid
@ kCRLA_RAD
@ kCRLA_FMAX
@ kCRLA_CY
@ kCRLA_FMIN
@ kCRLA_CX
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsNormal
Definition TGLayout.h:32
@ kLHintsTop
Definition TGLayout.h:27
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
~TCurlyArcEditor() override
Destructor of CurlyArc editor.
void SetModel(TObject *obj) override
Pick up the used curly arc attributes.
TCurlyArcEditor(const TGWindow *p=nullptr, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Constructor of CurlyArc GUI.
virtual void DoCenterXY()
Slot connected to set center .
virtual void DoPhimin()
Slot connected to the phimin setting.
TGNumberEntry * fCenterYEntry
center y entry
virtual void ConnectSignals2Slots()
Connect signals to slots.
TCurlyArc * fCurlyArc
CurlyArc object.
TGNumberEntry * fRadiusEntry
radius entry
virtual void DoRadius()
Slot connected to the radius setting.
TGNumberEntry * fPhimaxEntry
Phimax entry.
TGNumberEntry * fCenterXEntry
center x entry
TGNumberEntry * fPhiminEntry
Phimin entry.
virtual void DoPhimax()
Slot connected to the phimax setting.
Implements curly or wavy arcs used to draw Feynman diagrams.
Definition TCurlyArc.h:16
Double_t GetPhimax() const
Definition TCurlyArc.h:40
virtual void SetRadius(Double_t radius)
Set Curly Arc radius.
virtual void SetPhimin(Double_t phimin)
Set Curly Arc minimum Phi.
virtual void SetCenter(Double_t x1, Double_t y1)
Set Curly Arc center.
Double_t GetRadius() const
Definition TCurlyArc.h:38
Double_t GetPhimin() const
Definition TCurlyArc.h:39
virtual void SetPhimax(Double_t phimax)
Set Curly Arc maximum Phi.
Double_t GetStartY() const
Definition TCurlyLine.h:49
Double_t GetStartX() const
Definition TCurlyLine.h:47
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:289
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
TGCompositeFrame(const TGCompositeFrame &)=delete
This class handles GUI labels.
Definition TGLabel.h:24
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
TGNumberEntry is a number entry input widget with up/down buttons.
TGNumberEntryField * GetNumberEntry() const
Get the number entry field.
virtual Double_t GetNumber() const
virtual void SetNumber(Double_t val, Bool_t emit=kTRUE)
@ kNEANonNegative
Non-negative number.
@ kNESRealThree
Fixed fraction real, three digit.
@ kNESInteger
Style of number entry field.
@ kNELNoLimits
Limit selection of number entry field.
@ kNELLimitMinMax
Both lower and upper limits.
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
ROOT GUI Window base class.
Definition TGWindow.h:23
Base frame for implementing GUI - a service class.
Definition TGedFrame.h:27
Bool_t fInit
init flag for setting signals/slots
Definition TGedFrame.h:47
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
Bool_t fAvoidSignal
flag for executing slots
Definition TGedFrame.h:50
Mother of all ROOT objects.
Definition TObject.h:41
virtual Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
Definition TObject.cxx:441
void Paint(Option_t *option="") override
Paint this polyline with its current attributes.
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