Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGLH2PolyPainter.h
Go to the documentation of this file.
1#ifndef ROOT_TGLH2PolyPainter
2#define ROOT_TGLH2PolyPainter
3
4#include <vector>
5#include <list>
6
7#include "TGLPlotPainter.h"
8#include "TGLPadUtils.h"
9#include "TString.h"
10
11class TMultiGraph;
12class TGraph;
13
15public:
17
18 char *GetPlotInfo(Int_t px, Int_t py) override;
19 Bool_t InitGeometry() override;
20 void StartPan(Int_t px, Int_t py) override;
21 void Pan(Int_t px, Int_t py) override;
22 void AddOption(const TString &stringOption) override;
23 void ProcessEvent(Int_t event, Int_t px, Int_t py) override;
24
25private:
26 //Overriders
27 void InitGL()const override;
28 void DeInitGL()const override;
29 void DrawPlot()const override;
30 //Aux. functions.
31 //Draw edges of a bin.
32 void DrawExtrusion()const;
33 void DrawExtrusion(const TGraph *polygon, Double_t zMin, Double_t zMax, Int_t nBin)const;
34 void DrawExtrusion(const TMultiGraph *polygon, Double_t zMin, Double_t zMax, Int_t nBin)const;
35
36 //Draw caps for a bin.
37 typedef std::list<Rgl::Pad::Tesselation_t>::const_iterator CIter_t;
38 void DrawCaps()const;
39 void DrawCap(CIter_t cap, Int_t bin, bool bottomCap)const;
40 //
45 //Find the color in palette using bin content.
46 void SetBinColor(Int_t bin)const;
47
48 //Empty overriders.
49 void DrawSectionXOZ()const override;
50 void DrawSectionYOZ()const override;
51 void DrawSectionXOY()const override;
52 void DrawPalette()const;
53 void DrawPaletteAxis()const override;
54
55 //Aux. staff.
56 void FillTemporaryPolygon(const Double_t *xs, const Double_t *ys, Double_t z, Int_t n)const;
57 void MakePolygonCCW()const;
58 Bool_t ClampZ(Double_t &zVal)const;
59
60 TString fBinInfo; //Used by GetPlotInfo.
61
62 std::vector<Int_t> fBinColors;
63
64 mutable std::vector<Double_t> fPolygon; //Temporary array for polygon's vertices.
65 std::list<Rgl::Pad::Tesselation_t> fCaps;//Caps for all bins.
66
67 Bool_t fZLog;//Change in logZ updates only bin heights.
69
70 ClassDefOverride(TGLH2PolyPainter, 0); //Painter class for TH2Poly.
71};
72
73#endif
#define g(i)
Definition RSha256.hxx:105
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
winID h TVirtualViewer3D TVirtualGLPainter char GetPlotInfo
Paint TH2Poly.
void Pan(Int_t px, Int_t py) override
Mouse events handler.
void FillTemporaryPolygon(const Double_t *xs, const Double_t *ys, Double_t z, Int_t n) const
Since I probably have to re-orient polygon, I need a temporary polygon.
void DrawCaps() const
Caps on bins.
void InitGL() const override
Initialize some gl state variables.
void MakePolygonCCW() const
Code taken from the original TH2Poly.
Bool_t InitGeometry() override
Tesselate polygons, if not done yet.
void DeInitGL() const override
Return some gl states to original values.
std::list< Rgl::Pad::Tesselation_t > fCaps
void DrawSectionXOY() const override
No sections.
Bool_t BuildTesselation(Rgl::Pad::Tesselator &tess, const TGraph *g, Double_t z)
Tesselate a polygon described by TGraph.
std::list< Rgl::Pad::Tesselation_t >::const_iterator CIter_t
void DrawPlot() const override
Draw extruded polygons and plot's frame.
void AddOption(const TString &stringOption) override
No additional options.
void DrawCap(CIter_t cap, Int_t bin, bool bottomCap) const
Draw a cap on top of a bin.
void DrawPalette() const
Not yet.
Bool_t UpdateGeometry()
Update cap's z-coordinates for all caps.
std::vector< Double_t > fPolygon
Bool_t ClampZ(Double_t &zVal) const
Clamp z value.
Bool_t CacheGeometry()
Cache all data for TH2Poly object.
void DrawSectionXOZ() const override
No sections.
void SetBinColor(Int_t bin) const
Set bin's color.
void DrawPaletteAxis() const override
Not yet.
void DrawSectionYOZ() const override
No sections.
void ProcessEvent(Int_t event, Int_t px, Int_t py) override
No events.
void DrawExtrusion() const
Extruded part of bins.
std::vector< Int_t > fBinColors
void StartPan(Int_t px, Int_t py) override
User clicks on a lego with middle mouse button (middle for pad).
Camera for TGLPlotPainter and sub-classes.
Helper class for plot-painters holding information about axis ranges, numbers of bins and flags if ce...
Base class for plot-painters that provide GL rendering of various 2D and 3D histograms,...
A TGraph is an object made of two arrays X and Y with npoints each.
Definition TGraph.h:41
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:59
A TMultiGraph is a collection of TGraph (or derived) objects.
Definition TMultiGraph.h:34
Basic string class.
Definition TString.h:139
const Int_t n
Definition legend1.C:16