Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 
41  TPolyMarker3D& operator=(const TPolyMarker3D&);
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;
52  Int_t DistancetoPrimitive(Int_t px, Int_t py);
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