80 Double_t wavelengthPix,amplitudePix, lengthPix, hPix;
89 pixeltoX = xrange / pxrange;
90 pixeltoY = yrange/pyrange;
97 lengthPix =
TMath::Sqrt((px2-px1)*(px2-px1) + (py1-py2)*(py1-py2));
107 lengthPix =
TMath::Sqrt((px2-px1)*(px2-px1) + (py1-py2)*(py1-py2));
117 Double_t lengthcycle = 0.5 * len2pi + 2 * amplitudePix;
119 Int_t nperiods = (
Int_t)((lengthPix - lengthcycle) / len2pi);
120 Double_t restlength = 0.5 * (lengthPix - nperiods * len2pi - lengthcycle);
121 fNsteps = (
Int_t)(anglestep * nperiods + anglestep / 2 + 4);
126 xv[0] = 0; yv[0] = 0;
127 xv[1] = restlength; yv[1] = 0;
129 Double_t x0 = amplitudePix + restlength;
131 for(i = 2; i <
fNsteps-1; i++){
152 xx = xv[i] * cosang - yv[i] * sinang;
153 yy = xv[i] * sinang + yv[i] * cosang;
188 static Int_t d1,d2,px1,px2,py1,py2;
189 static Int_t pxold, pyold, px1old, py1old, px2old, py2old;
217 px1old = px1; py1old = py1;
224 px2old = px2; py2old = py2;
231 pxold = px; pyold = py;
241 gVirtualX->DrawLine(px1old, py1old, px2, py2);
250 gVirtualX->DrawLine(px1, py1, px2old, py2old);
258 if (!opaque)
gVirtualX->DrawLine(px1, py1, px2, py2);
261 if (!opaque)
gVirtualX->DrawLine(px1, py1, px2, py2);
275 gPad->ShowGuidelines(
this, event,
'2',
true);
277 gPad->ShowGuidelines(
this, event,
'3',
true);
281 gPad->ShowGuidelines(
this, event,
'1',
true);
283 gPad->ShowGuidelines(
this, event,
'4',
true);
290 gPad->ShowGuidelines(
this, event,
'4',
true);
292 gPad->ShowGuidelines(
this, event,
'1',
true);
296 gPad->ShowGuidelines(
this, event,
'3',
true);
298 gPad->ShowGuidelines(
this, event,
'2',
true);
302 gPad->ShowGuidelines(
this, event,
'i',
true);
312 gPad->ShowGuidelines(
this, event);
331 if (!opaque)
gVirtualX->SetLineColor(-1);
341 TString::Format(
"%g, %g, %g, %g, %g, %g",
fX1,
fY1,
fX2,
fY2,
fWaveLength,
fAmplitude));
346 out <<
" curlyline->SetWavy();\n";
460 Rectangle_t BBox{0,0,0,0};
510 x1 =
gPad->PixeltoX(p.
GetX())-0.5*w;
511 x2 =
gPad->PixeltoX(p.
GetX())+0.5*w;
513 x2 =
gPad->PixeltoX(p.
GetX())-0.5*w;
514 x1 =
gPad->PixeltoX(p.
GetX())+0.5*w;
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
const char Option_t
Option string (const char).
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Int_t DistancetoLine(Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
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
static void SetDefaultIsCurly(Bool_t IsCurly)
void SetBBoxY1(const Int_t y) override
void SetBBoxX2(const Int_t x) override
Int_t fNsteps
used internally (controls precision)
void SetBBoxCenter(const TPoint &p) override
void SetBBoxY2(const Int_t y) override
static Double_t GetDefaultWaveLength()
Rectangle_t GetBBox() override
TPoint GetBBoxCenter() override
static Bool_t GetDefaultIsCurly()
virtual void SetAmplitude(Double_t x)
static void SetDefaultWaveLength(Double_t WaveLength)
virtual void SetEndPoint(Double_t x2, Double_t y2)
void SavePrimitive(std::ostream &out, Option_t *="") override
Save a primitive as a C++ statement(s) on output stream "out".
static Bool_t fgDefaultIsCurly
default curly type
virtual void SetWaveLength(Double_t WaveLength)
static void SetDefaultAmplitude(Double_t Amplitude)
static Double_t GetDefaultAmplitude()
void SetBBoxX1(const Int_t x) override
Double_t fX1
start x, center for arc
static Double_t fgDefaultWaveLength
default wavelength
void SetBBoxCenterX(const Int_t x) override
static Double_t fgDefaultAmplitude
default amplitude
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Computes distance from point (px,py) to the object.
virtual void SetStartPoint(Double_t x1, Double_t y1)
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to an event at (px,py).
Bool_t fIsCurly
true: Gluon, false: Gamma
void SetBBoxCenterY(const Int_t y) override
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
static void SavePrimitiveDraw(std::ostream &out, const char *variable_name, Option_t *option=nullptr)
Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
static void SavePrimitiveConstructor(std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
Save object constructor in the output stream "out".
virtual void SetPolyLine(Int_t n)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
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.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
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.
Rectangle structure (maps to the X11 XRectangle structure).