22 #ifndef RENDERPARAMS_H
23 #define RENDERPARAMS_H
25 #include <vapor/XmlNode.h>
26 #include <vapor/ExpatParseMgr.h>
27 #include <vapor/ParamNode.h>
32 #include <vapor/common.h>
44 class ViewpointParams;
67 RenderParams(XmlNode *parent,
const string &name,
int winnum);
73 int enabled = GetValueLong(_EnabledTag);
74 return (enabled != 0);
81 virtual void SetEnabled(
bool val);
86 virtual bool usingVariable(
const std::string& varname) = 0;
90 virtual void SetVariableName(
string varName);
94 const string GetVariableName();
98 const string GetFirstVariableName();
103 virtual void SetFieldVariableNames(vector <string> varNames);
107 const vector<string> GetFieldVariableNames();
112 const vector<long>off(1,0);
113 return (0 !=GetValueLong(_terrainMapTag,off));
120 int rc = SetValueLong(_terrainMapTag,
"Enable terrain-mapping", (
long)val);
127 virtual void SetRendererName(
const string& renName);
130 virtual const string GetRendererName();
134 virtual int SetRefinementLevel(
int numrefinements);
138 virtual int GetRefinementLevel();
142 virtual int GetCompressionLevel();
146 virtual int SetCompressionLevel(
int val);
150 virtual bool IsOpaque() = 0;
156 void setBypass(
int timestep) {_bypassFlags[timestep] = 2;}
168 void setAllBypass(
bool val);
173 bool doBypass(
int ts) {
return ((ts < _bypassFlags.size()) && _bypassFlags[ts]);}
179 bool doAlwaysBypass(
int ts) {
return ((ts < _bypassFlags.size()) && _bypassFlags[ts]>1);}
184 virtual int GetFidelityLevel();
188 virtual void SetFidelityLevel(
int level);
192 virtual bool GetIgnoreFidelity();
196 virtual void SetIgnoreFidelity(
bool val);
200 void SetFidelityToDefaults();
203 SetValueDouble(_histoScaleTag,
"Set histo stretch",(
double)factor);
206 return GetValueDouble(_histoScaleTag);
209 return GetRootNode()->GetElementDouble(_editBoundsTag)[0];
212 return GetRootNode()->GetElementDouble(_editBoundsTag)[1];
215 vector<double>vals = GetValueDoubleVec(_editBoundsTag);
216 if (vals.size()<1) vals.push_back(val);
218 SetValueDouble(_editBoundsTag,
"change edit min bound",vals);
221 vector<double>vals = GetValueDoubleVec(_editBoundsTag);
222 while (vals.size()<2) vals.push_back(val);
224 SetValueDouble(_editBoundsTag,
"change edit max bound",vals);
227 SetValueDouble(_editBoundsTag,
"set edit bounds",bounds);
233 SetValueDouble(_cursorCoordsTag,
"set cursor coords",coords);
236 return (GetValueDoubleVec(_cursorCoordsTag));
246 vector<Params*>& instances = _paramsInstances[make_pair(pType,winnum)];
247 instances.insert(instances.begin()+posn, dp);
255 if (val == VariablesAre3D())
return 0;
256 int rc = SetValueLong(_variableDimensionTag,
"Set variable dimensions",(
long)(val ? 3:2));
270 const vector<long> defaultGrid(3,1);
271 return (GetValueLongVec(_gridTag,defaultGrid));
276 int SetGrid(
const int grid[3]);
282 if (IsAlignedToData() == val)
return 0;
283 return SetValueLong(_alignGridTag,
"Set barb grid alignment",(val ? 1:0));
288 const vector<long> notAligned(1,0);
289 return (0 != GetValueLong(_alignGridTag,notAligned));
295 const vector<long> defaultStrides(3,10);
296 return GetValueLongVec(_alignGridStridesTag,defaultStrides);
302 int SetGridAlignStrides(
const vector<long>& strides);
310 void getDataAlignment(
double rakeExts[6],
int rakeGrid[3],
size_t timestep);
316 virtual int SetHeightVariableName(
const string& varName);
320 virtual const string GetHeightVariableName();
321 #ifndef DOXYGEN_SKIP_THIS
323 int SetLocal(
bool lg){
332 virtual ~RenderParams(){
336 void initializeBypassFlags();
339 static const string _EnabledTag;
340 static const string _FidelityLevelTag;
341 static const string _IgnoreFidelityTag;
342 static const string _histoScaleTag;
343 static const string _editBoundsTag;
344 static const string _histoBoundsTag;
345 static const string _RendererNameTag;
346 static const string _cursorCoordsTag;
347 static const string _heightVariableNameTag;
348 static const string _variableDimensionTag;
349 static const string _terrainMapTag;
350 static const string _variableNameTag;
351 static const string _fieldVariableNamesTag;
352 static const string _gridTag;
353 static const string _alignGridTag;
354 static const string _alignGridStridesTag;
356 vector<int> _bypassFlags;
357 #endif //DOXYGEN_SKIP_THIS
361 #endif //RENDERPARAMS_H
const vector< long > GetGrid()
A pure virtual class for managing parameters used in visualization.
A Params subclass for managing parameters used by Renderers.
void SetCursorCoords(const vector< double > &coords)
bool doAlwaysBypass(int ts)
const vector< long > GetGridAlignStrides()
static void InsertParamsInstance(int pType, int winnum, int posn, RenderParams *dp)
virtual bool VariablesAre3D()
void setMinEditBound(double val)
void SetEditBounds(vector< double >bounds)
int AlignGridToData(bool val)
virtual MapperFunction * GetMapperFunc()
void SetHistoStretch(float factor)
void setBypass(int timestep)
int SetTerrainMapped(bool val)
void setPartialBypass(int timestep)
virtual int SetVariables3D(bool val)
void setMaxEditBound(double val)
const vector< double > GetCursorCoords()