Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
29class TH1;
30class TCollection;
31
32class TPolyMarker3D : public TObject, public TAttMarker, public TAtt3D
33{
34protected:
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
43public:
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="");
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
#define h(i)
Definition RSha256.hxx:106
int Int_t
Definition RtypesCore.h:45
short Marker_t
Definition RtypesCore.h:90
double Double_t
Definition RtypesCore.h:59
float Float_t
Definition RtypesCore.h:57
const char Option_t
Definition RtypesCore.h:66
#define ClassDef(name, id)
Definition Rtypes.h:325
char name[80]
Definition TGX11.cxx:110
Use this attribute class when an object should have 3D capabilities.
Definition TAtt3D.h:19
Marker Attributes class.
Definition TAttMarker.h:19
Collection abstract base class.
Definition TCollection.h:65
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:58
Mother of all ROOT objects.
Definition TObject.h:41
A 3D polymarker.
static void PaintH3(TH1 *h, Option_t *option)
Paint 3-d histogram h with 3-d polymarkers.
virtual Int_t Merge(TCollection *list)
Merge polymarkers in the collection in this polymarker.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream.
virtual void DrawPolyMarker(Int_t n, Float_t *p, Marker_t marker, Option_t *option="")
Draw this 3-D polymarker with new coordinates.
void SetPoint(Int_t n, Double_t x, Double_t y, Double_t z)
Set point n to x, y, z.
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...
virtual void SetPolyMarker(Int_t n, Float_t *p, Marker_t marker, Option_t *option="")
Re-initialize polymarker with n points from p.
virtual ~TPolyMarker3D()
3-D polymarker destructor.
virtual Int_t Size() const
virtual const char * GetName() const
Returns name of object.
virtual Int_t GetN() const
virtual Int_t GetLastPoint() const
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
virtual void SetName(const char *name)
Change (i.e.
TPolyMarker3D & operator=(const TPolyMarker3D &)
assignment operator
virtual void Paint(Option_t *option="")
Paint a TPolyMarker3D.
virtual Float_t * GetP() const
virtual void Copy(TObject &polymarker) const
Copy polymarker to polymarker obj.
virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z)
Set point following LastPoint to x, y, z.
Option_t * GetOption() const
virtual void Print(Option_t *option="") const
Print 3-D polymarker with its attributes on stdout.
virtual void ls(Option_t *option="") const
List this 3-D polymarker.
Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a 3-D polymarker.
TPolyMarker3D()
3-D polymarker default constructor.
Basic string class.
Definition TString.h:136
const char * Data() const
Definition TString.h:369
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
th1 Draw()