Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGLLegoPainter.h
Go to the documentation of this file.
1// @(#)root/gl:$Id$
2// Author: Timur Pocheptsov 14/06/2006
3
4/*************************************************************************
5 * Copyright (C) 1995-2004, 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_TGLLegoPainter
13#define ROOT_TGLLegoPainter
14
15#include "TGLPlotPainter.h"
16#include "TGLQuadric.h"
17#include "TGLUtil.h"
18#include "TString.h"
19
20#include <vector>
21#include <utility>
22
23class TGLPlotCamera;
24class TAxis;
25class TH1;
26
27/*
28 TGLLegoPainter. The concrete implementation of abstract TGLPlotPainter.
29*/
30
32private:
33
34 enum ELegoType {
38 };
39 //Bars, cylinders or textured bars.
42 Rgl::Range_t fMinMaxVal;//For texture coordinates generation.
43
44 std::vector<Rgl::Range_t> fXEdges;
45 std::vector<Rgl::Range_t> fYEdges;
46
47 typedef std::pair<Double_t, Double_t> CosSin_t;
48 std::vector<CosSin_t> fCosSinTableX;
49 std::vector<CosSin_t> fCosSinTableY;
53
55 mutable std::vector<Double_t> fColorLevels;
56
59
60public:
61 TGLLegoPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
62
63 //TGLPlotPainter's final-overriders
64 char *GetPlotInfo(Int_t px, Int_t py) override;
65 Bool_t InitGeometry() override;
66 void StartPan(Int_t px, Int_t py) override;
67 void Pan(Int_t px, Int_t py) override;
68 void AddOption(const TString &stringOption) override;
69 void ProcessEvent(Int_t event, Int_t px, Int_t py) override;
70
71private:
72 //Auxilary functions.
77 //Overriders
78 void InitGL()const override;
79 void DeInitGL()const override;
80
81 void DrawPlot()const override;
82
83 void DrawLegoCartesian()const;
84 void DrawLegoPolar()const;
85 void DrawLegoCylindrical()const;
86 void DrawLegoSpherical()const;
87
88 void SetLegoColor()const;
89
90 void DrawSectionXOZ()const override;
91 void DrawSectionYOZ()const override;
92 void DrawSectionXOY()const override;
93
94 Bool_t ClampZ(Double_t &zVal)const;
96
97 void DrawPalette()const;
98 void DrawPaletteAxis()const override;
99
101};
102
103#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
winID h TVirtualViewer3D TVirtualGLPainter char GetPlotInfo
Class to manage histogram axis.
Definition TAxis.h:31
Plot-painter implementing LEGO rendering of TH2 histograms in cartesian, polar, cylindrical and spher...
Bool_t InitGeometryCartesian()
Geometry for lego in cartesian coords.
Bool_t PreparePalette() const
Initialize color palette.
void DrawSectionXOZ() const override
XOZ plane parallel section.
void DrawSectionXOY() const override
Empty. No such sections for lego.
void DrawLegoSpherical() const
Lego in spherical system.
std::vector< Rgl::Range_t > fXEdges
void StartPan(Int_t px, Int_t py) override
User clicks on a lego with middle mouse button (middle for pad).
Bool_t InitGeometryCylindrical()
Geometry for lego in cylindrical coords.
void AddOption(const TString &stringOption) override
Parse additional options.
TGLLevelPalette fPalette
void InitGL() const override
Initialize some gl state variables.
void DrawLegoPolar() const
Lego in polar system.
void DrawSectionYOZ() const override
YOZ plane parallel section.
void Pan(Int_t px, Int_t py) override
Move lego or section.
Bool_t ClampZ(Double_t &zVal) const
Clamp z value.
Bool_t InitGeometrySpherical()
Geometry for lego in spherical coords.
void DrawPlot() const override
Select method corresponding to coordinate system.
TGLLegoPainter & operator=(const TGLLegoPainter &)
TGLQuadric fQuadric
TGLLegoPainter(const TGLLegoPainter &)
void DrawPalette() const
Draw.
void DrawLegoCartesian() const
Lego in cartesian system.
void SetLegoColor() const
Set lego's color.
std::vector< Rgl::Range_t > fYEdges
std::vector< CosSin_t > fCosSinTableX
std::pair< Double_t, Double_t > CosSin_t
Rgl::Range_t fMinMaxVal
void DeInitGL() const override
Return some gl states to original values.
void DrawLegoCylindrical() const
Lego in cylindrical system.
std::vector< CosSin_t > fCosSinTableY
Bool_t InitGeometryPolar()
Geometry for lego in polar coords.
void ProcessEvent(Int_t event, Int_t px, Int_t py) override
Remove all sections and repaint.
ELegoType fLegoType
Bool_t InitGeometry() override
Select method.
std::vector< Double_t > fColorLevels
void DrawPaletteAxis() const override
Draw. Palette. Axis.
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,...
Wrapper class for GLU quadric shape drawing object.
Definition TGLQuadric.h:28
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:58
Basic string class.
Definition TString.h:139
std::pair< Double_t, Double_t > Range_t
Definition TGLUtil.h:1202