TPolyLine.h

Go to the documentation of this file.
00001 // @(#)root/graf:$Id: TPolyLine.h 21884 2008-01-28 17:01:42Z couet $
00002 // Author: Rene Brun   12/12/94
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TPolyLine
00013 #define ROOT_TPolyLine
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TPolyLine                                                            //
00019 //                                                                      //
00020 // A PolyLine.                                                          //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 
00025 #ifndef ROOT_TString
00026 #include "TString.h"
00027 #endif
00028 #ifndef ROOT_TObject
00029 #include "TObject.h"
00030 #endif
00031 #ifndef ROOT_TAttLine
00032 #include "TAttLine.h"
00033 #endif
00034 #ifndef ROOT_TAttFill
00035 #include "TAttFill.h"
00036 #endif
00037 
00038 class TCollection;
00039 
00040 class TPolyLine : public TObject, public TAttLine, public TAttFill {
00041 
00042 protected:
00043    Int_t        fN;            //Number of points
00044    Int_t        fLastPoint;    //The index of the last filled point
00045    Double_t    *fX;            //[fN] Array of X coordinates
00046    Double_t    *fY;            //[fN] Array of Y coordinates
00047    TString      fOption;       //options
00048 
00049    TPolyLine& operator=(const TPolyLine&);
00050 
00051 public:
00052    // TPolyLine status bits
00053    enum { kPolyLineNDC = BIT(14) };
00054 
00055    TPolyLine();
00056    TPolyLine(Int_t n, Option_t *option="");
00057    TPolyLine(Int_t n, Float_t *x, Float_t *y, Option_t *option="");
00058    TPolyLine(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
00059    TPolyLine(const TPolyLine &polyline);
00060    virtual ~TPolyLine();
00061 
00062    virtual void    Copy(TObject &polyline) const;
00063    virtual Int_t   DistancetoPrimitive(Int_t px, Int_t py);
00064    virtual void    Draw(Option_t *option="");
00065    virtual void    DrawPolyLine(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
00066    virtual void    ExecuteEvent(Int_t event, Int_t px, Int_t py);
00067    virtual Int_t   GetLastPoint() const { return fLastPoint;}
00068    Int_t           GetN() const {return fN;}
00069    Double_t       *GetX() const {return fX;}
00070    Double_t       *GetY() const {return fY;}
00071    Option_t        *GetOption() const {return fOption.Data();}
00072    virtual void    ls(Option_t *option="") const;
00073    virtual Int_t   Merge(TCollection *list);
00074    virtual void    Paint(Option_t *option="");
00075    virtual void    PaintPolyLine(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
00076    virtual void    PaintPolyLineNDC(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
00077    virtual void    Print(Option_t *option="") const;
00078    virtual void    SavePrimitive(ostream &out, Option_t *option = "");
00079    virtual void    SetNDC(Bool_t isNDC=kTRUE);
00080    virtual Int_t   SetNextPoint(Double_t x, Double_t y); // *MENU*
00081    virtual void    SetOption(Option_t *option="") {fOption = option;}
00082    virtual void    SetPoint(Int_t point, Double_t x, Double_t y); // *MENU*
00083    virtual void    SetPolyLine(Int_t n);
00084    virtual void    SetPolyLine(Int_t n, Float_t *x, Float_t *y, Option_t *option="");
00085    virtual void    SetPolyLine(Int_t n, Double_t *x, Double_t *y3, Option_t *option="");
00086    virtual Int_t   Size() const {return fLastPoint+1;}
00087 
00088    ClassDef(TPolyLine,3)  //A PolyLine
00089 };
00090 
00091 #endif
00092 

Generated on Tue Jul 5 14:14:10 2011 for ROOT_528-00b_version by  doxygen 1.5.1