Logo ROOT  
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 
22 class TString;
23 
24 //////////////////////////////////////////////////////////////////////////
25 // //
26 // TGLParametricEquation //
27 // //
28 // Parametric equations drawing with GL. //
29 // //
30 //////////////////////////////////////////////////////////////////////////
31 
32 
34 
35 class TGLParametricEquation : public TNamed {
36 private:
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 
56 public:
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 
64  Rgl::Range_t GetURange()const;
65  Rgl::Range_t GetVRange()const;
66 
67  Bool_t IsConstrained()const;
68  void SetConstrained(Bool_t c);
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 
80 private:
81 
84 
85  ClassDef(TGLParametricEquation, 0)//Equation of parametric surface.
86 };
87 
89 private:
90  struct Vertex_t {
94  };
95 
96  enum EMeshSize {kLow = 30, kHigh = 150};
97 
100 
103 
105 
109 
111 
112 public:
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 
122 private:
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
c
#define c(i)
Definition: RSha256.hxx:119
TGLParametricEquation::SetModified
void SetModified(Bool_t m)
Set modified.
Definition: TGLParametric.cxx:229
TGLParametricPlot::fMeshSize
Int_t fMeshSize
Definition: TGLParametric.h:98
TGLParametricEquation::GetObjectInfo
char * GetObjectInfo(Int_t px, Int_t py) const
No object info yet.
Definition: TGLParametric.cxx:272
m
auto * m
Definition: textangle.C:8
TGLParametricEquation::fPainter
Painter_t fPainter
Definition: TGLParametric.h:54
TAxis
Class to manage histogram axis.
Definition: TAxis.h:30
TGLParametricPlot::kLow
@ kLow
Definition: TGLParametric.h:96
TGLParametricPlot::fCartesianYAxis
TAxis fCartesianYAxis
Definition: TGLParametric.h:107
TGLPlotPainter
Definition: TGLPlotPainter.h:181
TGLParametricPlot::DrawSectionXOY
void DrawSectionXOY() const
No such sections.
Definition: TGLParametric.cxx:674
TGLParametricPlot::operator=
TGLParametricPlot & operator=(const TGLParametricPlot &)
TGLParametricPlot::Pan
void Pan(Int_t px, Int_t py)
User's moving mouse cursor, with middle mouse button pressed (for pad).
Definition: TGLParametric.cxx:430
TGLParametricPlot::GetPlotInfo
char * GetPlotInfo(Int_t px, Int_t py)
No object info yet.
Definition: TGLParametric.cxx:454
TGLParametricEquation::Painter_t
std::unique_ptr< TGLHistPainter > Painter_t
Definition: TGLParametric.h:51
TGLParametricPlot
Definition: TGLParametric.h:88
TGLParametricPlot::fCartesianXAxis
TAxis fCartesianXAxis
Definition: TGLParametric.h:106
Float_t
float Float_t
Definition: RtypesCore.h:57
TGLParametricEquation::GetURange
Rgl::Range_t GetURange() const
[uMin, uMax]
Definition: TGLParametric.cxx:189
TGLParametricPlot::fCartesianCoord
TGLPlotCoordinates fCartesianCoord
Definition: TGLParametric.h:110
TGLParametricEquation::TGLParametricEquation
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.
Definition: TGLParametric.cxx:123
TGLParametricPlot::EMeshSize
EMeshSize
Definition: TGLParametric.h:96
TGLParametricEquation::Paint
void Paint(Option_t *option)
Delegate paint.
Definition: TGLParametric.cxx:281
TString
Definition: TString.h:136
v
@ v
Definition: rootcling_impl.cxx:3635
TGLParametricEquation::EvalVertex
void EvalVertex(TGLVertex3 &newVertex, Double_t u, Double_t v) const
Calculate vertex.
Definition: TGLParametric.cxx:237
TGLParametricPlot::DrawSectionYOZ
void DrawSectionYOZ() const
No such sections.
Definition: TGLParametric.cxx:667
TGLPlotCoordinates
Definition: TGLPlotPainter.h:310
TGLParametricEquation::fXEquation
Ptr_t fXEquation
Definition: TGLParametric.h:39
TGLParametricPlot::fCartesianZAxis
TAxis fCartesianZAxis
Definition: TGLParametric.h:108
bool
Rgl::Range_t
std::pair< Double_t, Double_t > Range_t
Definition: TGLUtil.h:1195
TGLParametricEquation::fVRange
Rgl::Range_t fVRange
Definition: TGLParametric.h:46
TGL2DArray
Definition: TGLUtil.h:1154
TGLParametricEquation::fURange
Rgl::Range_t fURange
Definition: TGLParametric.h:45
TGLParametricPlot::fMesh
TGL2DArray< Vertex_t > fMesh
Definition: TGLParametric.h:99
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TF2.h
TGLParametricEquation
Definition: TGLParametric.h:35
TGLParametricPlot::Vertex_t::fRGBA
Float_t fRGBA[4]
Definition: TGLParametric.h:93
TGLParametricPlot::fShowMesh
Bool_t fShowMesh
Definition: TGLParametric.h:101
ParametricEquation_t
void(* ParametricEquation_t)(TGLVertex3 &, Double_t u, Double_t v)
Definition: TGLParametric.h:33
TGLVector3
Definition: TGLUtil.h:247
TGLPlotCamera
Definition: TGLPlotCamera.h:21
TNamed
Definition: TNamed.h:29
TGLParametricEquation::fZEquation
Ptr_t fZEquation
Definition: TGLParametric.h:41
TGLParametricPlot::kHigh
@ kHigh
Definition: TGLParametric.h:96
TGLParametricEquation::IsModified
Bool_t IsModified() const
Something was changed in parametric equation (or constrained option was changed).
Definition: TGLParametric.cxx:221
TGLHistPainter.h
TGLParametricPlot::DrawSectionXOZ
void DrawSectionXOZ() const
No such sections.
Definition: TGLParametric.cxx:660
TGLParametricEquation::GetVRange
Rgl::Range_t GetVRange() const
[vMin, vMax]
Definition: TGLParametric.cxx:197
TGLParametricPlot::AddOption
void AddOption(const TString &option)
No additional options for parametric surfaces.
Definition: TGLParametric.cxx:463
TGLParametricEquation::IsConstrained
Bool_t IsConstrained() const
Check is constrained.
Definition: TGLParametric.cxx:205
TGLParametricPlot::fEquation
TGLParametricEquation * fEquation
Definition: TGLParametric.h:104
TGLParametricPlot::Vertex_t::fNormal
TGLVector3 fNormal
Definition: TGLParametric.h:92
TGLParametricPlot::Vertex_t
Definition: TGLParametric.h:90
TGLParametricPlot::SetSurfaceColor
void SetSurfaceColor() const
Set material properties.
Definition: TGLParametric.cxx:681
void
typedef void((*Func_t)())
TGLParametricPlot::TGLParametricPlot
TGLParametricPlot(TGLParametricEquation *equation, TGLPlotCamera *camera)
Constructor.
Definition: TGLParametric.cxx:297
TGLParametricPlot::DrawPlot
void DrawPlot() const
Draw parametric surface.
Definition: TGLParametric.cxx:527
TGLParametricEquation::operator=
TGLParametricEquation & operator=(const TGLParametricEquation &)
TGLParametricEquation::fEquation
ParametricEquation_t fEquation
Definition: TGLParametric.h:43
TGLParametricEquation::fYEquation
Ptr_t fYEquation
Definition: TGLParametric.h:40
TGLParametricEquation::fModified
Bool_t fModified
Definition: TGLParametric.h:49
TGLParametricEquation::ExecuteEvent
void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Pass event to painter.
Definition: TGLParametric.cxx:263
Double_t
double Double_t
Definition: RtypesCore.h:59
TGLParametricPlot::InitColors
void InitColors()
Calculate colors for vertices, using one of 20 color themes.
Definition: TGLParametric.cxx:640
TGLParametricPlot::Vertex_t::fPos
TGLVertex3 fPos
Definition: TGLParametric.h:91
TAxis.h
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGLParametricPlot::DeInitGL
void DeInitGL() const
Initialize gl state.
Definition: TGLParametric.cxx:515
name
char name[80]
Definition: TGX11.cxx:110
TGLParametricPlot::InitGeometry
Bool_t InitGeometry()
Build mesh.
Definition: TGLParametric.cxx:321
TGLUtil.h
TGLParametricPlot::fColorScheme
Int_t fColorScheme
Definition: TGLParametric.h:102
TGLParametricPlot::InitGL
void InitGL() const
Initialize gl state.
Definition: TGLParametric.cxx:503
TGLParametricPlot::ProcessEvent
void ProcessEvent(Int_t event, Int_t px, Int_t py)
Change color/mesh size or switch on/off mesh/box cut.
Definition: TGLParametric.cxx:471
TGLParametricEquation::DistancetoPrimitive
Int_t DistancetoPrimitive(Int_t px, Int_t py)
Check, if parametric surface is under cursor.
Definition: TGLParametric.cxx:253
TGLParametricEquation::fConstrained
Bool_t fConstrained
Definition: TGLParametric.h:48
TGLParametricEquation::Ptr_t
std::unique_ptr< TF2 > Ptr_t
Definition: TGLParametric.h:37
TGLParametricEquation::SetConstrained
void SetConstrained(Bool_t c)
Set constrained.
Definition: TGLParametric.cxx:213
TGLVertex3
Definition: TGLUtil.h:83
TGLParametricPlot::StartPan
void StartPan(Int_t px, Int_t py)
User clicks right mouse button (in a pad).
Definition: TGLParametric.cxx:418
int