Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
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;
53
54public:
55 TGLParametricEquation(const TString &name, const TString &xEquation,
56 const TString &yEquation, const TString &zEquation,
57 Double_t uMin, Double_t uMax,
58 Double_t vMin, Double_t vMax);
60 Double_t uMin, Double_t uMax, Double_t vMin, Double_t vMax);
61
64
65 Bool_t IsConstrained()const;
67
68 Bool_t IsModified()const;
69 void SetModified(Bool_t m);
70
71 void EvalVertex(TGLVertex3 &newVertex, Double_t u, Double_t v)const;
72
73 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
74 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
75 char *GetObjectInfo(Int_t px, Int_t py) const override;
76 void Paint(Option_t *option) override;
77
78private:
79
82
83 ClassDefOverride(TGLParametricEquation, 0)//Equation of parametric surface.
84};
85
87private:
93
94 enum EMeshSize {kLow = 30, kHigh = 150};
95
98
101
103
107
109
110public:
112
113 Bool_t InitGeometry() override;
114 void StartPan(Int_t px, Int_t py) override;
115 void Pan(Int_t px, Int_t py) override;
116 char *GetPlotInfo(Int_t px, Int_t py) override;
117 void AddOption(const TString &option) override;
118 void ProcessEvent(Int_t event, Int_t px, Int_t py) override;
119
120private:
121 void InitGL()const override;
122 void DeInitGL()const override;
123
124 void DrawPlot()const override;
125
126 void InitColors();
127
128 void DrawSectionXOZ()const override;
129 void DrawSectionYOZ()const override;
130 void DrawSectionXOY()const override;
131
132 void SetSurfaceColor()const;
133
136
137 ClassDefOverride(TGLParametricPlot, 0)//Parametric plot's painter.
138};
139
140#endif
#define c(i)
Definition RSha256.hxx:101
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
bool Bool_t
Boolean (0=false, 1=true) (bool).
Definition RtypesCore.h:77
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
float Float_t
Float 4 bytes (float).
Definition RtypesCore.h:71
const char Option_t
Option string (const char).
Definition RtypesCore.h:80
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
void(* ParametricEquation_t)(TGLVertex3 &, Double_t u, Double_t v)
char name[80]
Definition TGX11.cxx:148
Class to manage histogram axis.
Definition TAxis.h:32
A parametric surface is a surface defined by a parametric equation, involving two parameters (u,...
TGLParametricEquation & operator=(const TGLParametricEquation &)
Rgl::Range_t GetVRange() const
[vMin, vMax]
ParametricEquation_t fEquation
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
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Check, if parametric surface is under cursor.
char * GetObjectInfo(Int_t px, Int_t py) const override
No object info yet.
Rgl::Range_t GetURange() const
[uMin, uMax]
Bool_t IsConstrained() const
Check is constrained.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Pass event to painter.
void Paint(Option_t *option) override
Delegate paint.
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
TGLParametricPlot(const TGLParametricPlot &)
TGLParametricPlot(TGLParametricEquation *equation, TGLPlotCamera *camera)
Constructor.
void ProcessEvent(Int_t event, Int_t px, Int_t py) override
Change color/mesh size or switch on/off mesh/box cut.
void InitColors()
Calculate colors for vertices, using one of 20 color themes.
void InitGL() const override
Initialize gl state.
Bool_t InitGeometry() override
Build mesh.
void DrawSectionXOY() const override
No such sections.
void DrawSectionYOZ() const override
No such sections.
void DeInitGL() const override
Initialize gl state.
void SetSurfaceColor() const
Set material properties.
TGLPlotCoordinates fCartesianCoord
char * GetPlotInfo(Int_t px, Int_t py) override
No object info yet.
TGLParametricEquation * fEquation
void AddOption(const TString &option) override
No additional options for parametric surfaces.
TGL2DArray< Vertex_t > fMesh
void StartPan(Int_t px, Int_t py) override
User clicks right mouse button (in a pad).
void DrawPlot() const override
Draw parametric surface.
void DrawSectionXOZ() const override
No such sections.
TGLParametricPlot & operator=(const TGLParametricPlot &)
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...
TGLPlotPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord, Bool_t xoySelectable, Bool_t xozSelectable, Bool_t yozSelectable)
TGLPlotPainter's ctor.
3 component (x/y/z) vector class.
Definition TGLUtil.h:248
3 component (x/y/z) vertex class.
Definition TGLUtil.h:84
TNamed()
Definition TNamed.h:38
Basic string class.
Definition TString.h:138
std::pair< Double_t, Double_t > Range_t
Definition TGLUtil.h:1202
TMarker m
Definition textangle.C:8