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
29class TH1;
30class TCollection;
31
32class TPolyMarker3D : public TObject, public TAttMarker, public TAtt3D
33{
34protected:
35 Int_t fN{0}; //Number of allocated points
36 Float_t *fP{nullptr}; //[3*fN] Array of X,Y,Z coordinates
37 TString fOption; //Options
38 Int_t fLastPoint{-1}; //The index of the last filled point
39 TString fName; //Name of polymarker
40
41public:
48 virtual ~TPolyMarker3D();
49
50 void Copy(TObject &polymarker) const override;
51 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
52 void Draw(Option_t *option="") override;
53 virtual void DrawPolyMarker(Int_t n, Float_t *p, Marker_t marker, Option_t *option="");
54 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
55 virtual Int_t GetLastPoint() const { return fLastPoint;}
56 const char *GetName() const override { return fName.Data(); }
57 virtual Int_t GetN() const { return fN;}
58 virtual Float_t *GetP() const { return fP;}
59 virtual void GetPoint(Int_t n, Float_t &x, Float_t &y, Float_t &z) const;
60 virtual void GetPoint(Int_t n, Double_t &x, Double_t &y, Double_t &z) const;
61 Option_t *GetOption() const override { return fOption.Data(); }
62 void ls(Option_t *option="") const override;
63 virtual Int_t Merge(TCollection *list);
64 void Paint(Option_t *option="") override;
65 void Print(Option_t *option="") const override;
66 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
67 virtual void SetName(const char *name); // *MENU*
68 void SetPoint(Int_t n, Double_t x, Double_t y, Double_t z); // *MENU*
69 virtual void SetPolyMarker(Int_t n, Float_t *p, Marker_t marker, Option_t *option="");
70 virtual void SetPolyMarker(Int_t n, Double_t *p, Marker_t marker, Option_t *option="");
71 virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z); // *MENU*
72 virtual Int_t Size() const {return fLastPoint+1;}
73
74 static void PaintH3(TH1 *h, Option_t *option);
75
76 ClassDefOverride(TPolyMarker3D,3); //An array of 3-D points with the same marker
77};
78
79#endif
#define h(i)
Definition: RSha256.hxx:106
int Int_t
Definition: RtypesCore.h:45
short Marker_t
Definition: RtypesCore.h:90
float Float_t
Definition: RtypesCore.h:57
double Double_t
Definition: RtypesCore.h:59
const char Option_t
Definition: RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t option
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.
Definition: TPolyMarker3D.h:33
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.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
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.
const char * GetName() const override
Returns name of object.
Definition: TPolyMarker3D.h:56
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
Definition: TPolyMarker3D.h:72
virtual Int_t GetN() const
Definition: TPolyMarker3D.h:57
virtual Int_t GetLastPoint() const
Definition: TPolyMarker3D.h:55
TString fOption
Definition: TPolyMarker3D.h:37
virtual void SetName(const char *name)
Change (i.e.
TPolyMarker3D & operator=(const TPolyMarker3D &)
assignment operator
void Copy(TObject &polymarker) const override
Copy polymarker to polymarker obj.
Option_t * GetOption() const override
Definition: TPolyMarker3D.h:61
void ls(Option_t *option="") const override
List this 3-D polymarker.
virtual Float_t * GetP() const
Definition: TPolyMarker3D.h:58
virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z)
Set point following LastPoint to x, y, z.
void Paint(Option_t *option="") override
Paint a TPolyMarker3D.
Float_t * fP
Definition: TPolyMarker3D.h:36
void Print(Option_t *option="") const override
Print 3-D polymarker with its attributes on stdout.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a 3-D polymarker.
void Draw(Option_t *option="") override
Draws 3-D polymarker with its current attributes.
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