Logo ROOT   6.16/01
Reference Guide
TGLParametric.h
Go to the documentation of this file.
1// @(#)root/gl:$Id$
2// Author: Timur Pocheptsov 26/01/2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, 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_TGLParametric
13#define ROOT_TGLParametric
14
15#include "TGLHistPainter.h"
16#include "TGLUtil.h"
17#include "TAxis.h"
18#include "TF2.h"
19
20#include <memory>
21
22class TString;
23
24//////////////////////////////////////////////////////////////////////////
25// //
26// TGLParametricEquation //
27// //
28// Parametric equations drawing with GL. //
29// //
30//////////////////////////////////////////////////////////////////////////
31
32
34
36private:
37 typedef std::unique_ptr<TF2> Ptr_t;
38
42
44
47
50
51 typedef std::unique_ptr<TGLHistPainter> Painter_t;
52 //C++ compiler do not need TGLhistPainter definition here, but I'm not sure about CINT,
53 //so I've included TGLHistPainter definition.
55
56public:
57 TGLParametricEquation(const TString &name, const TString &xEquation,
58 const TString &yEquation, const TString &zEquation,
59 Double_t uMin, Double_t uMax,
60 Double_t vMin, Double_t vMax);
62 Double_t uMin, Double_t uMax, Double_t vMin, Double_t vMax);
63
66
67 Bool_t IsConstrained()const;
69
70 Bool_t IsModified()const;
71 void SetModified(Bool_t m);
72
73 void EvalVertex(TGLVertex3 &newVertex, Double_t u, Double_t v)const;
74
76 void ExecuteEvent(Int_t event, Int_t px, Int_t py);
77 char *GetObjectInfo(Int_t px, Int_t py) const;
78 void Paint(Option_t *option);
79
80private:
81
84
85 ClassDef(TGLParametricEquation, 0)//Equation of parametric surface.
86};
87
89private:
90 struct Vertex_t {
94 };
95
96 enum EMeshSize {kLow = 30, kHigh = 150};
97
100
103
105
109
111
112public:
114
116 void StartPan(Int_t px, Int_t py);
117 void Pan(Int_t px, Int_t py);
118 char *GetPlotInfo(Int_t px, Int_t py);
119 void AddOption(const TString &option);
120 void ProcessEvent(Int_t event, Int_t px, Int_t py);
121
122private:
123 void InitGL()const;
124 void DeInitGL()const;
125
126 void DrawPlot()const;
127
128 void InitColors();
129
130 void DrawSectionXOZ()const;
131 void DrawSectionYOZ()const;
132 void DrawSectionXOY()const;
133
134 void SetSurfaceColor()const;
135
138
139 ClassDef(TGLParametricPlot, 0)//Parametric plot's painter.
140};
141
142#endif
SVector< double, 2 > v
Definition: Dict.h:5
#define c(i)
Definition: RSha256.hxx:101
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:324
void(* ParametricEquation_t)(TGLVertex3 &, Double_t u, Double_t v)
Definition: TGLParametric.h:33
typedef void((*Func_t)())
Class to manage histogram axis.
Definition: TAxis.h:30
A parametric surface is a surface defined by a parametric equation, involving two parameters (u,...
Definition: TGLParametric.h:35
TGLParametricEquation & operator=(const TGLParametricEquation &)
Rgl::Range_t GetVRange() const
[vMin, vMax]
ParametricEquation_t fEquation
Definition: TGLParametric.h:43
void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Pass event to painter.
void Paint(Option_t *option)
Delegate paint.
Bool_t IsModified() const
Something was changed in parametric equation (or constrained option was changed).
TGLParametricEquation(const TString &name, const TString &xEquation, const TString &yEquation, const TString &zEquation, Double_t uMin, Double_t uMax, Double_t vMin, Double_t vMax)
Surface is defined by three strings.
std::unique_ptr< TGLHistPainter > Painter_t
Definition: TGLParametric.h:51
char * GetObjectInfo(Int_t px, Int_t py) const
No object info yet.
Rgl::Range_t GetURange() const
[uMin, uMax]
Bool_t IsConstrained() const
Check is constrained.
Int_t DistancetoPrimitive(Int_t px, Int_t py)
Check, if parametric surface is under cursor.
Rgl::Range_t fVRange
Definition: TGLParametric.h:46
Rgl::Range_t fURange
Definition: TGLParametric.h:45
void EvalVertex(TGLVertex3 &newVertex, Double_t u, Double_t v) const
Calculate vertex.
void SetConstrained(Bool_t c)
Set constrained.
TGLParametricEquation(const TGLParametricEquation &)
void SetModified(Bool_t m)
Set modified.
std::unique_ptr< TF2 > Ptr_t
Definition: TGLParametric.h:37
TGLParametricPlot(const TGLParametricPlot &)
TGLParametricPlot(TGLParametricEquation *equation, TGLPlotCamera *camera)
Constructor.
void InitColors()
Calculate colors for vertices, using one of 20 color themes.
void DeInitGL() const
Initialize gl state.
Bool_t InitGeometry()
Build mesh.
void AddOption(const TString &option)
No additional options for parametric surfaces.
void InitGL() const
Initialize gl state.
void DrawSectionXOY() const
No such sections.
void DrawSectionYOZ() const
No such sections.
void ProcessEvent(Int_t event, Int_t px, Int_t py)
Change color/mesh size or switch on/off mesh/box cut.
char * GetPlotInfo(Int_t px, Int_t py)
No object info yet.
void Pan(Int_t px, Int_t py)
User's moving mouse cursor, with middle mouse button pressed (for pad).
void DrawPlot() const
Draw parametric surface.
void SetSurfaceColor() const
Set material properties.
TGLPlotCoordinates fCartesianCoord
TGLParametricEquation * fEquation
TGL2DArray< Vertex_t > fMesh
Definition: TGLParametric.h:99
void StartPan(Int_t px, Int_t py)
User clicks right mouse button (in a pad).
TGLParametricPlot & operator=(const TGLParametricPlot &)
void DrawSectionXOZ() const
No such sections.
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,...
3 component (x/y/z) vector class.
Definition: TGLUtil.h:247
3 component (x/y/z) vertex class.
Definition: TGLUtil.h:83
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
Basic string class.
Definition: TString.h:131
std::pair< Double_t, Double_t > Range_t
Definition: TGLUtil.h:1193
auto * m
Definition: textangle.C:8