Logo ROOT   6.18/05
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
29class TCollection;
30
31class TPolyMarker : public TObject, public TAttMarker {
32protected:
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
41public:
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
int Int_t
Definition: RtypesCore.h:41
double Double_t
Definition: RtypesCore.h:55
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
Marker Attributes class.
Definition: TAttMarker.h:19
Collection abstract base class.
Definition: TCollection.h:63
Mother of all ROOT objects.
Definition: TObject.h:37
A PolyMarker is defined by an array on N points in a 2-D space.
Definition: TPolyMarker.h:31
TPolyMarker & operator=(const TPolyMarker &)
assignment operator
virtual void PaintPolyMarker(Int_t n, Double_t *x, Double_t *y, Option_t *option="")
Paint polymarker.
Double_t * fY
Definition: TPolyMarker.h:36
virtual void Copy(TObject &polymarker) const
Copy this to obj.
virtual Int_t GetN() const
Definition: TPolyMarker.h:54
Option_t * GetOption() const
Definition: TPolyMarker.h:55
virtual void Paint(Option_t *option="")
Paint.
virtual Int_t Size() const
Definition: TPolyMarker.h:69
virtual Int_t Merge(TCollection *list)
Merge polymarkers in the collection in this polymarker.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
TPolyMarker()
Default constructor.
Definition: TPolyMarker.cxx:33
virtual void DrawPolyMarker(Int_t n, Double_t *x, Double_t *y, Option_t *option="")
Draw polymarker.
virtual void SetPolyMarker(Int_t n)
If n <= 0 the current arrays of points are deleted.
Double_t * GetX() const
Definition: TPolyMarker.h:56
virtual Int_t SetNextPoint(Double_t x, Double_t y)
Set point following LastPoint to x, y.
Int_t fLastPoint
Definition: TPolyMarker.h:34
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
virtual Int_t GetLastPoint() const
Definition: TPolyMarker.h:53
virtual void Draw(Option_t *option="")
Draw.
TString fOption
Definition: TPolyMarker.h:37
virtual ~TPolyMarker()
Destructor.
Double_t * fX
Definition: TPolyMarker.h:35
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a polymarker.
virtual void Print(Option_t *option="") const
Print polymarker.
virtual void ls(Option_t *option="") const
ls.
Double_t * GetY() const
Definition: TPolyMarker.h:57
virtual void SetPoint(Int_t point, Double_t x, Double_t y)
Set point number n.
Basic string class.
Definition: TString.h:131
const char * Data() const
Definition: TString.h:364
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
const Int_t n
Definition: legend1.C:16