VAPOR3 3.9.4
ContourParams.h
Go to the documentation of this file.
1
2#ifndef CONTOURPARAMS_H
3#define CONTOURPARAMS_H
4
5#include <string>
7#include <vapor/DataMgr.h>
8
9namespace VAPoR {
10
11// class ContourParams::Contours;
12
19public:
20 class Contours;
21
23
25
27
29
30 virtual ~ContourParams();
31
33
34 void MakeNewContours(string varName);
35 void GenerateContourValues(double start, double spacing, int num, Contours *c = nullptr);
36
39 double GetLineThickness() const { return (GetValueDouble(_thicknessScaleTag, 1.0)); }
40
41 void SetLineThickness(double val) { SetValueDouble(_thicknessScaleTag, "Contour thickness", val); }
42
44
45 double GetContourMin();
46
48
49 double GetContourMax();
50
51 void SetContourCount(int num);
52 void SetContourMin(double val);
53 void SetContourSpacing(double val);
54
55 void GetLineColor(int lineNum, float color[3]);
56
57 void SetLineColor(vector<double> vec) { SetValueDoubleVec(_lineColorTag, "Line color", vec); }
58
59 void SetLockToTF(bool lock);
60
61 bool GetLockToTF() const;
62
63 bool HasIsoValues() const override { return true; }
64 vector<double> GetIsoValues(const string &variable) override;
65 void SetIsoValues(const string &variable, const vector<double> &values) override;
66
67 vector<double> GetContourValues(const string &varName);
68 void SetContourValues(const string &varName, const vector<double> &vals);
69
70 // Get static string identifier for this params class
71 //
72 static string GetClassType() { return ("ContourParams"); }
73
75 //
76 virtual size_t GetRenderDim() const override { return _dataMgr->GetVarTopologyDim(GetVariableName()); }
77 virtual bool GetOrientable() const override { return true; }
78
80 virtual string GetActualColorMapVariableName() const override { return GetVariableName(); }
81
82 int GetNumDigits() const
83 {
84 double val = GetValueDouble(_numDigitsTag, 1.0);
85 return (int)val;
86 }
87
88 void SetNumDigits(int digits) { SetValueDouble(_numDigitsTag, "Number of digits in contour annotation", digits); }
89
90 int GetTextDensity() const
91 {
92 double val = GetValueDouble(_textDensityTag, 1.0);
93 return (int)val;
94 }
95
96 void SetTextDensity(int density) { SetValueDouble(_textDensityTag, "Density of contour annotations", density); }
97
98 bool GetTextEnabled() const;
99 void SetTFLock(bool lock);
100 bool GetTFLock();
101
102private:
103 void _init();
104 static const string _thicknessScaleTag;
105 static const string _lineColorTag;
106 static const string _contoursTag;
107 static const string _numDigitsTag;
108 static const string _textDensityTag;
109 static const string _textEnabledTag;
110 static const string _lockToTFTag;
111 ParamsContainer * _contours;
112
113 vector<CoordType> _slicePlaneQuad;
114
115public:
117 public:
119
121
122 virtual ~Contours();
123
124 vector<double> GetContourValues() const
125 {
126 vector<double> defaultv(7, 0.);
127 if (!_node->HasElementDouble(_valuesTag)) return defaultv;
128
129 vector<double> val = GetValueDoubleVec(_valuesTag);
130 return val;
131 }
132
133 void SetContourValues(vector<double> vals) { SetValueDoubleVec(_valuesTag, "Set contour values", vals); }
134
135 double GetMin() const;
136 int GetCount() const; // {
137 double GetSpacing() const; //{
138 static string GetClassType() { return ("Contours"); }
139
140 private:
141 static const string _valuesTag;
142 };
143
144}; // End of Class ContourParams
145
146}; // namespace VAPoR
147
148#endif
Contours(ParamsBase::StateSave *ssave, XmlNode *node)
vector< double > GetContourValues() const
Contours(ParamsBase::StateSave *ssave)
void SetContourValues(vector< double > vals)
Class that supports drawing Contours based on 2D or 3D vector field.
Definition: ContourParams.h:18
void SetLockToTF(bool lock)
vector< double > GetContourValues(const string &varName)
bool GetTextEnabled() const
void SetTextDensity(int density)
Definition: ContourParams.h:96
void SetContourSpacing(double val)
ContourParams(DataMgr *dataMgr, ParamsBase::StateSave *ssave)
double GetLineThickness() const
Definition: ContourParams.h:39
ContourParams(const ContourParams &rhs)
void GetLineColor(int lineNum, float color[3])
void SetLineColor(vector< double > vec)
Definition: ContourParams.h:57
virtual bool GetOrientable() const override
Return whether a renderer can be oriented - IE, can this renderer be rotated about an origin point?
Definition: ContourParams.h:77
void MakeNewContours(string varName)
void SetContourValues(const string &varName, const vector< double > &vals)
void SetIsoValues(const string &variable, const vector< double > &values) override
Contours * GetCurrentContours()
virtual ~ContourParams()
ContourParams & operator=(const ContourParams &rhs)
int GetTextDensity() const
Definition: ContourParams.h:90
static string GetClassType()
Definition: ContourParams.h:72
void SetContourCount(int num)
void SetNumDigits(int digits)
Definition: ContourParams.h:88
void SetTFLock(bool lock)
bool HasIsoValues() const override
This should be overriden by params for renderes that support iso values to return true.
Definition: ContourParams.h:63
void SetContourMin(double val)
virtual string GetActualColorMapVariableName() const override
Definition: ContourParams.h:80
virtual size_t GetRenderDim() const override
Definition: ContourParams.h:76
ContourParams(DataMgr *dataMgr, ParamsBase::StateSave *ssave, XmlNode *node)
int GetNumDigits() const
Definition: ContourParams.h:82
vector< double > GetIsoValues(const string &variable) override
bool GetLockToTF() const
void GenerateContourValues(double start, double spacing, int num, Contours *c=nullptr)
void SetLineThickness(double val)
Definition: ContourParams.h:41
double GetContourSpacing()
A cache based data reader.
Definition: DataMgr.h:110
State capture class.
Definition: ParamsBase.h:62
Nodes with state in Xml tree representation.
Definition: ParamsBase.h:50
A Params subclass for managing parameters used by Renderers.
Definition: RenderParams.h:43
An Xml tree.
Definition: XmlNode.h:49
#define PARAMS_API
Definition: common.h:77