VAPOR3 3.9.4
BarbParams.h
Go to the documentation of this file.
1
2#ifndef BARBPARAMS_H
3#define BARBPARAMS_H
4
6#include <vapor/DataMgr.h>
7
8namespace VAPoR {
9
16public:
18
20
21 virtual ~BarbParams();
22
23 bool GetNeedToRecalculateScales() const { return (bool)GetValueDouble(_needToRecalculateScalesTag, 0.0); }
24
26
29 //
30 double GetLengthScale() const { return GetValueDouble(_lengthScaleTag, 1.f); }
31
32 void SetLengthScale(double val) { SetValueDouble(_lengthScaleTag, "Barb length", val); }
33
37 const vector<long> GetGrid() const
38 {
39 vector<long> dims(3);
40 dims[0] = GetValueLong(_xBarbsCountTag, 10);
41 dims[1] = GetValueLong(_yBarbsCountTag, 10);
42 dims[2] = GetValueLong(_zBarbsCountTag, 1);
43 return dims;
44 }
45
49 void SetGrid(const int grid[3])
50 {
51 SetValueLong(_xBarbsCountTag, "", grid[0]);
52 SetValueLong(_yBarbsCountTag, "", grid[1]);
53 SetValueLong(_zBarbsCountTag, "", grid[2]);
54 }
55
58 double GetLineThickness() const { return GetValueDouble(_thicknessScaleTag, 1.f); }
59
62 void SetLineThickness(double val) { SetValueDouble(_thicknessScaleTag, "Barb thickness", val); }
63
64 // Get static string identifier for this params class
65 //
66 static string GetClassType() { return ("BarbParams"); }
67
69 //
70 virtual size_t GetRenderDim() const override
71 {
72 for (const auto &p : GetFieldVariableNames()) {
73 if (!p.empty()) return _dataMgr->GetVarTopologyDim(p);
74 }
75 return GetBox()->IsPlanar() ? 2 : 3;
76 }
77
79 virtual string GetActualColorMapVariableName() const override
80 {
81 if (UseSingleColor())
82 return "";
83 else
84 return GetColorMapVariableName();
85 }
86
87protected:
88 virtual bool GetUseSingleColorDefault() const override { return true; }
89
90private:
91 void _init();
92
93public:
94 static const string _needToRecalculateScalesTag;
95 static const string _lengthScaleTag;
96 static const string _thicknessScaleTag;
98 static const string _xBarbsCountTag;
100 static const string _yBarbsCountTag;
102 static const string _zBarbsCountTag;
103 static const string _alignGridTag;
104 static const string _alignGridStridesTag;
105 static const string _varsAre3dTag;
106
107}; // End of Class BarbParams
108}; // namespace VAPoR
109
110#endif
Class that supports drawing Barbs based on 2D or 3D vector field.
Definition: BarbParams.h:15
BarbParams(DataMgr *dataMgr, ParamsBase::StateSave *ssave)
static const string _needToRecalculateScalesTag
Definition: BarbParams.h:94
double GetLineThickness() const
Definition: BarbParams.h:58
static const string _alignGridTag
Definition: BarbParams.h:103
static const string _thicknessScaleTag
Definition: BarbParams.h:96
static const string _varsAre3dTag
Definition: BarbParams.h:105
void SetNeedToRecalculateScales(bool val)
static const string _yBarbsCountTag
Number of barbs displayed on Y axis.
Definition: BarbParams.h:100
const vector< long > GetGrid() const
Definition: BarbParams.h:37
void SetLineThickness(double val)
Definition: BarbParams.h:62
void SetGrid(const int grid[3])
Definition: BarbParams.h:49
virtual size_t GetRenderDim() const override
Definition: BarbParams.h:70
static const string _lengthScaleTag
Definition: BarbParams.h:95
double GetLengthScale() const
Definition: BarbParams.h:30
bool GetNeedToRecalculateScales() const
Definition: BarbParams.h:23
void SetLengthScale(double val)
Definition: BarbParams.h:32
virtual string GetActualColorMapVariableName() const override
Definition: BarbParams.h:79
static const string _alignGridStridesTag
Definition: BarbParams.h:104
BarbParams(DataMgr *dataMgr, ParamsBase::StateSave *ssave, XmlNode *node)
virtual ~BarbParams()
virtual bool GetUseSingleColorDefault() const override
Definition: BarbParams.h:88
static const string _zBarbsCountTag
Number of barbs displayed on Z axis.
Definition: BarbParams.h:102
static const string _xBarbsCountTag
Number of barbs displayed on X axis.
Definition: BarbParams.h:98
static string GetClassType()
Definition: BarbParams.h:66
A cache based data reader.
Definition: DataMgr.h:110
State capture class.
Definition: ParamsBase.h:62
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