VAPOR3 3.9.4
DatasetsParams.h
Go to the documentation of this file.
1
2#pragma once
3
4#include <string>
5#include <vapor/ParamsBase.h>
6
7namespace VAPoR {
8
9//
10// A collection of Dataset params
11//
12// These are not the dataset params. These are the python script generated var params.
13//
15public:
17
19
21
23
24 virtual ~DatasetsParams();
25
26 void SetScript(string datasetName, string name, string script, const vector<string> &inputVarNames, const vector<string> &outputVarNames, const vector<string> &outputVarMeshes, bool coordFlag);
27
28 bool GetScript(string datasetName, string name, string &script, vector<string> &inputVarNames, vector<string> &outputVarNames, vector<string> &outputVarMeshes, bool &coordFlag) const;
29
30 void RemoveDataset(string datasetName) { _datasets->Remove(datasetName); }
31
32 void RemoveScript(string datasetName, string scriptName);
33
34 vector<string> GetScriptNames(string datasetName) const;
35
36 // Get static string identifier for this params class
37 //
38 static string GetClassType() { return ("DatasetsParams"); }
39
40private:
41 static const string _datasetsTag;
42
43 ParamsContainer *_datasets;
44};
45
46//
47// Dataset params
48//
50public:
52
54
56
58
59 virtual ~DatasetParams();
60
61 void SetScript(string name, string script, const vector<string> &inputVarNames, const vector<string> &outputVarNames, const vector<string> &outputVarMeshes, bool coordFlag);
62
63 bool GetScript(string name, string &script, vector<string> &inputVarNames, vector<string> &outputVarNames, vector<string> &outputVarMeshes, bool &coordFlag) const;
64
65 void RemoveScript(string name) { _scripts->Remove(name); }
66
67 vector<string> GetScriptNames() const { return (_scripts->GetNames()); }
68
69 // Get static string identifier for this params class
70 //
71 static string GetClassType() { return ("DatasetParams"); }
72
74 public:
75 ScriptParams(ParamsBase::StateSave *ssave) : ParamsBase(ssave, ScriptParams::GetClassType()) {}
76
77 ScriptParams(ParamsBase::StateSave *ssave, XmlNode *node) : ParamsBase(ssave, node) {}
78
79 virtual ~ScriptParams() {}
80
81 void SetScript(string script, const vector<string> &inputVarNames, const vector<string> &outputVarNames, const vector<string> &outputVarMeshes, bool coordFlag)
82 {
83 _ssave->BeginGroup("Set derived variable script");
84
85 SetValueString(_scriptTag, "", script);
86 SetValueStringVec(_inputVarNamesTag, "", inputVarNames);
87 SetValueStringVec(_outputVarNamesTag, "", outputVarNames);
88 SetValueStringVec(_outputVarMeshesTag, "", outputVarMeshes);
89 SetValueLong(_coordFlagTag, "", 0);
90
91 _ssave->EndGroup();
92 }
93
94 void GetScript(string &script, vector<string> &inputVarNames, vector<string> &outputVarNames, vector<string> &outputVarMeshes, bool &coordFlag)
95 {
96 script = GetValueString(_scriptTag, "");
97 inputVarNames = GetValueStringVec(_inputVarNamesTag);
98 outputVarNames = GetValueStringVec(_outputVarNamesTag);
99 outputVarMeshes = GetValueStringVec(_outputVarMeshesTag);
100 coordFlag = GetValueLong(_coordFlagTag, 0);
101 }
102
103 static string GetClassType() { return ("ScriptParams"); }
104
105 private:
106 static const string _scriptTag;
107 static const string _inputVarNamesTag;
108 static const string _outputVarNamesTag;
109 static const string _outputVarMeshesTag;
110 static const string _coordFlagTag;
111 };
112
113private:
114 static const string _datasetTag;
115 static const string _scriptsTag;
116
117 ParamsContainer *_scripts;
118
119}; // End of Class DatasetParams
120
121}; // namespace VAPoR
void SetScript(string script, const vector< string > &inputVarNames, const vector< string > &outputVarNames, const vector< string > &outputVarMeshes, bool coordFlag)
ScriptParams(ParamsBase::StateSave *ssave, XmlNode *node)
ScriptParams(ParamsBase::StateSave *ssave)
void GetScript(string &script, vector< string > &inputVarNames, vector< string > &outputVarNames, vector< string > &outputVarMeshes, bool &coordFlag)
static string GetClassType()
bool GetScript(string name, string &script, vector< string > &inputVarNames, vector< string > &outputVarNames, vector< string > &outputVarMeshes, bool &coordFlag) const
void SetScript(string name, string script, const vector< string > &inputVarNames, const vector< string > &outputVarNames, const vector< string > &outputVarMeshes, bool coordFlag)
DatasetParams(const DatasetParams &rhs)
vector< string > GetScriptNames() const
DatasetParams(ParamsBase::StateSave *ssave, XmlNode *node)
void RemoveScript(string name)
virtual ~DatasetParams()
DatasetParams(ParamsBase::StateSave *ssave)
DatasetParams & operator=(const DatasetParams &rhs)
DatasetsParams(ParamsBase::StateSave *ssave)
DatasetsParams & operator=(const DatasetsParams &rhs)
static string GetClassType()
DatasetsParams(ParamsBase::StateSave *ssave, XmlNode *node)
void RemoveDataset(string datasetName)
vector< string > GetScriptNames(string datasetName) const
DatasetsParams(const DatasetsParams &rhs)
bool GetScript(string datasetName, string name, string &script, vector< string > &inputVarNames, vector< string > &outputVarNames, vector< string > &outputVarMeshes, bool &coordFlag) const
void RemoveScript(string datasetName, string scriptName)
void SetScript(string datasetName, string name, string script, const vector< string > &inputVarNames, const vector< string > &outputVarNames, const vector< string > &outputVarMeshes, bool coordFlag)
State capture class.
Definition: ParamsBase.h:62
Nodes with state in Xml tree representation.
Definition: ParamsBase.h:50
An Xml tree.
Definition: XmlNode.h:49
#define PARAMS_API
Definition: common.h:77