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);
135 if (phi < fPhimin || phi >
fPhimax)
return 9999;
163 static Int_t px1,py1,npe,r1;
164 static Int_t pxold, pyold;
168 static Bool_t pTop, pL, pR, pBot, pINSIDE;
169 static Int_t pTx,pTy,pLx,pLy,pRx,pRy,pBx,pBy;
181 if (dphi<0) dphi += 2 * pi;
184 for (i=0;i<=np;i++) {
190 y[i] =
gPad->YtoAbsPixel(
fY1) + rpixY;
212 pTy =
gPad->YtoAbsPixel(
fY1) + r1;
213 pBy =
gPad->YtoAbsPixel(
fY1) - r1;
216 gVirtualX->DrawLine(pRx+4, py1+4, pRx-4, py1+4);
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(pLx+4, py1+4, pLx-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(px1+4, pBy+4, px1-4, pBy+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, pTy+4, px1-4, pTy+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);
246 pTop = pL = pR = pBot = pINSIDE =
kFALSE;
271 pxold = px; pyold = py;
278 gVirtualX->DrawLine(pRx+4, py1+4, pRx-4, py1+4);
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(pLx+4, py1+4, pLx-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(px1+4, pBy+4, px1-4, pBy+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, pTy+4, px1-4, pTy+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 for (i=0;i<npe;i++)
gVirtualX->DrawLine(
x[i],
y[i],
x[i+1],
y[i+1]);
308 if (pTop || pBot || pL || pR) {
313 if (dphi<0) dphi += 2 * pi;
319 for (i=0;i<=np;i++) {
337 for (i=0;i<npe;i++) {
344 if (pTop)
gPad->ShowGuidelines(
this, event,
't',
true);
345 if (pBot)
gPad->ShowGuidelines(
this, event,
'b',
true);
346 if (pL)
gPad->ShowGuidelines(
this, event,
'l',
true);
347 if (pR)
gPad->ShowGuidelines(
this, event,
'r',
true);
353 dpx = px-pxold; dpy = py-pyold;
354 px1 += dpx; py1 += dpy;
356 for (i=0;i<=npe;i++) {
x[i] += dpx;
y[i] += dpy;}
357 for (i=0;i<npe;i++)
gVirtualX->DrawLine(
x[i],
y[i],
x[i+1],
y[i+1]);
360 gPad->ShowGuidelines(
this, event,
'i',
true);
372 gVirtualX->DrawLine(pRx+4, py1+4, pRx-4, py1+4);
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(pLx+4, py1+4, pLx-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(px1+4, pBy+4, px1-4, pBy+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, pTy+4, px1-4, pTy+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);
395 gPad->ShowGuidelines(
this, event);
399 rLx =
gPad->AbsPixeltoX(px1+r1);
400 rRx =
gPad->AbsPixeltoX(px1-r1);
405 if (!opaque)
gVirtualX->SetLineColor(-1);
414 if (
gROOT->ClassSaved(TCurlyArc::Class())) {
419 out<<
"curlyarc = new TCurlyArc("
423 out<<
" curlyarc->SetWavy();"<<std::endl;
426 out<<
" curlyarc->Draw();"<<std::endl;
602 if (y1<
fY1-
R2)
return;
618 if (y2>
fY1+
R2)
return;
static const double x2[5]
static const double x1[5]
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.
virtual void SetBBoxX2(const Int_t x)
Set right hand side of BoundingBox to a value (resize in x direction on right)
virtual TPoint GetBBoxCenter()
Return the center of the BoundingBox as TPoint in pixels.
virtual void Build()
Create a curly (Gluon) or wavy (Gamma) arc.
virtual void SetRadius(Double_t radius)
Set Curly Arc radius.
static Bool_t GetDefaultIsCurly()
Get default "IsCurly".
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save primitive as a C++ statement(s) on output stream out.
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 SetBBoxY2(const Int_t y)
Set bottom of BoundingBox to a value (resize in y direction on bottom)
virtual void SetCenter(Double_t x1, Double_t y1)
Set Curly Arc center.
Double_t fPhimax
end phi (degrees)
void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
TCurlyArc()
Default constructor.
Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to an arc.
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.
virtual void SetBBoxY1(const Int_t y)
Set top of BoundingBox to a value (resize in y direction on top)
static Double_t fgDefaultAmplitude
default amplitude
virtual void SetBBoxCenter(const TPoint &p)
Set center of the BoundingBox.
static Double_t GetDefaultAmplitude()
Get default wave amplitude.
static void SetDefaultIsCurly(Bool_t IsCurly)
Set default "IsCurly".
virtual void SetBBoxCenterY(const Int_t y)
Set Y coordinate of the center of the BoundingBox.
static Bool_t fgDefaultIsCurly
default curly type
virtual Rectangle_t GetBBox()
Return the bounding Box of the Line.
virtual void SetBBoxCenterX(const Int_t x)
Set X coordinate of the center of the BoundingBox.
virtual void SetBBoxX1(const Int_t x)
Set left hand side of BoundingBox to a value (resize in x direction on left)
virtual void SetPhimax(Double_t phimax)
Set Curly Arc maximum Phi.
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)
Double_t Sqrt(Double_t x)
#define R2(v, w, x, y, z, i)
Rectangle structure (maps to the X11 XRectangle structure)