19 #ifndef ISOLINERENDERER_H
20 #define ISOLINERENDERER_H
24 #include <OpenGL/gl.h>
25 #include <OpenGL/glu.h>
58 virtual int _initializeGL();
67 void invalidateLineCache(
int timestep);
69 virtual void invalidateCache();
73 bool cacheIsValid(
int timestep) {
return _cacheValidFlags[timestep];}
81 const std::map<pair<int,int>,vector<float*> >&
GetLineCache() {
return _lineCache;}
88 void performRendering(
size_t timestep);
99 int edgeCode(
int i,
int j,
float isoval,
float* dataVals);
109 int addLineSegment(
int timestep,
int isoIndex,
float x1,
float y1,
float x2,
float y2);
113 int numIsovalsInCache() {
return _numIsovalsCached;}
119 void addEdges(
int segIndex, pair<int,int> edge1, pair<int,int> edge2);
122 void traverseCurves(
int iso);
128 vector<float*>& getLineSegments(
int timestep,
int isoindex){
129 pair<int,int> indexpair = make_pair(timestep,isoindex);
130 return _lineCache[indexpair];
139 float interp_j(
int i,
int j,
float isoval,
float* dataVals){
140 return ( -1. + 2.*(
double)(j)/((
double)_gridSize-1.)
141 + 2./(
double)(_gridSize -1.)
142 *(isoval - dataVals[i+_gridSize*j])/(dataVals[i+_gridSize*(j+1)]-dataVals[i+_gridSize*j]));
150 float interp_i(
int i,
int j,
float isoval,
float* dataVals){
151 return (-1. + 2.*(
double)(i)/((
double)_gridSize-1.)
152 + 2./(
double)(_gridSize -1.)
153 *(isoval - dataVals[i+_gridSize*j])/(dataVals[i+1+_gridSize*(j)]-dataVals[i+_gridSize*j]));
159 void buildEdges(
int isoval,
float* dataVals,
float missingVal);
163 void attachAnnotation(
int numcomponents,
int iso);
164 #ifndef DOXYGEN_SKIP_THIS
169 std::map<pair<int,int>,vector<float*> > _lineCache;
172 std::map<int,bool> _cacheValidFlags;
187 std::map< pair<int,int>,
int> _edgeSeg;
189 std::map<pair<int,int>,pair<int,int> > _edgeEdge1;
190 std::map<pair<int,int>,pair<int,int> > _edgeEdge2;
191 std::map<pair<int,int>,
bool> _markerBit;
192 vector<int> _componentLength;
193 vector<pair<int,int> > _endEdge;
200 int _numIsovalsCached;
202 std::map<int,int> _objectNums;
207 #endif // ISOLINERENDERER_H
A Params subclass for managing parameters used by Renderers.
static Renderer * CreateInstance(Visualizer *v, RenderParams *rp)
const std::map< pair< int, int >, vector< float * > > & GetLineCache()
A class for performing OpenGL rendering in VAPOR GUI Window.
Class that draws the isolines (contours) as specified by IsolineParams.
A cache based data reader.
bool cacheIsValid(int timestep)
A class that performs rendering in a Visualizer.
virtual void setAllDataDirty()