19#ifndef TWODDATARENDERER_H
20#define TWODDATARENDERER_H
47 int GetMesh(
DataMgr *dataMgr, GLfloat **verts, GLfloat **normals, GLsizei &nverts, GLsizei &width, GLsizei &height, GLuint **indices, GLsizei &nindices,
bool &structuredMesh);
49 const GLvoid *
GetTexture(
DataMgr *dataMgr, GLsizei &width, GLsizei &height, GLint &internalFormat, GLenum &format, GLenum &type,
size_t &texelSize,
bool &gridAligned);
54 _grid_state_c() =
default;
55 _grid_state_c(
size_t numRefLevels,
int refLevel,
int lod,
string hgtVar,
string meshName,
size_t ts, vector<double> minExts, vector<double> maxExts)
56 : _numRefLevels(numRefLevels), _refLevel(refLevel), _lod(lod), _hgtVar(hgtVar), _meshName(meshName), _ts(ts), _minExts(minExts), _maxExts(maxExts)
63 _refLevel = _lod = -1;
64 _hgtVar = _meshName =
"";
70 bool operator==(
const _grid_state_c &rhs)
const
72 return (_numRefLevels == rhs._numRefLevels && _refLevel == rhs._refLevel && _lod == rhs._lod && _hgtVar == rhs._hgtVar && _meshName == rhs._meshName && _ts == rhs._ts
73 && _minExts == rhs._minExts && _maxExts == rhs._maxExts);
75 bool operator!=(
const _grid_state_c &rhs)
const {
return (!(*
this == rhs)); }
84 vector<double> _minExts;
85 vector<double> _maxExts;
90 _tex_state_c() =
default;
91 _tex_state_c(
int refLevel,
int lod,
string varname,
size_t ts, vector<double> minExts, vector<double> maxExts)
92 : _refLevel(refLevel), _lod(lod), _varname(varname), _ts(ts), _minExts(minExts), _maxExts(maxExts)
98 _refLevel = _lod = -1;
105 bool operator==(
const _tex_state_c &rhs)
const
107 return (_refLevel == rhs._refLevel && _lod == rhs._lod && _varname == rhs._varname && _ts == rhs._ts && _minExts == rhs._minExts && _maxExts == rhs._maxExts);
109 bool operator!=(
const _tex_state_c &rhs)
const {
return (!(*
this == rhs)); }
116 vector<double> _minExts;
117 vector<double> _maxExts;
120 _grid_state_c _grid_state;
121 _tex_state_c _tex_state;
131 GLsizei _vertsHeight;
137 size_t _colormapsize;
139 bool _gridStateDirty()
const;
141 void _gridStateClear();
143 void _gridStateSet();
145 bool _texStateDirty(DataMgr *dataMgr)
const;
147 void _texStateSet(DataMgr *dataMgr);
149 void _texStateClear();
151 int _getMeshStructured(DataMgr *dataMgr,
const StructuredGrid *g,
double defaultZ);
153 int _getMeshUnStructured(DataMgr *dataMgr,
const Grid *g,
double defaultZ);
155 int _getMeshUnStructuredHelper(DataMgr *dataMgr,
const Grid *g,
double defaultZ);
157 int _getMeshStructuredDisplaced(DataMgr *dataMgr,
const StructuredGrid *g,
double defaultZ);
159 int _getMeshStructuredPlane(DataMgr *dataMgr,
const StructuredGrid *g,
double defaultZ);
161 const GLvoid *_getTexture(DataMgr *dataMgr);
163 int _getOrientation(DataMgr *dataMgr,
string varname);
165 void _clearCache() { _tex_state.clear(); }
A cache based data reader.
A singleton class for managing Params instances.
const GLvoid * GetTexture(DataMgr *dataMgr, GLsizei &width, GLsizei &height, GLint &internalFormat, GLenum &format, GLenum &type, size_t &texelSize, bool &gridAligned)
TwoDDataRenderer(const ParamsMgr *pm, string winName, string dataSetName, string instName, DataMgr *dataMgr)
static string GetClassType()
int GetMesh(DataMgr *dataMgr, GLfloat **verts, GLfloat **normals, GLsizei &nverts, GLsizei &width, GLsizei &height, GLuint **indices, GLsizei &nindices, bool &structuredMesh)
int _paintGL(bool fast)
All OpenGL rendering is performed in the pure virtual paintGL method.
virtual ~TwoDDataRenderer()