105 ellipse.TEllipse::Copy(*
this);
136 if (!
gPad)
return 9999;
152 if (dx == 0 || r1 == 0 || r2 == 0)
return 9999;
160 if (distr > distp) dist = 0;
162 if (
TMath::Abs(distr-distp)/(r1+r2) < 0.01) dist = 0;
194 e->GetY1() +
e->GetR2())
202 std::vector<Double_t>
x,
y;
208 if(!fullcircle ||
e->GetTheta())
240 auto &parent = *
gPad;
253 if (!inter) inter = &dummy;
256 if (!inter->SelectDiamondCorner(px, py,
kFALSE)) {
257 parent.FreeInteractive(
this);
269 if (!inter->ProcessMouseMove(parent, px, py))
272 inter->ApplyChanges(parent);
274 if (inter->IsOpaque(parent)) {
276 parent.ShowGuidelines(
this,
event, inter->GetGuideChar(),
true);
277 parent.Modified(
kTRUE);
283 if (inter && inter->IsOpaque(parent))
284 parent.ShowGuidelines(
this,
event);
286 if (
gROOT->IsEscaped()) {
288 if (inter && inter->IsOpaque(parent)) {
289 inter->Apply(
this,
kFALSE);
291 }
else if (inter && !inter->IsOpaque(parent)) {
296 parent.FreeInteractive(
this);
319 if (xn * xn + yn * yn > 1.)
326 if (phi < phimin || phi > phimax)
365 Bool_t full_circle = phi2-phi1 >= 360;
368 x.resize(
n + (full_circle ? 1 : 3));
369 y.resize(
n + (full_circle ? 1 : 3));
374 for (
Int_t i = 0; i <=
n; i++) {
401 std::vector<Double_t>
x,
y;
408 gPad->PaintFillArea(
x.size() - 1,
x.data(),
y.data());
414 gPad->PaintPolyLine(
x.size() - (less_points ? 2 : 0),
x.data(),
y.data());
423 printf(
"Ellipse: X1=%f Y1=%f R1=%f R2=%f",
fX1,
fY1,
fR1,
fR2);
436 out,
Class(),
"ellipse",
437 TString::Format(
"%g, %g, %g, %g, %g, %g, %g",
fX1,
fY1,
fR1,
fR2,
fPhimin,
fPhimax,
fTheta));
443 out <<
" ellipse->SetNoEdges();\n";
486 R__b >> r1;
fR1 = r1;
487 R__b >> r2;
fR2 = r2;
488 R__b >> phimin;
fPhimin = phimin;
489 R__b >> phimax;
fPhimax = phimax;
490 R__b >> theta;
fTheta = theta;
int Int_t
Signed integer 4 bytes (int)
short Version_t
Class version identifier (short)
float Float_t
Float 4 bytes (float)
double Double_t
Double 8 bytes.
const char Option_t
Option string (const char)
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 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
Abstract base class for elements drawn in the editor.
Double_t GetYCoord(const Int_t y, Bool_t is_ndc=kFALSE, Bool_t is_absolute=kFALSE)
Can return ndc or normal values Also one can specify to use absolute coordinates for input parameter ...
Double_t GetXCoord(const Int_t x, Bool_t is_ndc=kFALSE, Bool_t is_absolute=kFALSE)
Return user X coordinate for pixel X value Can return ndc or normal values Also one can specify to us...
Fill Area Attributes class.
virtual void Streamer(TBuffer &)
virtual Color_t GetFillColor() const
Return the fill area color.
void Copy(TAttFill &attfill) const
Copy this fill attributes to a new TAttFill.
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual void ModifyOn(TVirtualPad &pad)
Change current fill area attributes on speicifed pad.
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
Save fill attributes as C++ statement(s) on output stream out.
virtual void Streamer(TBuffer &)
virtual Color_t GetLineColor() const
Return the line color.
virtual Width_t GetLineWidth() const
Return the line width.
virtual void ModifyOn(TVirtualPad &pad)
Change current line attributes on specified pad.
virtual Style_t GetLineStyle() const
Return the line style.
void Copy(TAttLine &attline) const
Copy this line attributes to a new TAttLine.
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.
void CalcPixelCoord(const TVirtualPad &parent, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Calculate pixel coordinates.
void PaintDiamondCorners(TVirtualPad &parent, const char *id="idiamond")
Paint diamond corners outline.
Buffer base class used for serializing objects.
virtual Version_t ReadVersion(UInt_t *start=nullptr, UInt_t *bcnt=nullptr, const TClass *cl=nullptr)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
void PaintOutline(TVirtualPad &parent) override
Paint object outline.
TEllipseInteractive(TEllipse *e)
void Apply(TEllipse *e, Bool_t usenew=kTRUE)
TClass * IsA() const override
virtual void SetR1(Double_t r1)
void ls(Option_t *option="") const override
List this ellipse with its attributes.
virtual void SetX1(Double_t x1)
virtual void PaintEllipse(Double_t x1, Double_t y1, Double_t r1, Double_t r2, Double_t phimin, Double_t phimax, Double_t theta, Option_t *option="")
Draw this ellipse with new coordinates.
void SetBBoxCenterY(const Int_t y) override
Set Y coordinate of the center of the Ellipse.
Double_t GetTheta() const
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
void SetBBoxY1(const Int_t y) override
Set top of BoundingBox to a value (resize in y direction on top)
void SetBBoxX1(const Int_t x) override
Set left hand side of BoundingBox to a value (resize in x direction on left)
void SetBBoxY2(const Int_t y) override
Set bottom of BoundingBox to a value (resize in y direction on bottom)
Double_t fPhimax
Maximum angle (degrees)
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to an ellipse.
Double_t fX1
X coordinate of centre.
void SetBBoxX2(const Int_t x) override
Set right hand side of BoundingBox to a value (resize in x direction on right)
Bool_t GetNoEdges() const
Return kTRUE if kNoEdges bit is set, kFALSE otherwise.
void Draw(Option_t *option="") override
Draw this ellipse with its current attributes.
Rectangle_t GetBBox() override
Return the bounding Box of the Ellipse, currently not taking into account the rotating angle.
void Paint(Option_t *option="") override
Paint this ellipse with its current attributes.
Double_t fY1
Y coordinate of centre.
Double_t fTheta
Rotation angle (degrees)
Int_t IsInside(Double_t x, Double_t y) const
Return 1 if the point (x,y) is inside the polygon defined by the ellipse 0 otherwise.
void SetBBoxCenterX(const Int_t x) override
Set X coordinate of the center of the Ellipse.
Bool_t FillPoints(TVirtualPad &pad, std::vector< Double_t > &x, std::vector< Double_t > &y, Double_t x1, Double_t y1, Double_t r1, Double_t r2, Double_t phimin, Double_t phimax, Double_t theta)
Fill points which can be used for the painting Return true if full 360 ellipse is created.
virtual void SetY1(Double_t y1)
~TEllipse() override
Ellipse default destructor.
Double_t fR2
second radius
void Streamer(TBuffer &) override
Stream an object of class TEllipse.
virtual void SetNoEdges(Bool_t noEdges=kTRUE)
if noEdges = kTRUE the lines connecting the center to the edges will not be drawn.
void Copy(TObject &ellipse) const override
Copy this ellipse to ellipse.
Double_t fPhimin
Minimum angle (degrees)
TPoint GetBBoxCenter() override
Return the center of the Ellipse as TPoint in pixels.
TEllipse()
Ellipse default constructor.
virtual TEllipse * DrawEllipse(Double_t x1, Double_t y1, Double_t r1, Double_t r2, Double_t phimin, Double_t phimax, Double_t theta, Option_t *option="")
Draw this ellipse with new coordinates.
virtual void SetR2(Double_t r2)
void Print(Option_t *option="") const override
Dump this ellipse with its attributes.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void Streamer(TBuffer &)
Stream an object of class TObject.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Copy(TObject &object) const
Copy this to obj.
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".
@ kCanDelete
if object in a list can be deleted
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
void ToLower()
Change string to lower-case.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TObject * GetObject() const
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual Double_t GetX2() const =0
virtual Double_t GetY1() const =0
virtual Double_t YtoPad(Double_t y) const =0
virtual void PaintPolyLine(Int_t n, Float_t *x, Float_t *y, Option_t *option="")=0
virtual Double_t XtoPad(Double_t x) const =0
virtual Double_t GetY2() const =0
virtual Double_t GetTheta() const =0
virtual Double_t GetX1() const =0
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.
constexpr Double_t DegToRad()
Conversion from degree to radian: .
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.
constexpr Double_t RadToDeg()
Conversion from radian to degree: .
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Rectangle structure (maps to the X11 XRectangle structure)