Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TPolyLine.h
Go to the documentation of this file.
1 // @(#)root/graf:$Id$
2 // Author: Rene Brun 12/12/94
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TPolyLine
13 #define ROOT_TPolyLine
14 
15 
16 #include "TString.h"
17 #include "TObject.h"
18 #include "TAttLine.h"
19 #include "TAttFill.h"
20 
21 class TCollection;
22 
23 class TPolyLine : public TObject, public TAttLine, public TAttFill {
24 
25 protected:
26  Int_t fN; ///<Number of points
27  Int_t fLastPoint; ///<The index of the last filled point
28  Double_t *fX; ///<[fN] Array of X coordinates
29  Double_t *fY; ///<[fN] Array of Y coordinates
30  TString fOption; ///<options
31 
32  TPolyLine& operator=(const TPolyLine&);
33 
34 public:
35  // TPolyLine status bits
36  enum {
37  kPolyLineNDC = BIT(14) ///< Polyline coordinates are in NDC space.
38  };
39 
40  TPolyLine();
41  TPolyLine(Int_t n, Option_t *option="");
42  TPolyLine(Int_t n, Float_t *x, Float_t *y, Option_t *option="");
43  TPolyLine(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
44  TPolyLine(const TPolyLine &polyline);
45  virtual ~TPolyLine();
46 
47  virtual void Copy(TObject &polyline) const;
48  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
49  virtual void Draw(Option_t *option="");
50  virtual void DrawPolyLine(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
51  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
52  virtual Int_t GetLastPoint() const { return fLastPoint;}
53  Int_t GetN() const {return fN;}
54  Double_t *GetX() const {return fX;}
55  Double_t *GetY() const {return fY;}
56  Option_t *GetOption() const {return fOption.Data();}
57  virtual void ls(Option_t *option="") const;
58  virtual Int_t Merge(TCollection *list);
59  virtual void Paint(Option_t *option="");
60  virtual void PaintPolyLine(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
61  virtual void PaintPolyLineNDC(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
62  virtual void Print(Option_t *option="") const;
63  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
64  virtual void SetNDC(Bool_t isNDC=kTRUE);
65  virtual Int_t SetNextPoint(Double_t x, Double_t y); // *MENU*
66  virtual void SetOption(Option_t *option="") {fOption = option;}
67  virtual void SetPoint(Int_t point, Double_t x, Double_t y); // *MENU*
68  virtual void SetPolyLine(Int_t n);
69  virtual void SetPolyLine(Int_t n, Float_t *x, Float_t *y, Option_t *option="");
70  virtual void SetPolyLine(Int_t n, Double_t *x, Double_t *y3, Option_t *option="");
71  virtual Int_t Size() const {return fLastPoint+1;}
72 
73  ClassDef(TPolyLine,3) //A PolyLine
74 };
75 
76 #endif
77