Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGLSurfacePainter.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_TGLSurfacePainter
13#define ROOT_TGLSurfacePainter
14
15#include <vector>
16#include <list>
17#include <utility>
18
19#include "TGLPlotPainter.h"
20#include "TString.h"
21#include "TGLUtil.h"
22
23class TRandom;
24
26private:
33 kSurf5
34 };
35
37
42
44
45 struct Projection_t {
47 std::vector<TGLVertex3> fVertices;
48 void Swap(Projection_t &rhs);
49 };
50
52
53 mutable std::list<Projection_t> fXOZProj;
54 mutable std::list<Projection_t> fYOZProj;
55 mutable std::list<Projection_t> fXOYProj;
56
58 mutable std::vector<Double_t> fColorLevels;
60
63
64public:
66
67 //TGLPlotPainter's final-overriders.
68 char *GetPlotInfo(Int_t px, Int_t py) override;
69 Bool_t InitGeometry() override;
70 void StartPan(Int_t px, Int_t py) override;
71 void Pan(Int_t px, Int_t py) override;
72 void AddOption(const TString &stringOption) override;
73 void ProcessEvent(Int_t event, Int_t px, Int_t py) override;
74
75private:
76 void InitGL()const override;
77 void DeInitGL()const override;
78
79 void DrawPlot()const override;
80
81 void SetNormals();
82 void SetSurfaceColor()const;
83
88
89 void DrawProjections()const;
90 void DrawSectionXOZ()const override;
91 void DrawSectionYOZ()const override;
92 void DrawSectionXOY()const override;
93
94 void ClampZ(Double_t &zVal)const;
95
96 char *WindowPointTo3DPoint(Int_t px, Int_t py)const;
97
99 void GenTexMap()const;
100 void DrawContoursProjection()const;
101
102 Bool_t Textured()const;
103 Bool_t HasSections()const;
104 Bool_t HasProjections()const;
105
106 void DrawPalette()const;
107 void DrawPaletteAxis()const override;
108
110
112};
113
114#endif
unsigned char UChar_t
Definition RtypesCore.h:38
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
winID h TVirtualViewer3D TVirtualGLPainter char GetPlotInfo
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,...
Implements painting of TH2 with "SURF" option.
char * WindowPointTo3DPoint(Int_t px, Int_t py) const
Find 3d coords using mouse cursor coords.
void Pan(Int_t px, Int_t py) override
User's moving mouse cursor, with middle mouse button pressed (for pad).
void InitGL() const override
Initialize some OpenGL state variables.
TGLLevelPalette fPalette
TGL2DArray< Double_t > fTexMap
void ProcessEvent(Int_t event, Int_t px, Int_t py) override
Remove all profiles/sections.
Bool_t InitGeometryPolar()
Find bin ranges for X and Y axes, axes ranges for X, Y and Z.
void AddOption(const TString &stringOption) override
Additional options for surfaces.
void DrawProjections() const
Draw projections.
Bool_t HasProjections() const
Any projection exists.
Bool_t Textured() const
Checks, if surf requires texture.
void DrawSectionXOY() const override
Draw section Z.
std::list< Projection_t > fXOYProj
void DrawPalette() const
Draw.
TGL2DArray< TGLVector3 > fAverageNormals
std::vector< Double_t > fColorLevels
void SetSurfaceColor() const
Set color for surface.
void DrawPaletteAxis() const override
Draw. Palette. Axis.
void DrawSectionXOZ() const override
Draw section X.
void DrawPlot() const override
Draw surf/surf1/surf2/surf4.
void DeInitGL() const override
Initialize some OpenGL state variables.
void DrawSectionYOZ() const override
Draw section Y.
TGL2DArray< std::pair< TGLVector3, TGLVector3 > > fFaceNormals
void DrawContoursProjection() const
Draw flat textured surface.
std::list< Projection_t > fXOZProj
Bool_t InitGeometrySpherical()
Find bin ranges for X and Y axes, axes ranges for X, Y and Z.
void ClampZ(Double_t &zVal) const
Clamp z value.
TGL2DArray< TGLVertex3 > fMesh
Bool_t InitGeometryCartesian()
Find bin ranges for X and Y axes, axes ranges for X, Y and Z.
Bool_t PreparePalette() const
Generate palette.
Bool_t InitGeometry() override
Set mesh, normals.
static TRandom * fgRandom
void GenTexMap() const
Find texture coordinates.
void SetNormals()
One normal per vertex; this normal is average of neighbouring triangles normals.
void StartPan(Int_t px, Int_t py) override
User clicks right mouse button (in a pad).
Bool_t InitGeometryCylindrical()
Find bin ranges for X and Y axes, axes ranges for X, Y and Z.
std::list< Projection_t > fYOZProj
Bool_t HasSections() const
Any section exists.
Rgl::Range_t fMinMaxVal
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:59
This is the base class for the ROOT Random number generators.
Definition TRandom.h:27
Basic string class.
Definition TString.h:139
#define Swap(a, b)
Definition geom.c:201
std::pair< Double_t, Double_t > Range_t
Definition TGLUtil.h:1202
std::vector< TGLVertex3 > fVertices