Logo ROOT  
Reference Guide
TPolyMarker3D.h
Go to the documentation of this file.
1 // @(#)root/g3d:$Id$
2 // Author: Nenad Buncic 21/08/95
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_TPolyMarker3D
13 #define ROOT_TPolyMarker3D
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TPolyMarker3D //
19 // //
20 // An array of 3-D points with the same marker. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TObject.h"
25 #include "TAttMarker.h"
26 #include "TAtt3D.h"
27 #include "TString.h"
28 
29 class TH1;
30 class TCollection;
31 
32 class TPolyMarker3D : public TObject, public TAttMarker, public TAtt3D
33 {
34 protected:
35  Int_t fN; //Number of allocated points
36  Float_t *fP; //[3*fN] Array of X,Y,Z coordinates
37  TString fOption; //Options
38  Int_t fLastPoint; //The index of the last filled point
39  TString fName; //Name of polymarker
40 
42 
43 public:
44  TPolyMarker3D();
45  TPolyMarker3D(Int_t n, Marker_t marker=1, Option_t *option="");
46  TPolyMarker3D(Int_t n, Float_t *p, Marker_t marker=1, Option_t *option="");
47  TPolyMarker3D(Int_t n, Double_t *p, Marker_t marker=1, Option_t *option="");
48  TPolyMarker3D(const TPolyMarker3D &p);
49  virtual ~TPolyMarker3D();
50 
51  virtual void Copy(TObject &polymarker) const;
53  virtual void Draw(Option_t *option="");
54  virtual void DrawPolyMarker(Int_t n, Float_t *p, Marker_t marker, Option_t *option="");
55  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
56  virtual Int_t GetLastPoint() const { return fLastPoint;}
57  virtual const char *GetName() const {return fName.Data();}
58  virtual Int_t GetN() const { return fN;}
59  virtual Float_t *GetP() const { return fP;}
60  virtual void GetPoint(Int_t n, Float_t &x, Float_t &y, Float_t &z) const;
61  virtual void GetPoint(Int_t n, Double_t &x, Double_t &y, Double_t &z) const;
62  Option_t *GetOption() const {return fOption.Data();}
63  virtual void ls(Option_t *option="") const;
64  virtual Int_t Merge(TCollection *list);
65  virtual void Paint(Option_t *option="");
66  virtual void Print(Option_t *option="") const;
67  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
68  virtual void SetName(const char *name); // *MENU*
69  void SetPoint(Int_t n, Double_t x, Double_t y, Double_t z); // *MENU*
70  virtual void SetPolyMarker(Int_t n, Float_t *p, Marker_t marker, Option_t *option="");
71  virtual void SetPolyMarker(Int_t n, Double_t *p, Marker_t marker, Option_t *option="");
72  virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z); // *MENU*
73  virtual Int_t Size() const {return fLastPoint+1;}
74 
75  static void PaintH3(TH1 *h, Option_t *option);
76 
77  ClassDef(TPolyMarker3D,3); //An array of 3-D points with the same marker
78 };
79 
80 #endif
TPolyMarker3D::Size
virtual Int_t Size() const
Definition: TPolyMarker3D.h:73
n
const Int_t n
Definition: legend1.C:16
TPolyMarker3D::SetName
virtual void SetName(const char *name)
Change (i.e.
Definition: TPolyMarker3D.cxx:536
TPolyMarker3D::fP
Float_t * fP
Definition: TPolyMarker3D.h:36
TString::Data
const char * Data() const
Definition: TString.h:369
TAttMarker.h
Float_t
float Float_t
Definition: RtypesCore.h:57
TPolyMarker3D::DrawPolyMarker
virtual void DrawPolyMarker(Int_t n, Float_t *p, Marker_t marker, Option_t *option="")
Draw this 3-D polymarker with new coordinates.
Definition: TPolyMarker3D.cxx:275
Int_t
int Int_t
Definition: RtypesCore.h:45
x
Double_t x[n]
Definition: legend1.C:17
TPolyMarker3D::fLastPoint
Int_t fLastPoint
Definition: TPolyMarker3D.h:38
TString
Definition: TString.h:136
TAtt3D
Definition: TAtt3D.h:19
TString.h
TPolyMarker3D::Merge
virtual Int_t Merge(TCollection *list)
Merge polymarkers in the collection in this polymarker.
Definition: TPolyMarker3D.cxx:309
Marker_t
short Marker_t
Definition: RtypesCore.h:81
TPolyMarker3D::fOption
TString fOption
Definition: TPolyMarker3D.h:37
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TPolyMarker3D::SetPolyMarker
virtual void SetPolyMarker(Int_t n, Float_t *p, Marker_t marker, Option_t *option="")
Re-initialize polymarker with n points from p.
Definition: TPolyMarker3D.cxx:583
TAtt3D.h
TPolyMarker3D::Draw
virtual void Draw(Option_t *option="")
Draws 3-D polymarker with its current attributes.
Definition: TPolyMarker3D.cxx:265
h
#define h(i)
Definition: RSha256.hxx:124
TPolyMarker3D
Definition: TPolyMarker3D.h:32
TPolyMarker3D::GetLastPoint
virtual Int_t GetLastPoint() const
Definition: TPolyMarker3D.h:56
TAttMarker
Definition: TAttMarker.h:19
TPolyMarker3D::Paint
virtual void Paint(Option_t *option="")
Paint a TPolyMarker3D.
Definition: TPolyMarker3D.cxx:344
TPolyMarker3D::fName
TString fName
Definition: TPolyMarker3D.h:39
y
Double_t y[n]
Definition: legend1.C:17
TPolyMarker3D::SetNextPoint
virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z)
Set point following LastPoint to x, y, z.
Definition: TPolyMarker3D.cxx:546
TPolyMarker3D::GetP
virtual Float_t * GetP() const
Definition: TPolyMarker3D.h:59
TPolyMarker3D::GetOption
Option_t * GetOption() const
Definition: TPolyMarker3D.h:62
TPolyMarker3D::TPolyMarker3D
TPolyMarker3D()
3-D polymarker default constructor.
Definition: TPolyMarker3D.cxx:75
TPolyMarker3D::SetPoint
void SetPoint(Int_t n, Double_t x, Double_t y, Double_t z)
Set point n to x, y, z.
Definition: TPolyMarker3D.cxx:558
TPolyMarker3D::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream.
Definition: TPolyMarker3D.cxx:510
Double_t
double Double_t
Definition: RtypesCore.h:59
TPolyMarker3D::ls
virtual void ls(Option_t *option="") const
List this 3-D polymarker.
Definition: TPolyMarker3D.cxx:300
TPolyMarker3D::fN
Int_t fN
Definition: TPolyMarker3D.h:35
TObject.h
TPolyMarker3D::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TPolyMarker3D.h:57
TPolyMarker3D::GetPoint
virtual void GetPoint(Int_t n, Float_t &x, Float_t &y, Float_t &z) const
Fills the parameters x, y, z with the coordinate of the n-th point n must be between 0 and Size() - 1...
Definition: TPolyMarker3D.cxx:693
TPolyMarker3D::PaintH3
static void PaintH3(TH1 *h, Option_t *option)
Paint 3-d histogram h with 3-d polymarkers.
Definition: TPolyMarker3D.cxx:415
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TH1
Definition: TH1.h:57
name
char name[80]
Definition: TGX11.cxx:110
TPolyMarker3D::DistancetoPrimitive
Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a 3-D polymarker.
Definition: TPolyMarker3D.cxx:225
TPolyMarker3D::Print
virtual void Print(Option_t *option="") const
Print 3-D polymarker with its attributes on stdout.
Definition: TPolyMarker3D.cxx:494
TPolyMarker3D::Copy
virtual void Copy(TObject &polymarker) const
Copy polymarker to polymarker obj.
Definition: TPolyMarker3D.cxx:202
TPolyMarker3D::ExecuteEvent
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
Definition: TPolyMarker3D.cxx:291
TPolyMarker3D::operator=
TPolyMarker3D & operator=(const TPolyMarker3D &)
assignment operator
Definition: TPolyMarker3D.cxx:162
TCollection
Definition: TCollection.h:63
TPolyMarker3D::GetN
virtual Int_t GetN() const
Definition: TPolyMarker3D.h:58
TPolyMarker3D::~TPolyMarker3D
virtual ~TPolyMarker3D()
3-D polymarker destructor.
Definition: TPolyMarker3D.cxx:180
int