Logo ROOT   6.08/07
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 #ifndef ROOT_TObject
17 #include "TObject.h"
18 #endif
19 #ifndef ROOT_TAttLine
20 #include "TAttLine.h"
21 #endif
22 #ifndef ROOT_TAttFill
23 #include "TAttFill.h"
24 #endif
25 #ifndef ROOT_TAttBBox2D
26 #include "TAttBBox2D.h"
27 #endif
28 #ifndef ROOT_TPoint
29 #include "TPoint.h"
30 #endif
31 #ifndef ROOT_GuiTypes
32 #include "GuiTypes.h"
33 #endif
34 
35 
36 class TEllipse : public TObject, public TAttLine, public TAttFill, public TAttBBox2D {
37 
38 protected:
39  Double_t fX1; ///< X coordinate of centre
40  Double_t fY1; ///< Y coordinate of centre
41  Double_t fR1; ///< first radius
42  Double_t fR2; ///< second radius
43  Double_t fPhimin; ///< Minimum angle (degrees)
44  Double_t fPhimax; ///< Maximum angle (degrees)
45  Double_t fTheta; ///< Rotation angle (degrees)
46 
47 public:
48  // TEllipse status bits
49  enum {
50  kNoEdges = BIT(9) // don't draw lines connecting center to edges
51  };
52  TEllipse();
53  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);
54  TEllipse(const TEllipse &ellipse);
55  virtual ~TEllipse();
56  void Copy(TObject &ellipse) const;
57  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
58  virtual void Draw(Option_t *option="");
59  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="");
60  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
61  Double_t GetX1() const {return fX1;}
62  Double_t GetY1() const {return fY1;}
63  Double_t GetR1() const {return fR1;}
64  Double_t GetR2() const {return fR2;}
65  Double_t GetPhimin() const {return fPhimin;}
66  Double_t GetPhimax() const {return fPhimax;}
67  Double_t GetTheta() const {return fTheta;}
68  Bool_t GetNoEdges() const;
69  virtual void ls(Option_t *option="") const;
70  virtual void Paint(Option_t *option="");
71  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="");
72  virtual void Print(Option_t *option="") const;
73  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
74  virtual void SetNoEdges(Bool_t noEdges=kTRUE); // *TOGGLE* *GETTER=GetNoEdges
75  virtual void SetPhimin(Double_t phi=0) {fPhimin=phi;} // *MENU*
76  virtual void SetPhimax(Double_t phi=360) {fPhimax=phi;} // *MENU*
77  virtual void SetR1(Double_t r1) {fR1=r1;} // *MENU*
78  virtual void SetR2(Double_t r2) {fR2=r2;} // *MENU*
79  virtual void SetTheta(Double_t theta=0) {fTheta=theta;} // *MENU*
80  virtual void SetX1(Double_t x1) {fX1=x1;} // *MENU*
81  virtual void SetY1(Double_t y1) {fY1=y1;} // *MENU*
82  virtual Rectangle_t GetBBox();
83  virtual TPoint GetBBoxCenter();
84  virtual void SetBBoxCenter(const TPoint &p);
85  virtual void SetBBoxCenterX(const Int_t x);
86  virtual void SetBBoxCenterY(const Int_t y);
87  virtual void SetBBoxX1(const Int_t x);
88  virtual void SetBBoxX2(const Int_t x);
89  virtual void SetBBoxY1(const Int_t y);
90  virtual void SetBBoxY2(const Int_t y);
91 
92 
93  ClassDef(TEllipse,3) //An ellipse
94 };
95 
96 #endif
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TEllipse.cxx:198
Double_t GetPhimax() const
Definition: TEllipse.h:66
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:527
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:175
Double_t GetTheta() const
Definition: TEllipse.h:67
Double_t fX1
X coordinate of centre.
Definition: TEllipse.h:39
const char Option_t
Definition: RtypesCore.h:62
Double_t fY1
Y coordinate of centre.
Definition: TEllipse.h:40
virtual void ls(Option_t *option="") const
List this ellipse with its attributes.
Definition: TEllipse.cxx:510
virtual void SetBBoxCenterX(const Int_t x)
Set X coordinate of the center of the Ellipse.
Definition: TEllipse.cxx:695
#define BIT(n)
Definition: Rtypes.h:120
Double_t GetY1() const
Definition: TEllipse.h:62
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TEllipse.cxx:588
TEllipse()
Ellipse default constructor.
Definition: TEllipse.cxx:56
virtual void SetTheta(Double_t theta=0)
Definition: TEllipse.h:79
Double_t GetR2() const
Definition: TEllipse.h:64
virtual void SetPhimax(Double_t phi=360)
Definition: TEllipse.h:76
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to an ellipse.
Definition: TEllipse.cxx:132
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:712
virtual void SetR1(Double_t r1)
Definition: TEllipse.h:77
virtual void Paint(Option_t *option="")
Paint this ellipse with its current attributes.
Definition: TEllipse.cxx:519
Fill Area Attributes class.
Definition: TAttFill.h:24
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual void SetBBoxY1(const Int_t y)
Set top of BoundingBox to a value (resize in y direction on top)
Definition: TEllipse.cxx:737
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:620
virtual void Draw(Option_t *option="")
Draw this ellipse with its current attributes.
Definition: TEllipse.cxx:167
Definition: TPoint.h:33
Double_t fTheta
Rotation angle (degrees)
Definition: TEllipse.h:45
Double_t fR1
first radius
Definition: TEllipse.h:41
Double_t fPhimax
Maximum angle (degrees)
Definition: TEllipse.h:44
virtual void SetY1(Double_t y1)
Definition: TEllipse.h:81
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:725
virtual void SetBBoxCenterY(const Int_t y)
Set Y coordinate of the center of the Ellipse.
Definition: TEllipse.cxx:703
virtual void Print(Option_t *option="") const
Dump this ellipse with its attributes.
Definition: TEllipse.cxx:576
virtual void SetX1(Double_t x1)
Definition: TEllipse.h:80
unsigned int r1[N_CITIES]
Definition: simanTSP.cxx:321
virtual void SetR2(Double_t r2)
Definition: TEllipse.h:78
Double_t fR2
second radius
Definition: TEllipse.h:42
virtual void SetPhimin(Double_t phi=0)
Definition: TEllipse.h:75
virtual ~TEllipse()
Ellipse default destructor.
Definition: TEllipse.cxx:86
static const double x1[5]
double Double_t
Definition: RtypesCore.h:55
virtual TPoint GetBBoxCenter()
Return the center of the Ellipse as TPoint in pixels.
Definition: TEllipse.cxx:675
virtual void SetBBoxCenter(const TPoint &p)
Set center of the Ellipse.
Definition: TEllipse.cxx:686
Double_t y[n]
Definition: legend1.C:17
Double_t GetX1() const
Definition: TEllipse.h:61
Draw Ellipses.
Definition: TEllipse.h:36
Mother of all ROOT objects.
Definition: TObject.h:37
void Copy(TObject &ellipse) const
Copy this ellipse to ellipse.
Definition: TEllipse.cxx:109
Abstract base class for elements drawn in the editor.
Definition: TAttBBox2D.h:23
virtual void SetBBoxY2(const Int_t y)
Set bottom of BoundingBox to a value (resize in y direction on bottom)
Definition: TEllipse.cxx:750
virtual Rectangle_t GetBBox()
Return the bounding Box of the Ellipse, currently not taking into account the rotating angle...
Definition: TEllipse.cxx:662
Bool_t GetNoEdges() const
Return kTRUE if kNoEdges bit is set, kFALSE otherwise.
Definition: TEllipse.cxx:610
Double_t GetPhimin() const
Definition: TEllipse.h:65
const Bool_t kTRUE
Definition: Rtypes.h:91
Double_t fPhimin
Minimum angle (degrees)
Definition: TEllipse.h:43
Line Attributes class.
Definition: TAttLine.h:24
unsigned int r2[N_CITIES]
Definition: simanTSP.cxx:322
Double_t GetR1() const
Definition: TEllipse.h:63