Logo ROOT   6.14/05
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
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.
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:19
Basic string class.
Definition: TString.h:131
int Int_t
Definition: RtypesCore.h:41
TPolyMarker3D & operator=(const TPolyMarker3D &)
assignment operator
Marker Attributes class.
Definition: TAttMarker.h:19
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:320
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:63
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.
#define h(i)
Definition: RSha256.hxx:106
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:57
Double_t y[n]
Definition: legend1.C:17
The TH1 histogram class.
Definition: TH1.h:56
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:32
virtual Int_t GetN() const
Definition: TPolyMarker3D.h:58
virtual Float_t * GetP() const
Definition: TPolyMarker3D.h:59
virtual Int_t Merge(TCollection *list)
Merge polymarkers in the collection in this polymarker.
Float_t * fP
Definition: TPolyMarker3D.h:36
TString fOption
Definition: TPolyMarker3D.h:37
Option_t * GetOption() const
Definition: TPolyMarker3D.h:62
virtual Int_t GetLastPoint() const
Definition: TPolyMarker3D.h:56
const Int_t n
Definition: legend1.C:16
virtual Int_t Size() const
Definition: TPolyMarker3D.h:73
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:364