File indexing completed on 2025-01-18 10:12:20
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TPolyLine
0013 #define ROOT_TPolyLine
0014
0015
0016 #include "TString.h"
0017 #include "TObject.h"
0018 #include "TAttLine.h"
0019 #include "TAttFill.h"
0020
0021 class TCollection;
0022
0023 class TPolyLine : public TObject, public TAttLine, public TAttFill {
0024
0025 protected:
0026 Int_t fN{0};
0027 Int_t fLastPoint{-1};
0028 Double_t *fX{nullptr};
0029 Double_t *fY{nullptr};
0030 TString fOption;
0031
0032 TPolyLine& operator=(const TPolyLine&);
0033
0034 public:
0035
0036 enum {
0037 kPolyLineNDC = BIT(14)
0038 };
0039
0040 TPolyLine();
0041 TPolyLine(Int_t n, Option_t *option="");
0042 TPolyLine(Int_t n, Float_t *x, Float_t *y, Option_t *option="");
0043 TPolyLine(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
0044 TPolyLine(const TPolyLine &polyline);
0045 ~TPolyLine() override;
0046
0047 void Copy(TObject &polyline) const override;
0048 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
0049 void Draw(Option_t *option="") override;
0050 virtual TPolyLine *DrawPolyLine(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
0051 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
0052 virtual Int_t GetLastPoint() const { return fLastPoint;}
0053 Int_t GetN() const {return fN;}
0054 Double_t *GetX() const {return fX;}
0055 Double_t *GetY() const {return fY;}
0056 Option_t *GetOption() const override { return fOption.Data(); }
0057 void ls(Option_t *option="") const override;
0058 virtual Int_t Merge(TCollection *list);
0059 void Paint(Option_t *option="") override;
0060 virtual void PaintPolyLine(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
0061 virtual void PaintPolyLineNDC(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
0062 void Print(Option_t *option="") const override;
0063 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0064 virtual void SetNDC(Bool_t isNDC=kTRUE);
0065 virtual Int_t SetNextPoint(Double_t x, Double_t y);
0066 virtual void SetOption(Option_t *option="") {fOption = option;}
0067 virtual void SetPoint(Int_t point, Double_t x, Double_t y);
0068 virtual void SetPolyLine(Int_t n);
0069 virtual void SetPolyLine(Int_t n, Float_t *x, Float_t *y, Option_t *option="");
0070 virtual void SetPolyLine(Int_t n, Double_t *x, Double_t *y3, Option_t *option="");
0071 virtual Int_t Size() const {return fLastPoint+1;}
0072
0073 ClassDefOverride(TPolyLine,3)
0074 };
0075
0076 #endif
0077