Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TH3GL.cxx
Go to the documentation of this file.
1// @(#)root/gl:$Id$
2// Author: Matevz Tadel 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#include "TH3GL.h"
12#include "TH3.h"
13#include "TAxis.h"
14
15#include "TGLSurfacePainter.h"
16#include "TGLHistPainter.h"
17#include "TGLLegoPainter.h"
18#include "TGLBoxPainter.h"
19#include "TGLTF3Painter.h"
20#include "TGLAxisPainter.h"
21#include "TGLPhysicalShape.h"
22#include "TGLCamera.h"
23#include "TPolyMarker3D.h"
24
25#include "TGLRnrCtx.h"
26#include "TGLIncludes.h"
27
28/** \class TH3GL
29\ingroup opengl
30OpenGL renderer class for TH3.
31*/
32
33
34////////////////////////////////////////////////////////////////////////////////
35/// Constructor.
36
38 TGLPlot3D(), fM(nullptr)
39{
40}
41
42////////////////////////////////////////////////////////////////////////////////
43/// Constructor.
44
51
52////////////////////////////////////////////////////////////////////////////////
53/// Destructor.
54
56{
57}
58
59////////////////////////////////////////////////////////////////////////////////
60/// Set model object.
61
63{
64 TString option(opt);
65 option.ToLower();
66
68
69 if (option.Index("iso") != kNPOS)
70 SetPainter( new TGLIsoPainter(fM, nullptr, &fCoord) );
71 else if (option.Index("box") != kNPOS)
72 SetPainter( new TGLBoxPainter(fM, nullptr, &fCoord) );
73 else {
74 Warning("SetModel", "Option '%s' not supported, assuming 'box'.", option.Data());
75 SetPainter( new TGLBoxPainter(fM, nullptr, &fCoord) );
76 }
77
79
80 Ssiz_t pos = option.Index("fb");
81 if (pos != kNPOS) {
82 option.Remove(pos, 2);
84 }
85
86 pos = option.Index("bb");
87 if (pos != kNPOS)
89
90 pos = option.Index("a");
91 if (pos != kNPOS)
93
94
96
97 return kTRUE;
98}
99
100////////////////////////////////////////////////////////////////////////////////
101/// Set bounding box.
102
104{
106}
107
108////////////////////////////////////////////////////////////////////////////////
109/// Render with OpenGL.
110
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
Definition RtypesCore.h:131
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Definition TError.cxx:252
Option_t Option_t option
Painter class for axes encompassing a 3D box.
void Set(const TGLVertex3 vertex[8])
Set a bounding box from provided 8 vertices.
Paints TH3 histograms by rendering variable-sized boxes matching the bin contents.
"gliso" option for TH3.
TGLBoundingBox fBoundingBox
Also plays the role of ID.
TGLPhysicalShape * fFirstPhysical
physical instance ref counting
const Float_t * Color() const
Description of TGLPlot3D.
Definition TGLPlot3D.h:23
TGLPlotCoordinates fCoord
Definition TGLPlot3D.h:30
TGLPlotPainter * fPlotPainter
Definition TGLPlot3D.h:29
void SetPainter(TGLPlotPainter *p)
Set painter object and destroy the old one.
Definition TGLPlot3D.cxx:51
const TGLPlotBox & RefBackBox() const
void SetDrawAxes(Bool_t s)
virtual void DrawPlot() const =0
virtual Bool_t InitGeometry()=0
void SetDrawBackBox(Bool_t b)
void SetDrawFrontBox(Bool_t b)
virtual void InitGL() const =0
void SetPhysicalShapeColor(const Float_t *rgba)
virtual void AddOption(const TString &stringOption)=0
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Definition TGLRnrCtx.h:41
~TH3GL() override
Destructor.
Definition TH3GL.cxx:55
TH3 * fM
Definition TH3GL.h:33
TH3GL()
Constructor.
Definition TH3GL.cxx:37
Bool_t SetModel(TObject *obj, const Option_t *opt=nullptr) override
Set model object.
Definition TH3GL.cxx:62
void DirectDraw(TGLRnrCtx &rnrCtx) const override
Render with OpenGL.
Definition TH3GL.cxx:111
void SetBBox() override
Set bounding box.
Definition TH3GL.cxx:103
The 3-D histogram classes derived from the 1-D histogram classes.
Definition TH3.h:40
Mother of all ROOT objects.
Definition TObject.h:41
A 3D polymarker.
Basic string class.
Definition TString.h:138
auto * th3
Definition textalign.C:22