VAPoR  3.0.0
arrowparams.h
Go to the documentation of this file.
1 
2 #ifndef ARROWPARAMS_H
3 #define ARROWPARAMS_H
4 
5 #include "vapor/ParamNode.h"
6 #include "renderparams.h"
7 #include "command.h"
8 #include "datastatus.h"
9 
10 namespace VAPoR {
11 
18 public:
19  ArrowParams(XmlNode *parent, int winnum);
23  return new ArrowParams(0, -1);
24  }
27  const std::string getShortName() {return _shortName;}
28  virtual ~ArrowParams();
32  virtual void restart();
35  virtual Box* GetBox() {
36  vector<string>path;
37  path.push_back(Box::_boxTag);
38  return (Box*) GetParamsBase(path);
39  }
40 
43  virtual void Validate(int type);
47  virtual bool IsOpaque() {return true;}
51  virtual bool usingVariable(const std::string& varname){
52  for (int i = 0; i<3; i++){
53  if (GetFieldVariableNames()[i] == varname) return true;
54  }
55  if (IsTerrainMapped() && (varname == GetHeightVariableName())) return true;
56  return false;
57  }
58 
61  double GetLineThickness(){
62  const vector<double> one(1,1.);
63  return (GetValueDouble(_lineThicknessTag,one));
64  }
68  int SetLineThickness(double val){
69  return SetValueDouble(_lineThicknessTag,"Set barb thickness",val);
70  }
75  double GetVectorScale(){
76  const vector<double>defaultScale(1,1.);
77  return ((float)GetValueDouble(_vectorScaleTag,defaultScale));
78  }
82  int SetVectorScale(double val);
83 
87  int SetConstantColor(const double rgb[3]);
88 
91  const vector<double> GetConstantColor();
92 
96  int SetVariables3D(bool val) {
97  if (val == VariablesAre3D()) return 0;
98  int rc = SetValueLong(_variableDimensionTag,"Set barb var dimensions",(long)(val ? 3:2));
99  setAllBypass(false);
100  return rc;
101  }
106  bool VariablesAre3D() {
107  const vector<long>three(1,3);
108  return (GetValueLong(_variableDimensionTag,three) == 3);
109  }
114  double calcDefaultScale();
115 
116 #ifndef DOXYGEN_SKIP_THIS
117  static const string _arrowParamsTag;
118 
119 private:
120 static const string _shortName;
121 static const string _constantColorTag;
122 static const string _lineThicknessTag;
123 static const string _vectorScaleTag;
124 
125 #endif //DOXYGEN_SKIP_THIS
126 
127 }; //End of Class ArrowParams
128 };
129 #endif //ARROWPARAMS_H
130 
int SetLineThickness(double val)
Definition: arrowparams.h:68
double GetVectorScale()
Definition: arrowparams.h:75
virtual bool usingVariable(const std::string &varname)
Definition: arrowparams.h:51
3D or 2D box with options for orientation angles and extents changing in time. Intended to be used in...
Definition: Box.h:43
A Params subclass for managing parameters used by Renderers.
Definition: renderparams.h:57
virtual bool IsOpaque()
Definition: arrowparams.h:47
Nodes with state in Xml tree representation.
Definition: ParamsBase.h:90
Class that supports drawing Barbs based on 2D or 3D vector field.
Definition: arrowparams.h:17
const std::string getShortName()
Definition: arrowparams.h:27
static ParamsBase * CreateDefaultInstance()
Definition: arrowparams.h:22
int SetVariables3D(bool val)
Definition: arrowparams.h:96
#define PARAMS_API
Definition: DC.h:10
virtual Box * GetBox()
Definition: arrowparams.h:35
double GetLineThickness()
Definition: arrowparams.h:61