2 #ifndef ISOLINEPARAMS_H
3 #define ISOLINEPARAMS_H
5 #include "vapor/ParamNode.h"
8 #include "mapperfunction.h"
9 #include "transferfunction.h"
33 virtual void restart();
39 if (VariablesAre3D()){
60 virtual void Validate(
int type);
72 if (GetVariableName() == varname)
return true;
80 for (
int i = 0; i<3; i++) _selectPoint[i] = point[i];
92 return (GetBox()->GetLocalExtents());
97 GetBox()->GetLocalExtents(exts);
102 GetBox()->SetLocalExtents(exts,
this);
108 return ((
float)GetValueDouble(_lineThicknessTag));
113 SetValueDouble(_lineThicknessTag,
"Set contour line thickness", val);
118 return (
float)GetValueDouble(_panelLineThicknessTag);
123 SetValueDouble(_panelLineThicknessTag,
"Set line thickness in image", val);
128 return ((
float)GetValueDouble(_textSizeTag));
133 SetValueDouble(_textSizeTag,
"Set text size", val);
140 return ((
float)GetValueDouble(_textDensityTag));
146 SetValueDouble(_textDensityTag,
"Set text density", val);
151 return (0 != GetValueLong(_textEnabledTag));
156 SetValueLong(_textEnabledTag,
"enable/disable isoline text",(
long)val);
161 return (0 != GetValueLong(_useSingleColorTag));
166 SetValueLong(_useSingleColorTag,
"enable/disable use single color", (
long)val);
171 vector<double> dcolors;
172 for (
int i = 0; i<3; i++) dcolors.push_back(clr[i]);
173 SetValueDouble(_singleColorTag,
"Specify single color",dcolors);
179 return GetValueDoubleVec(_singleColorTag);
183 void SetPanelBackgroundColor(
const float rgb[3]);
188 const vector<double> GetPanelBackgroundColor();
193 void getLineColor(
int isoNum,
float lineColor[3]);
198 return GetIsoControl()->getIsoValues().size();
203 int GetNumVariables3D();
207 int GetNumVariables2D();
213 if (VariablesAre3D()) path.push_back(_Variables3DTag);
214 else path.push_back(_Variables2DTag);
215 path.push_back(GetVariableName());
216 path.push_back(_IsoControlTag);
217 if (!GetRootNode()->GetNode(path))
return 0;
218 return (IsoControl*)(GetRootNode()->GetNode(path)->GetParamsBase());
227 if (is3D) path.push_back(_Variables3DTag);
228 else path.push_back(_Variables2DTag);
229 path.push_back(varname);
230 path.push_back(_IsoControlTag);
231 if (!GetRootNode()->GetNode(path))
return 0;
232 return (IsoControl*)(GetRootNode()->GetNode(path)->GetParamsBase());
240 int SetIsoControl(
const string varname, IsoControl* iControl,
bool is3D);
245 return (MapperFunction*)GetIsoControl();
250 return GetIsoControl()->getIsoValues();
255 GetIsoControl()->setIsoValues(values);
261 SetValueLong(_textTypeTag,
"set text label type",val);
266 return GetValueLong(_textTypeTag);
271 SetValueLong(_numDigitsTag,
"set display digits",val);
276 return GetValueLong(_numDigitsTag);
281 IsoControl* isoContr = GetIsoControl();
282 if(!isoContr)
return;
283 if(isoContr->getMinHistoValue() == bnds[0] &&
284 isoContr->getMaxHistoValue() == bnds[1])
return;
285 isoContr->setMinMaxHistoValue(bnds[0],bnds[1]);
287 isoContr->setMinMaxMapValue(bnds[0],bnds[1]);
294 if (!GetIsoControl()){
298 bounds[0]=GetIsoControl()->getMinHistoValue();
299 bounds[1]=GetIsoControl()->getMaxHistoValue();
304 virtual void hookupTF(TransferFunction* ,
int );
309 void spaceIsovals(
float miniso,
float spacing);
311 #ifndef DOXYGEN_SKIP_THIS
313 static const string _shortName;
314 static const string _numDigitsTag;
315 static const string _panelBackgroundColorTag;
316 static const string _isolineExtentsTag;
317 static const string _lineThicknessTag;
318 static const string _panelLineThicknessTag;
319 static const string _textSizeTag;
320 static const string _textDensityTag;
321 static const string _2DBoxTag;
322 static const string _3DBoxTag;
323 static const string _editBoundsTag;
324 static const string _textEnabledTag;
325 static const string _useSingleColorTag;
326 static const string _singleColorTag;
327 static const string _textTypeTag;
329 double _selectPoint[3];
330 float _histoBounds[2];
331 #endif //DOXYGEN_SKIP_THIS
334 #endif //ISOLINEPARAMS_H
ParamsBase * GetParamsBase() const
3D or 2D box with options for orientation angles and extents changing in time. Intended to be used in...
void SetNumDigits(int val)
A Params subclass for managing parameters used by Renderers.
const vector< double > GetSingleColor()
virtual const double * getSelectedPointLocal()
IsoControl * GetIsoControl(string varname, bool is3D)
void SetLocalExtents(const vector< double > &exts)
void SetIsovalues(const vector< double > &values)
void SetSingleColor(double clr[3])
Nodes with state in Xml tree representation.
void SetTextEnabled(bool val)
vector< double > GetIsovalues()
const std::string getShortName()
Required virtual method provides a short name for use in the gui.
float GetPanelLineThickness()
void setSelectedPointLocal(const double point[3])
void SetLineThickness(double val)
virtual MapperFunction * GetMapperFunc()
virtual bool usingVariable(const std::string &varname)
void SetTextDensity(double val)
void SetHistoBounds(const float bnds[2])
const vector< double > GetIsolineLocalExtents()
static ParamsBase * CreateDefaultInstance()
Required static creation method.
IsoControl * GetIsoControl()
void SetPanelLineThickness(double val)
void SetTextSize(double val)
void GetHistoBounds(float bounds[2])
ParamNode * GetNode(const vector< string > &tagpath)
void GetLocalExtents(double exts[6])
void SetUseSingleColor(bool val)
void SetTextLabelType(int val)
Class that supports rendering of contour lines (isolines)