Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TEllipse.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/graf:$Id$
0002 // Author: Rene Brun   16/10/95
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TEllipse
0013 #define ROOT_TEllipse
0014 
0015 
0016 #include "TObject.h"
0017 #include "TAttLine.h"
0018 #include "TAttFill.h"
0019 #include "TAttBBox2D.h"
0020 
0021 class TPoint;
0022 
0023 class TEllipse : public TObject, public TAttLine, public TAttFill, public TAttBBox2D {
0024 
0025 protected:
0026    Double_t    fX1;        ///< X coordinate of centre
0027    Double_t    fY1;        ///< Y coordinate of centre
0028    Double_t    fR1;        ///< first radius
0029    Double_t    fR2;        ///< second radius
0030    Double_t    fPhimin;    ///< Minimum angle (degrees)
0031    Double_t    fPhimax;    ///< Maximum angle (degrees)
0032    Double_t    fTheta;     ///< Rotation angle (degrees)
0033 
0034 public:
0035    // TEllipse status bits
0036    enum {
0037       kNoEdges     = BIT(9)   // don't draw lines connecting center to edges
0038    };
0039    TEllipse();
0040    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);
0041    TEllipse(const TEllipse &ellipse);
0042    ~TEllipse() override;
0043    void                 Copy(TObject &ellipse) const override;
0044    Int_t                DistancetoPrimitive(Int_t px, Int_t py) override;
0045    void                 Draw(Option_t *option="") override;
0046    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="");
0047    void                 ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
0048    Int_t                IsInside(Double_t x, Double_t y) const;
0049    Double_t             GetX1() const {return fX1;}
0050    Double_t             GetY1() const {return fY1;}
0051    Double_t             GetR1() const {return fR1;}
0052    Double_t             GetR2() const {return fR2;}
0053    Double_t             GetPhimin() const {return fPhimin;}
0054    Double_t             GetPhimax() const {return fPhimax;}
0055    Double_t             GetTheta() const  {return fTheta;}
0056    Bool_t               GetNoEdges() const;
0057    void                 ls(Option_t *option="") const override;
0058    void                 Paint(Option_t *option="") override;
0059    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="");
0060    void                 Print(Option_t *option="") const override;
0061    void                 SavePrimitive(std::ostream &out, Option_t *option = "") override;
0062    virtual void         SetNoEdges(Bool_t noEdges=kTRUE); // *TOGGLE* *GETTER=GetNoEdges
0063    virtual void         SetPhimin(Double_t phi=0)   {fPhimin=phi;} // *MENU*
0064    virtual void         SetPhimax(Double_t phi=360) {fPhimax=phi;} // *MENU*
0065    virtual void         SetR1(Double_t r1) {fR1=r1;} // *MENU*
0066    virtual void         SetR2(Double_t r2) {fR2=r2;} // *MENU*
0067    virtual void         SetTheta(Double_t theta=0) {fTheta=theta;} // *MENU*
0068    virtual void         SetX1(Double_t x1) {fX1=x1;} // *MENU*
0069    virtual void         SetY1(Double_t y1) {fY1=y1;} // *MENU*
0070    Rectangle_t          GetBBox() override;
0071    TPoint               GetBBoxCenter() override;
0072    void                 SetBBoxCenter(const TPoint &p) override;
0073    void                 SetBBoxCenterX(const Int_t x) override;
0074    void                 SetBBoxCenterY(const Int_t y) override;
0075    void                 SetBBoxX1(const Int_t x) override;
0076    void                 SetBBoxX2(const Int_t x) override;
0077    void                 SetBBoxY1(const Int_t y) override;
0078    void                 SetBBoxY2(const Int_t y) override;
0079 
0080    ClassDefOverride(TEllipse,3)  //An ellipse
0081 };
0082 
0083 #endif