ROOT logo
// @(#)root/graf:$Id: TPolyLine.h 21884 2008-01-28 17:01:42Z couet $
// Author: Rene Brun   12/12/94

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TPolyLine
#define ROOT_TPolyLine


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TPolyLine                                                            //
//                                                                      //
// A PolyLine.                                                          //
//                                                                      //
//////////////////////////////////////////////////////////////////////////


#ifndef ROOT_TString
#include "TString.h"
#endif
#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TAttLine
#include "TAttLine.h"
#endif
#ifndef ROOT_TAttFill
#include "TAttFill.h"
#endif

class TCollection;

class TPolyLine : public TObject, public TAttLine, public TAttFill {

protected:
   Int_t        fN;            //Number of points
   Int_t        fLastPoint;    //The index of the last filled point
   Double_t    *fX;            //[fN] Array of X coordinates
   Double_t    *fY;            //[fN] Array of Y coordinates
   TString      fOption;       //options

   TPolyLine& operator=(const TPolyLine&);

public:
   // TPolyLine status bits
   enum { kPolyLineNDC = BIT(14) };

   TPolyLine();
   TPolyLine(Int_t n, Option_t *option="");
   TPolyLine(Int_t n, Float_t *x, Float_t *y, Option_t *option="");
   TPolyLine(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
   TPolyLine(const TPolyLine &polyline);
   virtual ~TPolyLine();

   virtual void    Copy(TObject &polyline) const;
   virtual Int_t   DistancetoPrimitive(Int_t px, Int_t py);
   virtual void    Draw(Option_t *option="");
   virtual void    DrawPolyLine(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
   virtual void    ExecuteEvent(Int_t event, Int_t px, Int_t py);
   virtual Int_t   GetLastPoint() const { return fLastPoint;}
   Int_t           GetN() const {return fN;}
   Double_t       *GetX() const {return fX;}
   Double_t       *GetY() const {return fY;}
   Option_t        *GetOption() const {return fOption.Data();}
   virtual void    ls(Option_t *option="") const;
   virtual Int_t   Merge(TCollection *list);
   virtual void    Paint(Option_t *option="");
   virtual void    PaintPolyLine(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
   virtual void    PaintPolyLineNDC(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
   virtual void    Print(Option_t *option="") const;
   virtual void    SavePrimitive(ostream &out, Option_t *option = "");
   virtual void    SetNDC(Bool_t isNDC=kTRUE);
   virtual Int_t   SetNextPoint(Double_t x, Double_t y); // *MENU*
   virtual void    SetOption(Option_t *option="") {fOption = option;}
   virtual void    SetPoint(Int_t point, Double_t x, Double_t y); // *MENU*
   virtual void    SetPolyLine(Int_t n);
   virtual void    SetPolyLine(Int_t n, Float_t *x, Float_t *y, Option_t *option="");
   virtual void    SetPolyLine(Int_t n, Double_t *x, Double_t *y3, Option_t *option="");
   virtual Int_t   Size() const {return fLastPoint+1;}

   ClassDef(TPolyLine,3)  //A PolyLine
};

#endif

 TPolyLine.h:1
 TPolyLine.h:2
 TPolyLine.h:3
 TPolyLine.h:4
 TPolyLine.h:5
 TPolyLine.h:6
 TPolyLine.h:7
 TPolyLine.h:8
 TPolyLine.h:9
 TPolyLine.h:10
 TPolyLine.h:11
 TPolyLine.h:12
 TPolyLine.h:13
 TPolyLine.h:14
 TPolyLine.h:15
 TPolyLine.h:16
 TPolyLine.h:17
 TPolyLine.h:18
 TPolyLine.h:19
 TPolyLine.h:20
 TPolyLine.h:21
 TPolyLine.h:22
 TPolyLine.h:23
 TPolyLine.h:24
 TPolyLine.h:25
 TPolyLine.h:26
 TPolyLine.h:27
 TPolyLine.h:28
 TPolyLine.h:29
 TPolyLine.h:30
 TPolyLine.h:31
 TPolyLine.h:32
 TPolyLine.h:33
 TPolyLine.h:34
 TPolyLine.h:35
 TPolyLine.h:36
 TPolyLine.h:37
 TPolyLine.h:38
 TPolyLine.h:39
 TPolyLine.h:40
 TPolyLine.h:41
 TPolyLine.h:42
 TPolyLine.h:43
 TPolyLine.h:44
 TPolyLine.h:45
 TPolyLine.h:46
 TPolyLine.h:47
 TPolyLine.h:48
 TPolyLine.h:49
 TPolyLine.h:50
 TPolyLine.h:51
 TPolyLine.h:52
 TPolyLine.h:53
 TPolyLine.h:54
 TPolyLine.h:55
 TPolyLine.h:56
 TPolyLine.h:57
 TPolyLine.h:58
 TPolyLine.h:59
 TPolyLine.h:60
 TPolyLine.h:61
 TPolyLine.h:62
 TPolyLine.h:63
 TPolyLine.h:64
 TPolyLine.h:65
 TPolyLine.h:66
 TPolyLine.h:67
 TPolyLine.h:68
 TPolyLine.h:69
 TPolyLine.h:70
 TPolyLine.h:71
 TPolyLine.h:72
 TPolyLine.h:73
 TPolyLine.h:74
 TPolyLine.h:75
 TPolyLine.h:76
 TPolyLine.h:77
 TPolyLine.h:78
 TPolyLine.h:79
 TPolyLine.h:80
 TPolyLine.h:81
 TPolyLine.h:82
 TPolyLine.h:83
 TPolyLine.h:84
 TPolyLine.h:85
 TPolyLine.h:86
 TPolyLine.h:87
 TPolyLine.h:88
 TPolyLine.h:89
 TPolyLine.h:90
 TPolyLine.h:91
 TPolyLine.h:92