Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:20

0001 // @(#)root/graf:$Id$
0002 // Author: Rene Brun   12/12/94
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_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};            ///<Number of points
0027    Int_t        fLastPoint{-1};   ///<The index of the last filled point
0028    Double_t    *fX{nullptr};      ///<[fN] Array of X coordinates
0029    Double_t    *fY{nullptr};      ///<[fN] Array of Y coordinates
0030    TString      fOption;          ///<options
0031 
0032    TPolyLine& operator=(const TPolyLine&);
0033 
0034 public:
0035    // TPolyLine status bits
0036    enum {
0037       kPolyLineNDC = BIT(14) ///< Polyline coordinates are in NDC space.
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); // *MENU*
0066    virtual void       SetOption(Option_t *option="") {fOption = option;}
0067    virtual void       SetPoint(Int_t point, Double_t x, Double_t y); // *MENU*
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)  //A PolyLine
0074 };
0075 
0076 #endif
0077