9#ifndef VAPOR_BARBRENDERER_H
10#define VAPOR_BARBRENDERER_H
39 vector<string> _fieldVariables;
40 double _vectorScaleFactor;
43 vector<double> _currentBoxMinExts;
44 vector<double> _currentBoxMaxExts;
46 string _currentHgtVar;
47 vector<double> _currentBoxMinExtsTex;
48 vector<double> _currentBoxMaxExtsTex;
52 void _getMagnitudeAtPoint(std::vector<VAPoR::Grid *> variables,
float point[3]);
54 void _recalculateScales(std::vector<VAPoR::Grid *> &varData,
int ts);
56 double _getDomainHypotenuse(
size_t ts)
const;
58 void _setDefaultLengthAndThicknessScales(
size_t ts,
const std::vector<VAPoR::Grid *> &varData,
const BarbParams *bParams);
60 void _getGridRequirements(
int &ts,
int &refLevel,
int &lod,
CoordType &minExts,
CoordType &maxExts)
const;
63 virtual int _initializeGL();
66 virtual int _paintGL(
bool fast);
70 int _getVectorVarGrids(
int ts,
int refLevel,
int lod,
CoordType minExts,
CoordType maxExts, std::vector<VAPoR::Grid *> &varData);
72 int _getVarGrid(
int ts,
int refLevel,
int lod,
string varName,
CoordType minExts,
CoordType maxExts, std::vector<VAPoR::Grid *> &varData);
74 void _setUpLightingAndColor();
76 void _reFormatExtents(vector<float> &rakeExts)
const;
78 void _makeRakeGrid(vector<int> &rakeGrid)
const;
94 float _getHeightOffset(
Grid *heightVar,
float xCoord,
float yCoord,
bool &missing)
const;
96 bool _makeCLUT(
float clut[1024])
const;
98 void _getDirection(
float direction[3], std::vector<Grid *> varData,
float xCoord,
float yCoord,
float zCoord,
bool &missing)
const;
100 vector<double> _getScales();
102 float _calculateLength(
float start[3],
float end[3])
const;
104 void _makeStartAndEndPoint(
float start[3],
float end[3],
float direction[3]);
106 void _getStrides(vector<float> &strides, vector<int> &rakeGrid, vector<float> &rakeExts)
const;
108 bool _defineBarb(
const std::vector<Grid *>,
float start[3],
float end[3],
float *value,
bool doColorMapping,
const float clut[1024]);
110 void _operateOnGrid(vector<Grid *> variableData,
bool drawBarb =
true);
112 bool _getColorMapping(
float val,
const float clut[256 * 4]);
114 float _calculateDirVec(
const float start[3],
const float end[3],
float dirVec[3]);
116 void _drawBackOfBarb(
const float dirVec[3],
const float startVertex[3])
const;
118 void _drawCylinderSides(
const float nextNormal[3],
const float nextVertex[3],
const float startNormal[3],
const float startVertex[3])
const;
120 void _drawBarbHead(
const float dirVec[3],
const float vertexPoint[3],
const float startNormal[3],
const float startVertex[3])
const;
126 void _drawBarb(
const std::vector<Grid *> variableData,
const float startPoint[3],
bool doColorMapping,
const float clut[1024]);
128 void _setBarbColor(
float value,
const float clut[1024],
double crange[2])
const;
131 void _drawBarb(Barb b,
bool doColorMapping,
const float clut[1024],
double crange[2]);
134 _printBackDiameter(
const float startVertex[18])
const;
145 float constantColor[3];
153 float colorSamples[10][3];
154 float alphaSamples[10];
158 bool _isCacheDirty()
const;
159 void _saveCacheParams();
161 void _clearCache() { _cacheParams.fieldVarNames.clear(); }
170 vector<Barb> _barbCache;
Class that supports drawing Barbs based on 2D or 3D vector field.
Class that draws the barbs as specified by BarbParams.
BarbRenderer(const ParamsMgr *pm, string winName, string dataSetName, string instName, DataMgr *dataMgr)
virtual std::string _getColorbarVariableName() const
static string GetClassType()
vector< string > fieldVarNames
A cache based data reader.
Abstract base class for a 2D or 3D structured or unstructured grid.
A singleton class for managing Params instances.
A class that performs rendering in a Visualizer.
std::array< double, 3 > CoordType
Type for specifying floating point coordinates.