Logo ROOT  
Reference Guide
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 
21 class TPoint;
22 
23 class TEllipse : public TObject, public TAttLine, public TAttFill, public TAttBBox2D {
24 
25 protected:
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 
34 public:
35  // TEllipse status bits
36  enum {
37  kNoEdges = BIT(9) // don't draw lines connecting center to edges
38  };
39  TEllipse();
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  virtual ~TEllipse();
43  void Copy(TObject &ellipse) const;
44  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
45  virtual void Draw(Option_t *option="");
46  virtual void 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  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
48  Double_t GetX1() const {return fX1;}
49  Double_t GetY1() const {return fY1;}
50  Double_t GetR1() const {return fR1;}
51  Double_t GetR2() const {return fR2;}
52  Double_t GetPhimin() const {return fPhimin;}
53  Double_t GetPhimax() const {return fPhimax;}
54  Double_t GetTheta() const {return fTheta;}
55  Bool_t GetNoEdges() const;
56  virtual void ls(Option_t *option="") const;
57  virtual void Paint(Option_t *option="");
58  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="");
59  virtual void Print(Option_t *option="") const;
60  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
61  virtual void SetNoEdges(Bool_t noEdges=kTRUE); // *TOGGLE* *GETTER=GetNoEdges
62  virtual void SetPhimin(Double_t phi=0) {fPhimin=phi;} // *MENU*
63  virtual void SetPhimax(Double_t phi=360) {fPhimax=phi;} // *MENU*
64  virtual void SetR1(Double_t r1) {fR1=r1;} // *MENU*
65  virtual void SetR2(Double_t r2) {fR2=r2;} // *MENU*
66  virtual void SetTheta(Double_t theta=0) {fTheta=theta;} // *MENU*
67  virtual void SetX1(Double_t x1) {fX1=x1;} // *MENU*
68  virtual void SetY1(Double_t y1) {fY1=y1;} // *MENU*
69  virtual Rectangle_t GetBBox();
70  virtual TPoint GetBBoxCenter();
71  virtual void SetBBoxCenter(const TPoint &p);
72  virtual void SetBBoxCenterX(const Int_t x);
73  virtual void SetBBoxCenterY(const Int_t y);
74  virtual void SetBBoxX1(const Int_t x);
75  virtual void SetBBoxX2(const Int_t x);
76  virtual void SetBBoxY1(const Int_t y);
77  virtual void SetBBoxY2(const Int_t y);
78 
79 
80  ClassDef(TEllipse,3) //An ellipse
81 };
82 
83 #endif
TAttBBox2D.h
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TEllipse::SetPhimax
virtual void SetPhimax(Double_t phi=360)
Definition: TEllipse.h:63
TEllipse::SetBBoxY1
virtual void SetBBoxY1(const Int_t y)
Set top of BoundingBox to a value (resize in y direction on top)
Definition: TEllipse.cxx:738
TEllipse::GetPhimax
Double_t GetPhimax() const
Definition: TEllipse.h:53
TEllipse::SetNoEdges
virtual void SetNoEdges(Bool_t noEdges=kTRUE)
if noEdges = kTRUE the lines connecting the center to the edges will not be drawn.
Definition: TEllipse.cxx:621
Rectangle_t
Definition: GuiTypes.h:360
TEllipse::GetBBoxCenter
virtual TPoint GetBBoxCenter()
Return the center of the Ellipse as TPoint in pixels.
Definition: TEllipse.cxx:676
TEllipse::GetPhimin
Double_t GetPhimin() const
Definition: TEllipse.h:52
TEllipse::SetBBoxY2
virtual void SetBBoxY2(const Int_t y)
Set bottom of BoundingBox to a value (resize in y direction on bottom)
Definition: TEllipse.cxx:751
TEllipse
Definition: TEllipse.h:23
Int_t
int Int_t
Definition: RtypesCore.h:45
TEllipse::TEllipse
TEllipse()
Ellipse default constructor.
Definition: TEllipse.cxx:57
TEllipse::fR2
Double_t fR2
second radius
Definition: TEllipse.h:29
x
Double_t x[n]
Definition: legend1.C:17
TEllipse::SetBBoxCenter
virtual void SetBBoxCenter(const TPoint &p)
Set center of the Ellipse.
Definition: TEllipse.cxx:687
TEllipse::~TEllipse
virtual ~TEllipse()
Ellipse default destructor.
Definition: TEllipse.cxx:87
TEllipse::SetX1
virtual void SetX1(Double_t x1)
Definition: TEllipse.h:67
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TEllipse::DistancetoPrimitive
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to an ellipse.
Definition: TEllipse.cxx:133
TEllipse::SetR2
virtual void SetR2(Double_t r2)
Definition: TEllipse.h:65
TEllipse::SetTheta
virtual void SetTheta(Double_t theta=0)
Definition: TEllipse.h:66
x1
static const double x1[5]
Definition: RooGaussKronrodIntegrator1D.cxx:346
TEllipse::GetY1
Double_t GetY1() const
Definition: TEllipse.h:49
TAttBBox2D
Definition: TAttBBox2D.h:19
TEllipse::Draw
virtual void Draw(Option_t *option="")
Draw this ellipse with its current attributes.
Definition: TEllipse.cxx:168
TEllipse::DrawEllipse
virtual void 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.
Definition: TEllipse.cxx:176
TAttLine.h
TEllipse::GetR2
Double_t GetR2() const
Definition: TEllipse.h:51
TEllipse::GetBBox
virtual Rectangle_t GetBBox()
Return the bounding Box of the Ellipse, currently not taking into account the rotating angle.
Definition: TEllipse.cxx:663
TEllipse::fTheta
Double_t fTheta
Rotation angle (degrees)
Definition: TEllipse.h:32
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TEllipse::kNoEdges
@ kNoEdges
Definition: TEllipse.h:37
TAttFill.h
TEllipse::fY1
Double_t fY1
Y coordinate of centre.
Definition: TEllipse.h:27
TAttLine
Definition: TAttLine.h:18
TEllipse::SetBBoxCenterX
virtual void SetBBoxCenterX(const Int_t x)
Set X coordinate of the center of the Ellipse.
Definition: TEllipse.cxx:696
TEllipse::fPhimax
Double_t fPhimax
Maximum angle (degrees)
Definition: TEllipse.h:31
TEllipse::Copy
void Copy(TObject &ellipse) const
Copy this ellipse to ellipse.
Definition: TEllipse.cxx:110
TEllipse::Paint
virtual void Paint(Option_t *option="")
Paint this ellipse with its current attributes.
Definition: TEllipse.cxx:520
TEllipse::SetBBoxCenterY
virtual void SetBBoxCenterY(const Int_t y)
Set Y coordinate of the center of the Ellipse.
Definition: TEllipse.cxx:704
TEllipse::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TEllipse.cxx:589
BIT
#define BIT(n)
Definition: Rtypes.h:85
TEllipse::Print
virtual void Print(Option_t *option="") const
Dump this ellipse with its attributes.
Definition: TEllipse.cxx:577
y
Double_t y[n]
Definition: legend1.C:17
TEllipse::GetNoEdges
Bool_t GetNoEdges() const
Return kTRUE if kNoEdges bit is set, kFALSE otherwise.
Definition: TEllipse.cxx:611
TEllipse::fX1
Double_t fX1
X coordinate of centre.
Definition: TEllipse.h:26
TEllipse::ExecuteEvent
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TEllipse.cxx:199
TEllipse::fPhimin
Double_t fPhimin
Minimum angle (degrees)
Definition: TEllipse.h:30
TEllipse::fR1
Double_t fR1
first radius
Definition: TEllipse.h:28
TEllipse::PaintEllipse
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.
Definition: TEllipse.cxx:528
TPoint
Definition: TPoint.h:31
Double_t
double Double_t
Definition: RtypesCore.h:59
TEllipse::ls
virtual void ls(Option_t *option="") const
List this ellipse with its attributes.
Definition: TEllipse.cxx:511
TEllipse::GetTheta
Double_t GetTheta() const
Definition: TEllipse.h:54
TObject.h
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TEllipse::GetX1
Double_t GetX1() const
Definition: TEllipse.h:48
TEllipse::GetR1
Double_t GetR1() const
Definition: TEllipse.h:50
TEllipse::SetBBoxX2
virtual void SetBBoxX2(const Int_t x)
Set right hand side of BoundingBox to a value (resize in x direction on right)
Definition: TEllipse.cxx:726
TAttFill
Definition: TAttFill.h:19
TEllipse::SetBBoxX1
virtual void SetBBoxX1(const Int_t x)
Set left hand side of BoundingBox to a value (resize in x direction on left)
Definition: TEllipse.cxx:713
TEllipse::SetPhimin
virtual void SetPhimin(Double_t phi=0)
Definition: TEllipse.h:62
TEllipse::SetR1
virtual void SetR1(Double_t r1)
Definition: TEllipse.h:64
TEllipse::SetY1
virtual void SetY1(Double_t y1)
Definition: TEllipse.h:68