VAPOR3 3.9.4
GUIStateParams.h
Go to the documentation of this file.
1//************************************************************************
2// *
3// Copyright (C) 2016 *
4// University Corporation for Atmospheric Research *
5// All Rights Reserved *
6// *
7//************************************************************************/
8//
9// File: GUIStateParams
10//
11// Author: John Clyne
12// National Center for Atmospheric Research
13// PO 3000, Boulder, Colorado
14//
15// Date: August 2016
16//
17// Description: Maintains various GUI state settings
18//
19#ifndef GUISTATEPARAMS_H
20#define GUISTATEPARAMS_H
21
22#include <vapor/ParamsBase.h>
23
24class MouseModeParams;
25class BookmarkParams;
26
28public:
30
32
34
36
37 virtual ~GUIStateParams();
38
39 string GetActiveVizName() const;
40 void SetActiveVizName(string vizWin);
41
43 //
44 void GetActiveRenderer(string vizWin, string &renderType, string &renderInst) const;
45 string GetActiveRendererInst() const;
46
48 //
49 void SetActiveRenderer(string vizWin, string renderType, string renderInst);
50
51 string GetActiveDataset() const ;
52 void SetActiveDataset(string name);
53
56 string GetCurrentSessionFile() const;
57
60 void SetCurrentSessionFile(string path);
61
64 std::vector<string> GetOpenDataSetNames() const { return (m_openDataSets->GetNames()); }
65
66 std::vector<string> GetOpenDataSetPaths(string dataSetName) const;
67 std::vector<string> GetOpenDataSetRelativePaths(string dataSetName) const;
68
69 string GetOpenDataSetFormat(string dataSetName) const;
70
71 void RemoveOpenDateSet(string dataSetName) { m_openDataSets->Remove(dataSetName); }
72
73 void InsertOpenDateSet(string dataSetName, string format, const std::vector<string> &paths, const std::vector<string> &relPaths={});
74
77 void SetOpenDataSets(const std::vector<string> &paths, const std::vector<string> &names);
78
81 string GetCurrentImagePath() const;
82
85 void SetCurrentImagePath(string path);
86
90
93 void SetCurrentImageSavePath(string path);
94
98
101 void SetCurrentTFPath(string path);
102
105 string GetCurrentPythonPath() const;
106
109 void SetCurrentPythonPath(string path);
110
113 string GetCurrentFlowPath() const;
114
117 void SetCurrentFlowPath(string path);
118
120
123 std::string GetStatsDatasetName() const;
124 void SetStatsDatasetName(std::string &name);
125
128 std::string GetPlotDatasetName() const;
129 void SetPlotDatasetName(std::string &name);
130
131 string ActiveTab() const;
132 void SetActiveTab(const string &t);
133
135 void SetFlowDimensionality(int nDims);
136
137 void SetProjectionString(string proj4String) { SetValueString(m_proj4StringTag, "Set Proj4 projection string", proj4String); }
138
139 string GetProjectionString() const
140 {
141 string defaultv;
142 return (GetValueString(m_proj4StringTag, defaultv));
143 }
144
145 class DataSetParam : public ParamsBase {
146 public:
147 DataSetParam(VAPoR::ParamsBase::StateSave *ssave) : ParamsBase(ssave, DataSetParam::GetClassType()) {}
148
149 DataSetParam(VAPoR::ParamsBase::StateSave *ssave, VAPoR::XmlNode *node) : ParamsBase(ssave, node) {}
150
151 virtual ~DataSetParam(){};
152
153 void SetPaths(const std::vector<string> &paths) { SetValueStringVec(m_dataSetPathsTag, "Data set paths", paths); }
154
155 std::vector<string> GetPaths() const { return (GetValueStringVec(m_dataSetPathsTag)); };
156
157 void SetRelativePaths(const std::vector<string> &paths) { SetValueStringVec(m_dataSetRelativePathsTag, "Data set relative paths", paths); }
158 std::vector<string> GetRelativePaths() const { return (GetValueStringVec(m_dataSetRelativePathsTag)); };
159 bool HasRelativePaths() const { return !GetRelativePaths().empty(); };
160
161 void SetFormat(string format) { SetValueString(m_dataSetFormatTag, "Data set format", format); }
162
163 string GetFormat() const { return (GetValueString(m_dataSetFormatTag, "vdc")); }
164
165 static string GetClassType() { return ("DataSetParam"); }
166
167 private:
168 static const string m_dataSetPathsTag;
169 static const string m_dataSetRelativePathsTag;
170 static const string m_dataSetFormatTag;
171 };
172
173 // Get static string identifier for this params class
174 //
175 static string GetClassType() { return ("GUIStateParams"); }
176
179 void SetBookmarks(const vector<BookmarkParams *> &all);
180 void DeleteBookmark(int i);
182 vector<BookmarkParams *> GetBookmarks() const;
183 int GetNumBookmarks() const;
185
186private:
187 class ActiveRenderer : public ParamsBase {
188 public:
189 ActiveRenderer(VAPoR::ParamsBase::StateSave *ssave) : ParamsBase(ssave, ActiveRenderer::GetClassType()) {}
190
191 ActiveRenderer(VAPoR::ParamsBase::StateSave *ssave, VAPoR::XmlNode *node) : ParamsBase(ssave, node) {}
192
193 virtual ~ActiveRenderer(){};
194
195 void SetActiveRenderer(string vizWin, string renderType, string renderInst);
196
197 void GetActiveRenderer(string vizWin, string &renderType, string &renderInst) const;
198
199 static string GetClassType() { return ("ActiveRenderer"); }
200 };
201
202 ActiveRenderer *m_activeRenderer;
203
204public:
205 static const string m_activeVisualizer;
206 static const string m_pathParamsTag;
207 static const string m_sessionFileTag;
208 static const string m_imagePathTag;
209 static const string m_imageSavePathTag;
210 static const string m_pythonPathTag;
211 static const string m_flowPathTag;
212 static const string m_tfPathTag;
213 static const string m_statsDatasetNameTag;
214 static const string m_plotDatasetNameTag;
215 static const string m_proj4StringTag;
216 static const string m_openDataSetsTag;
217 static const string _flowDimensionalityTag;
218 static const string BookmarksTag;
219 static const string MovingDomainTrackCameraTag;
221
222private:
223 MouseModeParams *m_mouseModeParams;
224
225 VAPoR::ParamsContainer *m_openDataSets;
226 VAPoR::ParamsContainer *_bookmarks;
227
228 void _init();
229};
230
231#endif // GUISTATEPARAMS_H
void SetPaths(const std::vector< string > &paths)
DataSetParam(VAPoR::ParamsBase::StateSave *ssave, VAPoR::XmlNode *node)
DataSetParam(VAPoR::ParamsBase::StateSave *ssave)
std::vector< string > GetRelativePaths() const
std::vector< string > GetPaths() const
void SetFormat(string format)
void SetRelativePaths(const std::vector< string > &paths)
std::string GetStatsDatasetName() const
string GetProjectionString() const
void SetFlowDimensionality(int nDims)
int GetNumBookmarks() const
string GetActiveDataset() const
void SetCurrentImageSavePath(string path)
void GetActiveRenderer(string vizWin, string &renderType, string &renderInst) const
Get active renderer class and instance name for a visualizer.
static const string m_pathParamsTag
std::string GetPlotDatasetName() const
void SetActiveRenderer(string vizWin, string renderType, string renderInst)
Get active renderer class and instance name for a visualizer.
static const string m_flowPathTag
string GetCurrentSessionFile() const
void SetPlotDatasetName(std::string &name)
static const string m_sessionFileTag
void SetProjectionString(string proj4String)
void ClearBookmarks()
vector< BookmarkParams * > GetBookmarks() const
static const string m_statsDatasetNameTag
void SetCurrentFlowPath(string path)
void SetActiveDataset(string name)
static const string BookmarksTag
string GetCurrentImagePath() const
GUIStateParams(VAPoR::ParamsBase::StateSave *ssave, VAPoR::XmlNode *node)
static const string m_proj4StringTag
GUIStateParams(VAPoR::ParamsBase::StateSave *ssave)
void SetCurrentPythonPath(string path)
MouseModeParams * GetMouseModeParams() const
GUIStateParams & operator=(const GUIStateParams &rhs)
string GetCurrentTFPath()
string GetActiveRendererInst() const
void RemoveOpenDateSet(string dataSetName)
int GetFlowDimensionality() const
BookmarkParams * GetBookmark(int i) const
string GetOpenDataSetFormat(string dataSetName) const
string GetCurrentImageSavePath() const
static const string m_imagePathTag
static const string _flowDimensionalityTag
string GetCurrentFlowPath() const
static const string m_pythonPathTag
void InsertOpenDateSet(string dataSetName, string format, const std::vector< string > &paths, const std::vector< string > &relPaths={})
std::vector< string > GetOpenDataSetRelativePaths(string dataSetName) const
void SetCurrentSessionFile(string path)
void SetBookmarks(const vector< BookmarkParams * > &all)
GUIStateParams(const GUIStateParams &rhs)
static const string MovingDomainTrackRenderRegionsTag
void SetCurrentTFPath(string path)
void DeleteBookmark(int i)
string ActiveTab() const
void SetCurrentImagePath(string path)
void SetOpenDataSets(const std::vector< string > &paths, const std::vector< string > &names)
void AddBookmark(BookmarkParams *bookmark)
std::vector< string > GetOpenDataSetNames() const
static const string m_tfPathTag
static const string m_imageSavePathTag
void SetActiveTab(const string &t)
void SetActiveVizName(string vizWin)
BookmarkParams * CreateBookmark()
string GetActiveVizName() const
void SetStatsDatasetName(std::string &name)
static string GetClassType()
std::vector< string > GetOpenDataSetPaths(string dataSetName) const
static const string MovingDomainTrackCameraTag
string GetCurrentPythonPath() const
static const string m_plotDatasetNameTag
virtual ~GUIStateParams()
static const string m_activeVisualizer
static const string m_openDataSetsTag
A class for describing mouse modes in use in VAPOR.
State capture class.
Definition: ParamsBase.h:62
Nodes with state in Xml tree representation.
Definition: ParamsBase.h:50
virtual void SetValueString(const string &tag, string description, const string &value)
virtual string GetValueString(const string tag, string defaultVal) const
An Xml tree.
Definition: XmlNode.h:49
#define PARAMS_API
Definition: common.h:77