Logo ROOT  
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 #include "TObject.h"
26 #include "TAttMarker.h"
27 #include "TString.h"
28 
29 class TCollection;
30 
31 class TPolyMarker : public TObject, public TAttMarker {
32 protected:
33  Int_t fN; //number of points
34  Int_t fLastPoint; //The index of the last filled point
35  Double_t *fX; //[fN] Array of X coordinates
36  Double_t *fY; //[fN] Array of Y coordinates
37  TString fOption; //options
38 
40 
41 public:
42  TPolyMarker();
43  TPolyMarker(Int_t n, Option_t *option="");
44  TPolyMarker(Int_t n, Float_t *x, Float_t *y, Option_t *option="");
45  TPolyMarker(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
46  TPolyMarker(const TPolyMarker &polymarker);
47  virtual ~TPolyMarker();
48  virtual void Copy(TObject &polymarker) const;
49  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
50  virtual void Draw(Option_t *option="");
51  virtual void DrawPolyMarker(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
52  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
53  virtual Int_t GetLastPoint() const { return fLastPoint;}
54  virtual Int_t GetN() const {return fN;}
55  Option_t *GetOption() const {return fOption.Data();}
56  Double_t *GetX() const {return fX;}
57  Double_t *GetY() const {return fY;}
58  virtual void ls(Option_t *option="") const;
59  virtual Int_t Merge(TCollection *list);
60  virtual void Paint(Option_t *option="");
61  virtual void PaintPolyMarker(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 Int_t SetNextPoint(Double_t x, Double_t y); // *MENU*
65  virtual void SetPoint(Int_t point, Double_t x, Double_t y); // *MENU*
66  virtual void SetPolyMarker(Int_t n);
67  virtual void SetPolyMarker(Int_t n, Float_t *x, Float_t *y, Option_t *option="");
68  virtual void SetPolyMarker(Int_t n, Double_t *x, Double_t *y, Option_t *option="");
69  virtual Int_t Size() const {return fLastPoint+1;}
70 
71  ClassDef(TPolyMarker,4) //An array of points with the same marker
72 };
73 
74 #endif
TPolyMarker::~TPolyMarker
virtual ~TPolyMarker()
Destructor.
Definition: TPolyMarker.cxx:129
TPolyMarker::fN
Int_t fN
Definition: TPolyMarker.h:33
n
const Int_t n
Definition: legend1.C:16
TPolyMarker::fLastPoint
Int_t fLastPoint
Definition: TPolyMarker.h:34
TPolyMarker::GetOption
Option_t * GetOption() const
Definition: TPolyMarker.h:55
Option_t
const char Option_t
Definition: RtypesCore.h:66
TPolyMarker::Merge
virtual Int_t Merge(TCollection *list)
Merge polymarkers in the collection in this polymarker.
Definition: TPolyMarker.cxx:238
TString::Data
const char * Data() const
Definition: TString.h:369
TPolyMarker::GetLastPoint
virtual Int_t GetLastPoint() const
Definition: TPolyMarker.h:53
TAttMarker.h
Float_t
float Float_t
Definition: RtypesCore.h:57
Int_t
int Int_t
Definition: RtypesCore.h:45
x
Double_t x[n]
Definition: legend1.C:17
TPolyMarker::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Definition: TPolyMarker.cxx:312
TPolyMarker::PaintPolyMarker
virtual void PaintPolyMarker(Int_t n, Double_t *x, Double_t *y, Option_t *option="")
Paint polymarker.
Definition: TPolyMarker.cxx:282
TString
Basic string class.
Definition: TString.h:136
TPolyMarker::TPolyMarker
TPolyMarker()
Default constructor.
Definition: TPolyMarker.cxx:33
TPolyMarker::operator=
TPolyMarker & operator=(const TPolyMarker &)
assignment operator
Definition: TPolyMarker.cxx:109
TString.h
TPolyMarker::Size
virtual Int_t Size() const
Definition: TPolyMarker.h:69
TPolyMarker::fX
Double_t * fX
Definition: TPolyMarker.h:35
TPolyMarker::SetPolyMarker
virtual void SetPolyMarker(Int_t n)
If n <= 0 the current arrays of points are deleted.
Definition: TPolyMarker.cxx:381
TPolyMarker::ls
virtual void ls(Option_t *option="") const
ls.
Definition: TPolyMarker.cxx:229
TAttMarker
Marker Attributes class.
Definition: TAttMarker.h:19
y
Double_t y[n]
Definition: legend1.C:17
TPolyMarker::SetNextPoint
virtual Int_t SetNextPoint(Double_t x, Double_t y)
Set point following LastPoint to x, y.
Definition: TPolyMarker.cxx:339
TPolyMarker::Paint
virtual void Paint(Option_t *option="")
Paint.
Definition: TPolyMarker.cxx:274
TPolyMarker::Copy
virtual void Copy(TObject &polymarker) const
Copy this to obj.
Definition: TPolyMarker.cxx:149
TPolyMarker::GetN
virtual Int_t GetN() const
Definition: TPolyMarker.h:54
Double_t
double Double_t
Definition: RtypesCore.h:59
TPolyMarker::DistancetoPrimitive
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a polymarker.
Definition: TPolyMarker.cxx:179
TObject.h
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TPolyMarker
A PolyMarker is defined by an array on N points in a 2-D space.
Definition: TPolyMarker.h:31
TPolyMarker::SetPoint
virtual void SetPoint(Int_t point, Double_t x, Double_t y)
Set point number n.
Definition: TPolyMarker.cxx:351
TPolyMarker::Print
virtual void Print(Option_t *option="") const
Print polymarker.
Definition: TPolyMarker.cxx:304
TPolyMarker::GetY
Double_t * GetY() const
Definition: TPolyMarker.h:57
TCollection
Collection abstract base class.
Definition: TCollection.h:63
TPolyMarker::fY
Double_t * fY
Definition: TPolyMarker.h:36
TPolyMarker::DrawPolyMarker
virtual void DrawPolyMarker(Int_t n, Double_t *x, Double_t *y, Option_t *option="")
Draw polymarker.
Definition: TPolyMarker.cxx:207
TPolyMarker::Draw
virtual void Draw(Option_t *option="")
Draw.
Definition: TPolyMarker.cxx:199
int
TPolyMarker::GetX
Double_t * GetX() const
Definition: TPolyMarker.h:56
TPolyMarker::ExecuteEvent
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TPolyMarker.cxx:222
TPolyMarker::fOption
TString fOption
Definition: TPolyMarker.h:37