Logo ROOT   6.08/07
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 #ifndef ROOT_TObject
25 #include "TObject.h"
26 #endif
27 #ifndef ROOT_TAttMarker
28 #include "TAttMarker.h"
29 #endif
30 #ifndef ROOT_TAtt3D
31 #include "TAtt3D.h"
32 #endif
33 #ifndef ROOT_TString
34 #include "TString.h"
35 #endif
36 
37 class TH1;
38 class TCollection;
39 
40 class TPolyMarker3D : public TObject, public TAttMarker, public TAtt3D
41 {
42 protected:
43  Int_t fN; //Number of allocated points
44  Float_t *fP; //[3*fN] Array of X,Y,Z coordinates
45  TString fOption; //Options
46  Int_t fLastPoint; //The index of the last filled point
47  TString fName; //Name of polymarker
48 
50 
51 public:
52  TPolyMarker3D();
53  TPolyMarker3D(Int_t n, Marker_t marker=1, Option_t *option="");
54  TPolyMarker3D(Int_t n, Float_t *p, Marker_t marker=1, Option_t *option="");
55  TPolyMarker3D(Int_t n, Double_t *p, Marker_t marker=1, Option_t *option="");
56  TPolyMarker3D(const TPolyMarker3D &p);
57  virtual ~TPolyMarker3D();
58 
59  virtual void Copy(TObject &polymarker) const;
61  virtual void Draw(Option_t *option="");
62  virtual void DrawPolyMarker(Int_t n, Float_t *p, Marker_t marker, Option_t *option="");
63  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
64  virtual Int_t GetLastPoint() const { return fLastPoint;}
65  virtual const char *GetName() const {return fName.Data();}
66  virtual Int_t GetN() const { return fN;}
67  virtual Float_t *GetP() const { return fP;}
68  virtual void GetPoint(Int_t n, Float_t &x, Float_t &y, Float_t &z) const;
69  virtual void GetPoint(Int_t n, Double_t &x, Double_t &y, Double_t &z) const;
70  Option_t *GetOption() const {return fOption.Data();}
71  virtual void ls(Option_t *option="") const;
72  virtual Int_t Merge(TCollection *list);
73  virtual void Paint(Option_t *option="");
74  virtual void Print(Option_t *option="") const;
75  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
76  virtual void SetName(const char *name); // *MENU*
77  void SetPoint(Int_t n, Double_t x, Double_t y, Double_t z); // *MENU*
78  virtual void SetPolyMarker(Int_t n, Float_t *p, Marker_t marker, Option_t *option="");
79  virtual void SetPolyMarker(Int_t n, Double_t *p, Marker_t marker, Option_t *option="");
80  virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z); // *MENU*
81  virtual Int_t Size() const {return fLastPoint+1;}
82 
83  static void PaintH3(TH1 *h, Option_t *option);
84 
85  ClassDef(TPolyMarker3D,3); //An array of 3-D points with the same marker
86 };
87 
88 #endif
virtual void Paint(Option_t *option="")
Paint a TPolyMarker3D.
static void PaintH3(TH1 *h, Option_t *option)
Paint 3-d histogram h with 3-d polymarkers.
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
virtual void SetName(const char *name)
Change (i.e.
virtual ~TPolyMarker3D()
3-D polymarker destructor.
TH1 * h
Definition: legend2.C:5
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:21
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
TPolyMarker3D & operator=(const TPolyMarker3D &)
assignment operator
Marker Attributes class.
Definition: TAttMarker.h:24
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual void Copy(TObject &polymarker) const
Copy polymarker to polymarker obj.
virtual void SetPolyMarker(Int_t n, Float_t *p, Marker_t marker, Option_t *option="")
Re-initialize polymarker with n points from p.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream.
TPolyMarker3D()
3-D polymarker default constructor.
short Marker_t
Definition: RtypesCore.h:77
virtual void DrawPolyMarker(Int_t n, Float_t *p, Marker_t marker, Option_t *option="")
Draw this 3-D polymarker with new coordinates.
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...
Collection abstract base class.
Definition: TCollection.h:48
Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a 3-D polymarker.
virtual void Draw(Option_t *option="")
Draws 3-D polymarker with its current attributes.
void SetPoint(Int_t n, Double_t x, Double_t y, Double_t z)
Set point n to x, y, z.
virtual void ls(Option_t *option="") const
List this 3-D polymarker.
virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z)
Set point following LastPoint to x, y, z.
double Double_t
Definition: RtypesCore.h:55
virtual const char * GetName() const
Returns name of object.
Definition: TPolyMarker3D.h:65
Double_t y[n]
Definition: legend1.C:17
The TH1 histogram class.
Definition: TH1.h:80
virtual void Print(Option_t *option="") const
Print 3-D polymarker with its attributes on stdout.
Mother of all ROOT objects.
Definition: TObject.h:37
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
A 3D polymarker.
Definition: TPolyMarker3D.h:40
virtual Int_t GetN() const
Definition: TPolyMarker3D.h:66
virtual Float_t * GetP() const
Definition: TPolyMarker3D.h:67
virtual Int_t Merge(TCollection *list)
Merge polymarkers in the collection in this polymarker.
Float_t * fP
Definition: TPolyMarker3D.h:44
TString fOption
Definition: TPolyMarker3D.h:45
Option_t * GetOption() const
Definition: TPolyMarker3D.h:70
virtual Int_t GetLastPoint() const
Definition: TPolyMarker3D.h:64
const Int_t n
Definition: legend1.C:16
virtual Int_t Size() const
Definition: TPolyMarker3D.h:81
char name[80]
Definition: TGX11.cxx:109
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
const char * Data() const
Definition: TString.h:349