Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TEllipse.h
Go to the documentation of this file.
1// @(#)root/graf:$Id$
2// Author: Rene Brun 16/10/95
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, 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#ifndef ROOT_TEllipse
13#define ROOT_TEllipse
14
15
16#include "TObject.h"
17#include "TAttLine.h"
18#include "TAttFill.h"
19#include "TAttBBox2D.h"
20
21class TPoint;
22
23class TEllipse : public TObject, public TAttLine, public TAttFill, public TAttBBox2D {
24
25protected:
26 Double_t fX1; ///< X coordinate of centre
27 Double_t fY1; ///< Y coordinate of centre
28 Double_t fR1; ///< first radius
29 Double_t fR2; ///< second radius
30 Double_t fPhimin; ///< Minimum angle (degrees)
31 Double_t fPhimax; ///< Maximum angle (degrees)
32 Double_t fTheta; ///< Rotation angle (degrees)
33
34public:
35 // TEllipse status bits
36 enum {
37 kNoEdges = BIT(9) // don't draw lines connecting center to edges
38 };
40 TEllipse(Double_t x1, Double_t y1,Double_t r1,Double_t r2=0,Double_t phimin=0, Double_t phimax=360,Double_t theta=0);
41 TEllipse(const TEllipse &ellipse);
42 ~TEllipse() override;
43 void Copy(TObject &ellipse) const override;
45 void Draw(Option_t *option="") override;
46 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="");
47 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
49 Double_t GetX1() const {return fX1;}
50 Double_t GetY1() const {return fY1;}
51 Double_t GetR1() const {return fR1;}
52 Double_t GetR2() const {return fR2;}
53 Double_t GetPhimin() const {return fPhimin;}
54 Double_t GetPhimax() const {return fPhimax;}
55 Double_t GetTheta() const {return fTheta;}
57 void ls(Option_t *option="") const override;
58 void Paint(Option_t *option="") override;
59 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="");
60 void Print(Option_t *option="") const override;
61 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
62 virtual void SetNoEdges(Bool_t noEdges=kTRUE); // *TOGGLE* *GETTER=GetNoEdges
63 virtual void SetPhimin(Double_t phi=0) {fPhimin=phi;} // *MENU*
64 virtual void SetPhimax(Double_t phi=360) {fPhimax=phi;} // *MENU*
65 virtual void SetR1(Double_t r1) {fR1=r1;} // *MENU*
66 virtual void SetR2(Double_t r2) {fR2=r2;} // *MENU*
67 virtual void SetTheta(Double_t theta=0) {fTheta=theta;} // *MENU*
68 virtual void SetX1(Double_t x1) {fX1=x1;} // *MENU*
69 virtual void SetY1(Double_t y1) {fY1=y1;} // *MENU*
70 Rectangle_t GetBBox() override;
72 void SetBBoxCenter(const TPoint &p) override;
73 void SetBBoxCenterX(const Int_t x) override;
74 void SetBBoxCenterY(const Int_t y) override;
75 void SetBBoxX1(const Int_t x) override;
76 void SetBBoxX2(const Int_t x) override;
77 void SetBBoxY1(const Int_t y) override;
78 void SetBBoxY2(const Int_t y) override;
79
80 ClassDefOverride(TEllipse,3) //An ellipse
81};
82
83#endif
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
bool Bool_t
Boolean (0=false, 1=true) (bool).
Definition RtypesCore.h:77
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char).
Definition RtypesCore.h:80
#define BIT(n)
Definition Rtypes.h:91
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
Abstract base class for elements drawn in the editor.
Definition TAttBBox2D.h:19
virtual void SetR1(Double_t r1)
Definition TEllipse.h:65
void ls(Option_t *option="") const override
The ls function lists the contents of a class on stdout.
virtual void SetX1(Double_t x1)
Definition TEllipse.h:68
void SetBBoxCenterY(const Int_t y) override
Double_t GetTheta() const
Definition TEllipse.h:55
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to an event at (px,py).
void SetBBoxY1(const Int_t y) override
void SetBBoxX1(const Int_t x) override
Double_t GetPhimax() const
Definition TEllipse.h:54
void SetBBoxY2(const Int_t y) override
Double_t GetX1() const
Definition TEllipse.h:49
Double_t fPhimax
Maximum angle (degrees).
Definition TEllipse.h:31
Double_t GetPhimin() const
Definition TEllipse.h:53
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Computes distance from point (px,py) to the object.
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="")
virtual void SetPhimax(Double_t phi=360)
Definition TEllipse.h:64
TEllipse(const TEllipse &ellipse)
Double_t fX1
X coordinate of centre.
Definition TEllipse.h:26
void SetBBoxX2(const Int_t x) override
Bool_t GetNoEdges() const
void Draw(Option_t *option="") override
Default Draw method for all objects.
Rectangle_t GetBBox() override
void Paint(Option_t *option="") override
This method must be overridden if a class wants to paint itself.
Double_t fY1
Y coordinate of centre.
Definition TEllipse.h:27
Double_t fTheta
Rotation angle (degrees).
Definition TEllipse.h:32
virtual void SetPhimin(Double_t phi=0)
Definition TEllipse.h:63
void SetBBoxCenter(const TPoint &p) override
Int_t IsInside(Double_t x, Double_t y) const
void SetBBoxCenterX(const Int_t x) override
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="")
virtual void SetY1(Double_t y1)
Definition TEllipse.h:69
~TEllipse() override
@ kNoEdges
Definition TEllipse.h:37
Double_t fR2
second radius
Definition TEllipse.h:29
Double_t GetR2() const
Definition TEllipse.h:52
void Copy(TObject &ellipse) const override
Copy this to obj.
Double_t GetR1() const
Definition TEllipse.h:51
Double_t fPhimin
Minimum angle (degrees).
Definition TEllipse.h:30
virtual void SetNoEdges(Bool_t noEdges=kTRUE)
TEllipse(Double_t x1, Double_t y1, Double_t r1, Double_t r2=0, Double_t phimin=0, Double_t phimax=360, Double_t theta=0)
Double_t GetY1() const
Definition TEllipse.h:50
TPoint GetBBoxCenter() override
Double_t fR1
first radius
Definition TEllipse.h:28
virtual void SetR2(Double_t r2)
Definition TEllipse.h:66
void Print(Option_t *option="") const override
This method must be overridden when a class wants to print itself.
virtual void SetTheta(Double_t theta=0)
Definition TEllipse.h:67
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
TObject()
TObject constructor.
Definition TObject.h:259
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Rectangle structure (maps to the X11 XRectangle structure).
Definition GuiTypes.h:362