ROOT  6.06/09
Reference Guide
TPolyMarker.h
Go to the documentation of this file.
1 // @(#)root/hist:$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_TPolyMarker
13 #define ROOT_TPolyMarker
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TPolyMarker //
19 // //
20 // An array of points with the same marker. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 
25 #ifndef ROOT_TObject
26 #include "TObject.h"
27 #endif
28 #ifndef ROOT_TAttMarker
29 #include "TAttMarker.h"
30 #endif
31 #ifndef ROOT_TString
32 #include "TString.h"
33 #endif
34 
35 class TCollection;
36 
37 class TPolyMarker : public TObject, public TAttMarker {
38 protected:
39  Int_t fN; //number of points
40  Int_t fLastPoint; //The index of the last filled point
41  Double_t *fX; //[fN] Array of X coordinates
42  Double_t *fY; //[fN] Array of Y coordinates
43  TString fOption; //options
44 
46 
47 public:
48  TPolyMarker();
49  TPolyMarker(Int_t n, Option_t *option="");
50  TPolyMarker(Int_t n, Float_t *x, Float_t *y, Option_t *option="");
51  TPolyMarker(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
52  TPolyMarker(const TPolyMarker &polymarker);
53  virtual ~TPolyMarker();
54  virtual void Copy(TObject &polymarker) const;
55  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
56  virtual void Draw(Option_t *option="");
57  virtual void DrawPolyMarker(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
58  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
59  virtual Int_t GetLastPoint() const { return fLastPoint;}
60  virtual Int_t GetN() const {return fN;}
61  Option_t *GetOption() const {return fOption.Data();}
62  Double_t *GetX() const {return fX;}
63  Double_t *GetY() const {return fY;}
64  virtual void ls(Option_t *option="") const;
65  virtual Int_t Merge(TCollection *list);
66  virtual void Paint(Option_t *option="");
67  virtual void PaintPolyMarker(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
68  virtual void Print(Option_t *option="") const;
69  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
70  virtual Int_t SetNextPoint(Double_t x, Double_t y); // *MENU*
71  virtual void SetPoint(Int_t point, Double_t x, Double_t y); // *MENU*
72  virtual void SetPolyMarker(Int_t n);
73  virtual void SetPolyMarker(Int_t n, Float_t *x, Float_t *y, Option_t *option="");
74  virtual void SetPolyMarker(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
75  virtual Int_t Size() const {return fLastPoint+1;}
76 
77  ClassDef(TPolyMarker,4) //An array of points with the same marker
78 };
79 
80 #endif
virtual void Draw(Option_t *option="")
Draw.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
virtual void DrawPolyMarker(Int_t n, Double_t *x, Double_t *y, Option_t *option="")
Draw polymarker.
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
virtual void PaintPolyMarker(Int_t n, Double_t *x, Double_t *y, Option_t *option="")
Paint polymarker.
TString fOption
Definition: TPolyMarker.h:43
virtual ~TPolyMarker()
Desctructor.
virtual void Copy(TObject &polymarker) const
Copy this to obj.
virtual Int_t Merge(TCollection *list)
Merge polymarkers in the collection in this polymarker.
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
virtual Int_t Size() const
Definition: TPolyMarker.h:75
virtual Int_t GetN() const
Definition: TPolyMarker.h:60
Option_t * GetOption() const
Definition: TPolyMarker.h:61
TPolyMarker & operator=(const TPolyMarker &)
assignment operator
Marker Attributes class.
Definition: TAttMarker.h:32
const char * Data() const
Definition: TString.h:349
Double_t x[n]
Definition: legend1.C:17
Double_t * GetY() const
Definition: TPolyMarker.h:63
char * out
Definition: TBase64.cxx:29
virtual Int_t SetNextPoint(Double_t x, Double_t y)
Set point following LastPoint to x, y.
virtual void Paint(Option_t *option="")
Paint.
virtual void SetPolyMarker(Int_t n)
If n <= 0 the current arrays of points are deleted.
Double_t * fX
Definition: TPolyMarker.h:41
virtual Int_t GetLastPoint() const
Definition: TPolyMarker.h:59
Collection abstract base class.
Definition: TCollection.h:48
virtual void Print(Option_t *option="") const
Print polymarker.
virtual void SetPoint(Int_t point, Double_t x, Double_t y)
Set point number n.
A PolyMarker is defined by an array on N points in a 2-D space.
Definition: TPolyMarker.h:37
double Double_t
Definition: RtypesCore.h:55
virtual void ls(Option_t *option="") const
ls.
Double_t y[n]
Definition: legend1.C:17
Mother of all ROOT objects.
Definition: TObject.h:58
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a polymarker.
Double_t * fY
Definition: TPolyMarker.h:42
ClassDef(TAttMarker, 2)
Int_t fLastPoint
Definition: TPolyMarker.h:40
const Int_t n
Definition: legend1.C:16
Double_t * GetX() const
Definition: TPolyMarker.h:62