Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGLParametricEquationGL.cxx
Go to the documentation of this file.
1// @(#)root/gl:$Id$
2// Author: Matevz Tadel, Jun 2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2007, 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
13
14#include "TGLParametric.h"
15
16#include "TGLSurfacePainter.h"
17#include "TGLTF3Painter.h"
18
19#include "TGLRnrCtx.h"
20#include "TGLIncludes.h"
21
22/** \class TGLParametricEquationGL
23\ingroup opengl
24GL-renderer wrapper for TGLParametricEquation.
25This allows rendering of parametric-equations in standard GL viewer.
26*/
27
29
30////////////////////////////////////////////////////////////////////////////////
31/// Constructor.
32
36
37////////////////////////////////////////////////////////////////////////////////
38/// Destructor.
39
43
44////////////////////////////////////////////////////////////////////////////////
45/// Set model object.
46
48{
50
51 SetPainter( new TGLParametricPlot(fM, nullptr) );
52 TString option(opt);
53 fPlotPainter->AddOption(option);
54 fPlotPainter->InitGeometry();
55
56 return kTRUE;
57}
58
59////////////////////////////////////////////////////////////////////////////////
60/// Setup bounding-box.
61
63{
64 fBoundingBox.Set(fPlotPainter->RefBackBox().Get3DBox());
65}
66
67////////////////////////////////////////////////////////////////////////////////
68/// Render the object.
69
71{
72 fPlotPainter->RefBackBox().FindFrontPoint();
73 glPushAttrib(GL_ENABLE_BIT | GL_LIGHTING_BIT);
74 glEnable(GL_NORMALIZE);
75 fPlotPainter->InitGL();
76 fPlotPainter->DrawPlot();
77 glPopAttrib();
78}
bool Bool_t
Definition RtypesCore.h:63
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:377
Option_t Option_t option
TGLBoundingBox fBoundingBox
Also plays the role of ID.
TT * SetModelDynCast(TObject *obj)
Definition TGLObject.h:37
GL-renderer wrapper for TGLParametricEquation.
TGLParametricEquation * fM
void SetBBox() override
Setup bounding-box.
void DirectDraw(TGLRnrCtx &rnrCtx) const override
Render the object.
~TGLParametricEquationGL() override
Destructor.
Bool_t SetModel(TObject *obj, const Option_t *opt=nullptr) override
Set model object.
TGLPlot3D(const TGLPlot3D &)=delete
TGLPlotPainter * fPlotPainter
Definition TGLPlot3D.h:29
void SetPainter(TGLPlotPainter *p)
Set painter object and destroy the old one.
Definition TGLPlot3D.cxx:52
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Definition TGLRnrCtx.h:41
Mother of all ROOT objects.
Definition TObject.h:41
Basic string class.
Definition TString.h:139