Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 #include "TPoint.h"
21 #include "GuiTypes.h"
22 
23 
24 class TEllipse : public TObject, public TAttLine, public TAttFill, public TAttBBox2D {
25 
26 protected:
27  Double_t fX1; ///< X coordinate of centre
28  Double_t fY1; ///< Y coordinate of centre
29  Double_t fR1; ///< first radius
30  Double_t fR2; ///< second radius
31  Double_t fPhimin; ///< Minimum angle (degrees)
32  Double_t fPhimax; ///< Maximum angle (degrees)
33  Double_t fTheta; ///< Rotation angle (degrees)
34 
35 public:
36  // TEllipse status bits
37  enum {
38  kNoEdges = BIT(9) // don't draw lines connecting center to edges
39  };
40  TEllipse();
41  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);
42  TEllipse(const TEllipse &ellipse);
43  virtual ~TEllipse();
44  void Copy(TObject &ellipse) const;
45  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
46  virtual void Draw(Option_t *option="");
47  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="");
48  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
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;}
56  Bool_t GetNoEdges() const;
57  virtual void ls(Option_t *option="") const;
58  virtual void Paint(Option_t *option="");
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  virtual void Print(Option_t *option="") const;
61  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
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  virtual Rectangle_t GetBBox();
71  virtual TPoint GetBBoxCenter();
72  virtual void SetBBoxCenter(const TPoint &p);
73  virtual void SetBBoxCenterX(const Int_t x);
74  virtual void SetBBoxCenterY(const Int_t y);
75  virtual void SetBBoxX1(const Int_t x);
76  virtual void SetBBoxX2(const Int_t x);
77  virtual void SetBBoxY1(const Int_t y);
78  virtual void SetBBoxY2(const Int_t y);
79 
80 
81  ClassDef(TEllipse,3) //An ellipse
82 };
83 
84 #endif