Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGLTF3Painter.h
Go to the documentation of this file.
1// @(#)root/gl:$Id$
2// Author: Timur Pocheptsov 31/08/2006
3
4/*************************************************************************
5 * Copyright (C) 1995-2006, 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_TGLTF3Painter
13#define ROOT_TGLTF3Painter
14
15#include <vector>
16#include <list>
17
18#include "TGLPlotPainter.h"
19#include "TGLIsoMesh.h"
20#include "TGLUtil.h"
21
22class TGLPlotCamera;
23class TF3;
24
25/*
26Draw TF3 using marching cubes.
27*/
28
30private:
31 enum ETF3Style {
36 };
37
39
42
46
47public:
48 TGLTF3Painter(TF3 *fun, TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
49
50 char *GetPlotInfo(Int_t px, Int_t py) override;
51 Bool_t InitGeometry() override;
52 void StartPan(Int_t px, Int_t py) override;
53 void Pan(Int_t px, Int_t py) override;
54 void AddOption(const TString &stringOption) override;
55 void ProcessEvent(Int_t event, Int_t px, Int_t py) override;
56
57private:
58 void InitGL()const override;
59 void DeInitGL()const override;
60
61 void DrawPlot()const override;
62 //
63 void DrawToSelectionBuffer()const;
64 void DrawDefaultPlot()const;
65 void DrawMaplePlot()const;
66 //
67
68 void SetSurfaceColor()const;
69 Bool_t HasSections()const;
70
71 void DrawSectionXOZ()const override;
72 void DrawSectionYOZ()const override;
73 void DrawSectionXOY()const override;
74
75 ClassDefOverride(TGLTF3Painter, 0) // GL TF3 painter.
76};
77
78/*
79 Iso painter draws iso surfaces - "gliso" option for TH3XXX::Draw.
80 Can be one-level iso (as standard non-gl "iso" option),
81 or multi-level iso: equidistant contours (if you only specify
82 number of contours, or at user defined levels).
83*/
84
86private:
88 typedef std::list<Mesh_t> MeshList_t;
89 typedef std::list<Mesh_t>::iterator MeshIter_t;
90 typedef std::list<Mesh_t>::const_iterator ConstMeshIter_t;
91
95
97 //List of meshes.
99 //Cached meshes (will be used if geometry must be rebuilt
100 //after TPad::PaintModified)
102 //Min and max bin contents.
104 //Palette. One color per iso-surface.
106 //Iso levels. Equidistant or user-defined.
107 std::vector<Double_t> fColorLevels;
108 //Now meshes are initialized only once.
109 //To be changed in future.
111
112public:
113 TGLIsoPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
114
115 //TGLPlotPainter final-overriders.
116 char *GetPlotInfo(Int_t px, Int_t py) override;
117 Bool_t InitGeometry() override;
118 void StartPan(Int_t px, Int_t py) override;
119 void Pan(Int_t px, Int_t py) override;
120 void AddOption(const TString &option) override;
121 void ProcessEvent(Int_t event, Int_t px, Int_t py) override;
122
123private:
124 //TGLPlotPainter final-overriders.
125 void InitGL()const override;
126 void DeInitGL()const override;
127
128 void DrawPlot()const override;
129 void DrawSectionXOZ()const override;
130 void DrawSectionYOZ()const override;
131 void DrawSectionXOY()const override;
132 //Auxiliary methods.
133 Bool_t HasSections()const;
134 void SetSurfaceColor(Int_t ind)const;
135 void SetMesh(Mesh_t &mesh, Double_t isoValue);
136 void DrawMesh(const Mesh_t &mesh, Int_t level)const;
137 void FindMinMax();
138
141
142 ClassDefOverride(TGLIsoPainter, 0) // Iso option for TH3.
143};
144
145#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
winID h TVirtualViewer3D TVirtualGLPainter char GetPlotInfo
Option_t Option_t option
A 3-Dim function with parameters.
Definition TF3.h:28
"gliso" option for TH3.
TGLIsoPainter(const TGLIsoPainter &)
TGLTH3Slice fXOZSlice
Bool_t HasSections() const
Any section exists.
MeshList_t fCache
TGLTH3Slice fYOZSlice
void DeInitGL() const override
Initialize OpenGL state variables.
Bool_t InitGeometry() override
Initializes meshes for 3d iso contours.
void DrawMesh(const Mesh_t &mesh, Int_t level) const
Draw TF3 surface.
TGLLevelPalette fPalette
Rgl::Mc::TIsoMesh< Float_t > Mesh_t
void DrawSectionXOY() const override
Draw XOY parallel section.
Rgl::Range_t fMinMax
void DrawSectionXOZ() const override
Draw XOZ parallel section.
void AddOption(const TString &option) override
No additional options for TGLIsoPainter.
std::list< Mesh_t >::iterator MeshIter_t
std::list< Mesh_t > MeshList_t
void FindMinMax()
Find max/min bin contents for TH3.
std::vector< Double_t > fColorLevels
TGLIsoPainter & operator=(const TGLIsoPainter &)
void SetMesh(Mesh_t &mesh, Double_t isoValue)
Grid geometry.
MeshList_t fIsos
void ProcessEvent(Int_t event, Int_t px, Int_t py) override
Change color scheme.
void InitGL() const override
Initialize OpenGL state variables.
void DrawSectionYOZ() const override
Draw YOZ parallel section.
TGLTH3Slice fXOYSlice
void SetSurfaceColor(Int_t ind) const
Set color for surface.
void DrawPlot() const override
Draw mesh.
std::list< Mesh_t >::const_iterator ConstMeshIter_t
void StartPan(Int_t px, Int_t py) override
User clicks right mouse button (in a pad).
void Pan(Int_t px, Int_t py) override
User's moving mouse cursor, with middle mouse button pressed (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,...
Plot-painter for TF3 functions.
Rgl::Mc::TIsoMesh< Double_t > fMesh
void DeInitGL() const override
Initialize OpenGL state variables.
void DrawSectionXOZ() const override
Draw XOZ parallel section.
Bool_t InitGeometry() override
Create mesh.
void DrawSectionYOZ() const override
Draw YOZ parallel section.
void DrawDefaultPlot() const
Surface with material properties and lighting.
void AddOption(const TString &stringOption) override
No options for tf3.
void Pan(Int_t px, Int_t py) override
User's moving mouse cursor, with middle mouse button pressed (for pad).
TGLTH3Slice fXOZSlice
void DrawPlot() const override
Draw mesh.
void InitGL() const override
Initialize OpenGL state variables.
void DrawToSelectionBuffer() const
Draw triangles, no normals, no lighting.
TGLTH3Slice fXOYSlice
void SetSurfaceColor() const
Set color for surface.
ETF3Style fStyle
void ProcessEvent(Int_t event, Int_t px, Int_t py) override
Change color scheme.
void DrawSectionXOY() const override
Draw XOY parallel section.
void DrawMaplePlot() const
Colored surface, without lighting and material properties.
TGLTH3Slice fYOZSlice
void StartPan(Int_t px, Int_t py) override
User clicks right mouse button (in a pad).
Bool_t HasSections() const
Any section exists.
A slice of a TH3.
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