61 : fR1(rad), fPhimin(phimin),fPhimax(phimax)
87 pixeltoX = xrange / pxrange;
88 pixeltoY = yrange/pyrange;
89 rPix =
fR1 / pixeltoX;
92 if (dang < 0) dang += 360;
107 xx = (yv[i] + rPix) * cos(
angle);
108 yy = (yv[i] + rPix) * sin(
angle);
125 if (!
gPad)
return 9999;
136 if (phi < fPhimin || phi >
fPhimax)
return 9999;
164 static Int_t px1,py1,npe,r1;
165 static Int_t pxold, pyold;
169 static Bool_t pTop, pL, pR, pBot, pINSIDE;
170 static Int_t pTx,pTy,pLx,pLy,pRx,pRy,pBx,pBy;
182 if (dphi<0) dphi += 2 * pi;
185 for (i=0;i<=
np;i++) {
191 y[i] =
gPad->YtoAbsPixel(
fY1) + rpixY;
213 pTy =
gPad->YtoAbsPixel(
fY1) + r1;
214 pBy =
gPad->YtoAbsPixel(
fY1) - r1;
217 gVirtualX->DrawLine(pRx+4, py1+4, pRx-4, py1+4);
218 gVirtualX->DrawLine(pRx-4, py1+4, pRx-4, py1-4);
219 gVirtualX->DrawLine(pRx-4, py1-4, pRx+4, py1-4);
220 gVirtualX->DrawLine(pRx+4, py1-4, pRx+4, py1+4);
221 gVirtualX->DrawLine(pLx+4, py1+4, pLx-4, py1+4);
222 gVirtualX->DrawLine(pLx-4, py1+4, pLx-4, py1-4);
223 gVirtualX->DrawLine(pLx-4, py1-4, pLx+4, py1-4);
224 gVirtualX->DrawLine(pLx+4, py1-4, pLx+4, py1+4);
225 gVirtualX->DrawLine(px1+4, pBy+4, px1-4, pBy+4);
226 gVirtualX->DrawLine(px1-4, pBy+4, px1-4, pBy-4);
227 gVirtualX->DrawLine(px1-4, pBy-4, px1+4, pBy-4);
228 gVirtualX->DrawLine(px1+4, pBy-4, px1+4, pBy+4);
229 gVirtualX->DrawLine(px1+4, pTy+4, px1-4, pTy+4);
230 gVirtualX->DrawLine(px1-4, pTy+4, px1-4, pTy-4);
231 gVirtualX->DrawLine(px1-4, pTy-4, px1+4, pTy-4);
232 gVirtualX->DrawLine(px1+4, pTy-4, px1+4, pTy+4);
247 pTop = pL = pR = pBot = pINSIDE =
kFALSE;
272 pxold = px; pyold = py;
279 gVirtualX->DrawLine(pRx+4, py1+4, pRx-4, py1+4);
280 gVirtualX->DrawLine(pRx-4, py1+4, pRx-4, py1-4);
281 gVirtualX->DrawLine(pRx-4, py1-4, pRx+4, py1-4);
282 gVirtualX->DrawLine(pRx+4, py1-4, pRx+4, py1+4);
283 gVirtualX->DrawLine(pLx+4, py1+4, pLx-4, py1+4);
284 gVirtualX->DrawLine(pLx-4, py1+4, pLx-4, py1-4);
285 gVirtualX->DrawLine(pLx-4, py1-4, pLx+4, py1-4);
286 gVirtualX->DrawLine(pLx+4, py1-4, pLx+4, py1+4);
287 gVirtualX->DrawLine(px1+4, pBy+4, px1-4, pBy+4);
288 gVirtualX->DrawLine(px1-4, pBy+4, px1-4, pBy-4);
289 gVirtualX->DrawLine(px1-4, pBy-4, px1+4, pBy-4);
290 gVirtualX->DrawLine(px1+4, pBy-4, px1+4, pBy+4);
291 gVirtualX->DrawLine(px1+4, pTy+4, px1-4, pTy+4);
292 gVirtualX->DrawLine(px1-4, pTy+4, px1-4, pTy-4);
293 gVirtualX->DrawLine(px1-4, pTy-4, px1+4, pTy-4);
294 gVirtualX->DrawLine(px1+4, pTy-4, px1+4, pTy+4);
295 for (i=0;i<npe;i++)
gVirtualX->DrawLine(
x[i],
y[i],
x[i+1],
y[i+1]);
309 if (pTop || pBot || pL || pR) {
314 if (dphi<0) dphi += 2 * pi;
320 for (i=0;i<=
np;i++) {
338 for (i=0;i<npe;i++) {
345 if (pTop)
gPad->ShowGuidelines(
this, event,
't',
true);
346 if (pBot)
gPad->ShowGuidelines(
this, event,
'b',
true);
347 if (pL)
gPad->ShowGuidelines(
this, event,
'l',
true);
348 if (pR)
gPad->ShowGuidelines(
this, event,
'r',
true);
354 dpx = px-pxold; dpy = py-pyold;
355 px1 += dpx; py1 += dpy;
357 for (i=0;i<=npe;i++) {
x[i] += dpx;
y[i] += dpy;}
358 for (i=0;i<npe;i++)
gVirtualX->DrawLine(
x[i],
y[i],
x[i+1],
y[i+1]);
361 gPad->ShowGuidelines(
this, event,
'i',
true);
373 gVirtualX->DrawLine(pRx+4, py1+4, pRx-4, py1+4);
374 gVirtualX->DrawLine(pRx-4, py1+4, pRx-4, py1-4);
375 gVirtualX->DrawLine(pRx-4, py1-4, pRx+4, py1-4);
376 gVirtualX->DrawLine(pRx+4, py1-4, pRx+4, py1+4);
377 gVirtualX->DrawLine(pLx+4, py1+4, pLx-4, py1+4);
378 gVirtualX->DrawLine(pLx-4, py1+4, pLx-4, py1-4);
379 gVirtualX->DrawLine(pLx-4, py1-4, pLx+4, py1-4);
380 gVirtualX->DrawLine(pLx+4, py1-4, pLx+4, py1+4);
381 gVirtualX->DrawLine(px1+4, pBy+4, px1-4, pBy+4);
382 gVirtualX->DrawLine(px1-4, pBy+4, px1-4, pBy-4);
383 gVirtualX->DrawLine(px1-4, pBy-4, px1+4, pBy-4);
384 gVirtualX->DrawLine(px1+4, pBy-4, px1+4, pBy+4);
385 gVirtualX->DrawLine(px1+4, pTy+4, px1-4, pTy+4);
386 gVirtualX->DrawLine(px1-4, pTy+4, px1-4, pTy-4);
387 gVirtualX->DrawLine(px1-4, pTy-4, px1+4, pTy-4);
388 gVirtualX->DrawLine(px1+4, pTy-4, px1+4, pTy+4);
396 gPad->ShowGuidelines(
this, event);
400 rLx =
gPad->AbsPixeltoX(px1+r1);
401 rRx =
gPad->AbsPixeltoX(px1-r1);
406 if (!opaque)
gVirtualX->SetLineColor(-1);
420 out<<
"curlyarc = new TCurlyArc("
424 out<<
" curlyarc->SetWavy();"<<std::endl;
427 out<<
" curlyarc->Draw();"<<std::endl;
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint angle
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char y1
virtual void Modify()
Change current line attributes if necessary.
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
Implements curly or wavy arcs used to draw Feynman diagrams.
Rectangle_t GetBBox() override
Return the bounding Box of the Line.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to an arc.
void SetBBoxX1(const Int_t x) override
Set left hand side of BoundingBox to a value (resize in x direction on left)
virtual void SetRadius(Double_t radius)
Set Curly Arc radius.
static Bool_t GetDefaultIsCurly()
Get default "IsCurly".
void Build() override
Create a curly (Gluon) or wavy (Gamma) arc.
virtual void SetPhimin(Double_t phimin)
Set Curly Arc minimum Phi.
Double_t fTheta
used internally
static Double_t GetDefaultWaveLength()
Get default wave length.
virtual void SetCenter(Double_t x1, Double_t y1)
Set Curly Arc center.
Double_t fPhimax
end phi (degrees)
void SetBBoxY2(const Int_t y) override
Set bottom of BoundingBox to a value (resize in y direction on bottom)
void SetBBoxX2(const Int_t x) override
Set right hand side of BoundingBox to a value (resize in x direction on right)
TCurlyArc()
Default constructor.
static Double_t fgDefaultWaveLength
default wavelength
static void SetDefaultWaveLength(Double_t WaveLength)
Set default wave length.
static void SetDefaultAmplitude(Double_t Amplitude)
Set default wave amplitude.
Double_t fPhimin
start phi (degrees)
Double_t fR1
Radius of arc.
static Double_t fgDefaultAmplitude
default amplitude
static Double_t GetDefaultAmplitude()
Get default wave amplitude.
static void SetDefaultIsCurly(Bool_t IsCurly)
Set default "IsCurly".
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
TPoint GetBBoxCenter() override
Return the center of the BoundingBox as TPoint in pixels.
static Bool_t fgDefaultIsCurly
default curly type
void SavePrimitive(std::ostream &out, Option_t *="") override
Save primitive as a C++ statement(s) on output stream out.
void SetBBoxCenter(const TPoint &p) override
Set center of the BoundingBox.
void SetBBoxCenterY(const Int_t y) override
Set Y coordinate of the center of the BoundingBox.
void SetBBoxY1(const Int_t y) override
Set top of BoundingBox to a value (resize in y direction on top)
virtual void SetPhimax(Double_t phimax)
Set Curly Arc maximum Phi.
void SetBBoxCenterX(const Int_t x) override
Set X coordinate of the center of the BoundingBox.
Double_t fY1
start y, center for arc
Double_t fWaveLength
wavelength of sinusoid in percent of pad height
Double_t fAmplitude
amplitude of sinusoid in percent of pad height
virtual void SetStartPoint(Double_t x1, Double_t y1)
Set start point.
Int_t fNsteps
used internally (controls precision)
virtual void Build()
Create a curly (Gluon) or wavy (Gamma) line.
Double_t fX1
start x, center for arc
Bool_t fIsCurly
true: Gluon, false: Gamma
Double_t ATan2(Double_t y, Double_t x)
Returns the principal value of the arc tangent of y/x, expressed in radians.
Double_t Sqrt(Double_t x)
Returns the square root of x.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
#define R2(v, w, x, y, z, i)
Rectangle structure (maps to the X11 XRectangle structure)