00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TLine
00013 #define ROOT_TLine
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef ROOT_TObject
00025 #include "TObject.h"
00026 #endif
00027
00028 #ifndef ROOT_TAttLine
00029 #include "TAttLine.h"
00030 #endif
00031
00032
00033 class TLine : public TObject, public TAttLine {
00034
00035 protected:
00036 Double_t fX1;
00037 Double_t fY1;
00038 Double_t fX2;
00039 Double_t fY2;
00040
00041 public:
00042
00043 enum {
00044 kLineNDC = BIT(14),
00045 kVertical = BIT(15),
00046 kHorizontal = BIT(16)
00047 };
00048
00049 TLine();
00050 TLine(Double_t x1, Double_t y1,Double_t x2, Double_t y2);
00051 TLine(const TLine &line);
00052 virtual ~TLine();
00053
00054 void Copy(TObject &line) const;
00055 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
00056 virtual TLine *DrawLine(Double_t x1, Double_t y1,Double_t x2, Double_t y2);
00057 virtual TLine *DrawLineNDC(Double_t x1, Double_t y1,Double_t x2, Double_t y2);
00058 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
00059 Double_t GetX1() const {return fX1;}
00060 Double_t GetX2() const {return fX2;}
00061 Double_t GetY1() const {return fY1;}
00062 Double_t GetY2() const {return fY2;}
00063 Bool_t IsHorizontal();
00064 Bool_t IsVertical();
00065 virtual void ls(Option_t *option="") const;
00066 virtual void Paint(Option_t *option="");
00067 virtual void PaintLine(Double_t x1, Double_t y1,Double_t x2, Double_t y2);
00068 virtual void PaintLineNDC(Double_t u1, Double_t v1,Double_t u2, Double_t v2);
00069 virtual void Print(Option_t *option="") const;
00070 virtual void SavePrimitive(ostream &out, Option_t *option = "");
00071 void SetHorizontal(Bool_t set = kTRUE);
00072 void SetVertical(Bool_t set = kTRUE);
00073 virtual void SetX1(Double_t x1) {fX1=x1;}
00074 virtual void SetX2(Double_t x2) {fX2=x2;}
00075 virtual void SetY1(Double_t y1) {fY1=y1;}
00076 virtual void SetY2(Double_t y2) {fY2=y2;}
00077
00078 ClassDef(TLine,2)
00079 };
00080
00081 #endif