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);
70 void StartPan(Int_t px, Int_t py);
71 void Pan(Int_t px, Int_t py);
72 void AddOption(const TString &stringOption);
73 void ProcessEvent(Int_t event, Int_t px, Int_t py);
74
75private:
76 void InitGL()const;
77 void DeInitGL()const;
78
79 void DrawPlot()const;
80
81 void SetNormals();
82 void SetSurfaceColor()const;
83
88
89 void DrawProjections()const;
90 void DrawSectionXOZ()const;
91 void DrawSectionYOZ()const;
92 void DrawSectionXOY()const;
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;
108
110
111 ClassDef(TGLSurfacePainter, 0)//Surface painter.
112};
113
114#endif
unsigned char UChar_t
Definition RtypesCore.h:38
double Double_t
Definition RtypesCore.h:59
#define ClassDef(name, id)
Definition Rtypes.h:325
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 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.
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
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:58
This is the base class for the ROOT Random number generators.
Definition TRandom.h:27
Basic string class.
Definition TString.h:136
#define Swap(a, b)
Definition geom.c:201
std::pair< Double_t, Double_t > Range_t
Definition TGLUtil.h:1195
std::vector< TGLVertex3 > fVertices