Logo ROOT   6.16/01
Reference Guide
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
18#include "TGLPlotPainter.h"
19#include "TString.h"
20#include "TGLUtil.h"
21
22class TRandom;
23
25private:
32 kSurf5
33 };
34
36
41
43
44 struct Projection_t {
46 std::vector<TGLVertex3> fVertices;
47 void Swap(Projection_t &rhs);
48 };
49
51
52 mutable std::list<Projection_t> fXOZProj;
53 mutable std::list<Projection_t> fYOZProj;
54 mutable std::list<Projection_t> fXOYProj;
55
57 mutable std::vector<Double_t> fColorLevels;
59
62
63public:
65
66 //TGLPlotPainter's final-overriders.
67 char *GetPlotInfo(Int_t px, Int_t py);
69 void StartPan(Int_t px, Int_t py);
70 void Pan(Int_t px, Int_t py);
71 void AddOption(const TString &stringOption);
72 void ProcessEvent(Int_t event, Int_t px, Int_t py);
73
74private:
75 void InitGL()const;
76 void DeInitGL()const;
77
78 void DrawPlot()const;
79
80 void SetNormals();
81 void SetSurfaceColor()const;
82
87
88 void DrawProjections()const;
89 void DrawSectionXOZ()const;
90 void DrawSectionYOZ()const;
91 void DrawSectionXOY()const;
92
93 void ClampZ(Double_t &zVal)const;
94
95 char *WindowPointTo3DPoint(Int_t px, Int_t py)const;
96
98 void GenTexMap()const;
99 void DrawContoursProjection()const;
100
101 Bool_t Textured()const;
102 Bool_t HasSections()const;
103 Bool_t HasProjections()const;
104
105 void DrawPalette()const;
106 void DrawPaletteAxis()const;
107
109
110 ClassDef(TGLSurfacePainter, 0)//Surface painter.
111};
112
113#endif
int Int_t
Definition: RtypesCore.h:41
unsigned char UChar_t
Definition: RtypesCore.h:34
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
#define ClassDef(name, id)
Definition: Rtypes.h:324
Camera for TGLPlotPainter and sub-classes.
Definition: TGLPlotCamera.h:22
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 DrawPlot() const
Draw surf/surf1/surf2/surf4.
TGLLevelPalette fPalette
TGL2DArray< Double_t > fTexMap
Bool_t InitGeometryPolar()
Find bin ranges for X and Y axes, axes ranges for X, Y and Z.
void DrawSectionXOY() const
Draw section Z.
void DeInitGL() const
Initialize some OpenGL state variables.
void DrawProjections() const
Draw projections.
Bool_t HasProjections() const
Any projection exists.
Bool_t Textured() const
Checks, if surf requires texture.
std::list< Projection_t > fXOYProj
Bool_t InitGeometry()
Set mesh, normals.
void DrawPalette() const
Draw.
TGL2DArray< TGLVector3 > fAverageNormals
std::vector< Double_t > fColorLevels
void StartPan(Int_t px, Int_t py)
User clicks right mouse button (in a pad).
void SetSurfaceColor() const
Set color for surface.
char * GetPlotInfo(Int_t px, Int_t py)
Coords for point on surface under cursor.
TGL2DArray< std::pair< TGLVector3, TGLVector3 > > fFaceNormals
void DrawContoursProjection() const
Draw flat textured surface.
void InitGL() const
Initialize some OpenGL state variables.
std::list< Projection_t > fXOZProj
void ProcessEvent(Int_t event, Int_t px, Int_t py)
Remove all profiles/sections.
void DrawSectionYOZ() const
Draw section Y.
Bool_t InitGeometrySpherical()
Find bin ranges for X and Y axes, axes ranges for X, Y and Z.
void AddOption(const TString &stringOption)
Additional options for surfaces.
TGLSurfacePainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord)
Constructor.
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.
void Pan(Int_t px, Int_t py)
User's moving mouse cursor, with middle mouse button pressed (for pad).
static TRandom * fgRandom
void GenTexMap() const
Find texture coordinates.
void DrawSectionXOZ() const
Draw section X.
void SetNormals()
One normal per vertex; this normal is average of neighbouring triangles normals.
Bool_t InitGeometryCylindrical()
Find bin ranges for X and Y axes, axes ranges for X, Y and Z.
std::list< Projection_t > fYOZProj
void DrawPaletteAxis() const
Draw. Palette. Axis.
Bool_t HasSections() const
Any section exists.
Rgl::Range_t fMinMaxVal
The TH1 histogram class.
Definition: TH1.h:56
This is the base class for the ROOT Random number generators.
Definition: TRandom.h:27
Basic string class.
Definition: TString.h:131
std::pair< Double_t, Double_t > Range_t
Definition: TGLUtil.h:1193
void Swap(Projection_t &rhs)
Constructor.
std::vector< TGLVertex3 > fVertices