VAPOR3 3.9.4
VolumeRenderer.h
Go to the documentation of this file.
1#pragma once
2
3#include <vapor/Renderer.h>
4#include <vapor/Texture.h>
5#include <vapor/Framebuffer.h>
7#include <glm/fwd.hpp>
8
9namespace VAPoR {
10
12public:
13 VolumeRenderer(const ParamsMgr *pm, std::string &winName, std::string &dataSetName, std::string &instName, DataMgr *dataMgr);
14 VolumeRenderer(const ParamsMgr *pm, std::string &winName, std::string &dataSetName, std::string paramsType, std::string classType, std::string &instName, DataMgr *dataMgr);
16
17 static std::string GetClassType() { return ("Volume"); }
18
19protected:
21 int _paintGL(bool fast);
22 void _clearCache(){};
23
24 virtual std::string _getColorbarVariableName() const;
25
28 void _generateChunkedRenderMesh(const float chunks);
31 bool _shouldUseChunkedRender(bool fast) const;
32 virtual bool _usingColorMapData() const;
35 void _initializeFramebuffer(bool fast);
38 int _loadData();
40 virtual std::string _getDefaultAlgorithmForGrid(const Grid *grid) const;
42
43 unsigned int _VAO = (int)NULL;
44 unsigned int _VBO = (int)NULL;
45 unsigned int _VAOChunked = (int)NULL;
46 unsigned int _VBOChunked = (int)NULL;
47 VolumeAlgorithm *_algorithm = nullptr;
49
53 int _originalViewport[4];
55 int _framebufferSize[2];
58 std::vector<double> _dataMinExt;
59 std::vector<double> _dataMaxExt;
60
61 struct Cache {
62 std::string var = "";
63 size_t ts = -1;
66
67 bool useColorMapVar = false;
68 std::string colorMapVar = "";
69
70 MapperFunction * tf = nullptr;
71 std::vector<float> constantColor;
72 MapperFunction * tf2 = nullptr;
73
74 std::string algorithmName = "";
75
76 std::vector<double> minExt;
77 std::vector<double> maxExt;
78
81 bool ospPT;
86
88 } _cache;
89
90 friend class VolumeAlgorithm;
91};
92
93}; // namespace VAPoR
A cache based data reader.
Definition: DataMgr.h:110
Wrapper class for an OpenGL Framebuffer.
Definition: Framebuffer.h:23
Abstract base class for a 2D or 3D structured or unstructured grid.
Definition: Grid.h:56
Parent class for TransferFunction and IsoControl, supports positioning histogram over color/opacity m...
A singleton class for managing Params instances.
Definition: ParamsMgr.h:53
A class that performs rendering in a Visualizer.
Definition: Renderer.h:121
Strategy pattern for volume rendering algorithms.
int _paintGL(bool fast)
All OpenGL rendering is performed in the pure virtual paintGL method.
bool _needToSetDefaultAlgorithm() const
virtual bool _usingColorMapData() const
std::vector< double > _dataMinExt
bool _wasTooSlowForFastRender() const
bool _shouldUseChunkedRender(bool fast) const
void _generateChunkedRenderMesh(const float chunks)
void _computeNewFramebufferRatio()
void _initializeFramebuffer(bool fast)
virtual std::string _getDefaultAlgorithmForGrid(const Grid *grid) const
Framebuffer _framebuffer
std::vector< double > _dataMaxExt
static std::string GetClassType()
VolumeRenderer(const ParamsMgr *pm, std::string &winName, std::string &dataSetName, std::string &instName, DataMgr *dataMgr)
virtual std::string _getColorbarVariableName() const
VolumeRenderer(const ParamsMgr *pm, std::string &winName, std::string &dataSetName, std::string paramsType, std::string classType, std::string &instName, DataMgr *dataMgr)
#define RENDER_API
Definition: common.h:78
std::vector< float > constantColor
std::vector< double > maxExt
std::vector< double > minExt