JG ROOT Tools libraries  version 5.0 - august 2014
RContourBaseEllipse.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file RContourBaseEllipse.hh
3  *
4  * Include file for class RContourBaseEllipse
5  */
6 //======================================================================
7 
8 #ifndef R_CONTOUR_BASE_ELLIPSE_HH
9 #define R_CONTOUR_BASE_ELLIPSE_HH
10 
11 #include "RContourBase2D.hh"
12 #include "RAffine2D.hh"
13 #include "RContour.hh"
14 
15 //======================================================================
16 /*! \class RContourBaseEllipse
17  *
18  * Class for ellipse contour parameters.
19  * An ellipse is defined here as a circle in a frame transformation.
20  * Then the condition for beeing inside is simply x*x + y*y <= 1 in the
21  * modified frame (see \ref groot_ellipse).
22  *
23  * Center and axis are defined with the RAffine2D transform base class.
24  */
25 
27 {
28  //------------------------------------------------------------
29  /*! \object_doc{RContourBaseEllipse} */
31  //------------------------------------------------------------
32 
33  protected:
34 
35  public:
36 
37  //------------------------------------------------------------
38  // Constructors / affectation / destructor
39 
40  // center (0,0) and radius 1
42 
43  // ellipse with center (0,0) and radii a and b along X and Y
44  RContourBaseEllipse ( const Double_t a,
45  const Double_t b );
46 
47  // ellipse with center 'ctr' and radii a and b along X and Y
48  RContourBaseEllipse ( const RPoint2D ctr,
49  const Double_t a,
50  const Double_t b );
51 
52  // ellipse with center (0,0) and radii a and b along rotated axis
53  RContourBaseEllipse ( const Double_t a,
54  const Double_t b,
55  const Double_t angle );
56 
57  // ellipse with center 'ctr' and radii a and b along rotated axis
58  RContourBaseEllipse ( const RPoint2D ctr,
59  const Double_t a,
60  const Double_t b,
61  const Double_t angle );
62 
63  // ellipse corresponding to a circle in the frame (ctr, xa, yb)
64  RContourBaseEllipse ( const RPoint2D ctr,
65  const RVector2D xa,
66  const RVector2D yb );
67 
68  // copy
70 
71  // affectation
73 
74  // destructor
75  virtual ~RContourBaseEllipse ( );
76 
77  //------------------------------------------------------------
78 
79  // contour comparison
80  virtual bool Compare ( const RContourBase * ct_ptr ) const;
81 
82  // creation of associated ROOT objects list
83  virtual TList * CreateObjectList ( ) const;
84 
85  //------------------------------------------------------------
86  // Read / write functions
87 
88  virtual bool WriteData ( ostream &os ) const;
89  virtual bool WriteData ( FILE *fptr ) const;
90 
91  static RContourBaseEllipse * ReadNew ( istream &is );
92  static RContourBaseEllipse * ReadNew ( FILE *fptr );
93 
94  //------------------------------------------------------------
95  virtual bool CheckPoint ( const Double_t x, const Double_t y ) const;
96  virtual bool CheckPoint ( const RPoint2D &p ) const;
97  virtual Int_t Type ( ) const;
98  virtual string TypeName ( ) const;
99 
100  // Retourne une distance normalisée entre le centre et un point
101  // dans le repère transformé (0 au centre, 1 sur le cercle, ...)
102  virtual Double_t NormalisedDistance ( const RPoint2D &p ) const;
103 
104  virtual Double_t GetAngle () const;
105  virtual RVector2D GetAxisA () const;
106  virtual RVector2D GetAxisB () const;
107  virtual RPoint2D GetCenter () const;
108  virtual Double_t GetRadiusA () const;
109  virtual Double_t GetRadiusB () const;
110 
111  virtual void SetCenter ( const RPoint2D ctr );
112 
113  public:
114  //------------------------------------------------------------
115  /*! For ROOT dictionary.*/
117 };
118 
119 //----------------------------------------------------------------------
120 // Inline functions
122 
123 //======================================================================
124 #endif
virtual Double_t GetRadiusB() const
Definition: RContourBaseEllipse.icc:38
virtual RPoint2D GetCenter() const
Definition: RContourBaseEllipse.icc:30
ClassDef(RContourBaseEllipse, 0)
virtual bool WriteData(ostream &os) const
Definition: RContourBaseEllipse.cpp:280
virtual bool Compare(const RContourBase *ct_ptr) const
Definition: RContourBaseEllipse.cpp:200
virtual void SetCenter(const RPoint2D ctr)
Definition: RContourBaseEllipse.icc:53
GObject(RContourBaseEllipse)
virtual ~RContourBaseEllipse()
Definition: RContourBaseEllipse.cpp:123
virtual RVector2D GetAxisB() const
Definition: RContourBaseEllipse.cpp:171
virtual Double_t NormalisedDistance(const RPoint2D &p) const
Definition: RContourBaseEllipse.icc:26
virtual string TypeName() const
Definition: RContourBaseEllipse.icc:46
RContourBaseEllipse()
Definition: RContourBaseEllipse.cpp:17
virtual RVector2D GetAxisA() const
Definition: RContourBaseEllipse.cpp:148
virtual Double_t GetAngle() const
Definition: RContourBaseEllipse.cpp:131
Definition: RVector2D.hh:26
Definition: RContourBaseEllipse.hh:26
virtual bool CheckPoint(const Double_t x, const Double_t y) const
Definition: RContourBaseEllipse.icc:18
static RContourBaseEllipse * ReadNew(istream &is)
Definition: RContourBaseEllipse.cpp:329
Definition: RAffine2D.hh:29
virtual Int_t Type() const
Definition: RContourBaseEllipse.icc:42
Definition: RContourBase2D.hh:20
Definition: RContourBase.hh:19
virtual TList * CreateObjectList() const
Definition: RContourBaseEllipse.cpp:246
virtual Double_t GetRadiusA() const
Definition: RContourBaseEllipse.icc:34
RContourBaseEllipse & operator=(const RContourBaseEllipse &ct)
Definition: RContourBaseEllipse.cpp:111