29 #ifndef VIZWINPARAMS_H
30 #define VIZWINPARAMS_H
36 #include <vapor/common.h>
66 static int AddVizWin(
const std::string name,
int viznum,
int width,
int height);
71 static int RemoveVizWin(
int viz);
76 return ((
VizWinParams*)Params::GetParamsInstance(_vizWinParamsTag))->getCurrentVizWin();
82 return ((
VizWinParams*)Params::GetParamsInstance(_vizWinParamsTag))->setCurrentVizWin(viz);
88 int winnum = mapVizToWin(viznum);
89 if (winnum < 0)
return -1;
90 return ((
VizWinParams*)Params::GetParamsInstance(_vizWinParamsTag))->getWindowWidths()[winnum];
97 int winnum = mapVizToWin(viznum);
98 if (winnum < 0)
return -1;
99 return ((
VizWinParams*)Params::GetParamsInstance(_vizWinParamsTag))->getWindowHeights()[winnum];
107 int winnum = mapVizToWin(viznum);
108 if (winnum < 0)
return -1;
109 std::vector<long> widths = ((
VizWinParams*)Params::GetParamsInstance(_vizWinParamsTag))->getWindowWidths();
110 widths[winnum] = width;
111 return ((
VizWinParams*)Params::GetParamsInstance(_vizWinParamsTag))->setWindowWidths(widths);
118 int winnum = mapVizToWin(viznum);
119 if (winnum < 0)
return -1;
120 vector<long>heights = ((
VizWinParams*)Params::GetParamsInstance(_vizWinParamsTag))->getWindowHeights();
121 heights[winnum] = height;
122 return ((
VizWinParams*)Params::GetParamsInstance(_vizWinParamsTag))->setWindowHeights(heights);
130 int winnum = mapVizToWin(viznum);
131 if (winnum < 0)
return -1;
132 vector<string> names = ((
VizWinParams*)Params::GetParamsInstance(_vizWinParamsTag))->getWindowNames();
133 names[winnum] = name;
134 return ((
VizWinParams*)Params::GetParamsInstance(_vizWinParamsTag))->setWindowNames(names);
140 int winnum = mapVizToWin(viznum);
141 if (winnum < 0)
return _emptyString;
142 return ((
VizWinParams*)Params::GetParamsInstance(_vizWinParamsTag))->getWindowNames()[winnum];
148 return ((
VizWinParams*)Params::GetParamsInstance(_vizWinParamsTag))->getVisualizerNums().size();
153 return ((
VizWinParams*)Params::GetParamsInstance(_vizWinParamsTag))->getVisualizerNums();
160 if (_vizDirtyBits.size()== 0)
return;
161 if (viznum >= 0) _vizDirtyBits[viznum] = val;
162 else for (
int i = 0; i< _vizDirtyBits.size(); i++) _vizDirtyBits[i] = val;
169 return _vizDirtyBits[viznum];
187 virtual void Validate(
int type);
189 virtual void restart();
201 return GetValueLongVec(_visualizerNumsTag);
207 return GetValueLong(_currentWindowTag);
212 #ifndef DOXYGEN_SKIP_THIS
214 static const string _vizWinParamsTag;
215 static const string _shortName;
216 static const string _windowWidthsTag;
217 static const string _windowHeightsTag;
218 static const string _windowNamesTag;
219 static const string _currentWindowTag;
220 static const string _visualizerNumsTag;
221 static const string _emptyString;
227 static int mapVizToWin(
int viznum){
228 vector<long> viznums = ((
VizWinParams*)Params::GetParamsInstance(_vizWinParamsTag))->getVisualizerNums();
229 for (
int i = 0; i<viznums.size(); i++){
230 if (viznums[i] == viznum)
return i;
238 static int mapWinToViz(
int winnum){
239 vector<long> viznums = ((VizWinParams*)Params::GetParamsInstance(_vizWinParamsTag))->getVisualizerNums();
240 if (winnum < 0 || winnum >= viznums.size())
return -1;
241 return viznums[winnum];
245 int setCurrentVizWin(
int viz){
246 return SetValueLong(_currentWindowTag,
"Set current viz win",(
long)viz);
249 vector<long> getWindowWidths(){
250 return GetValueLongVec(_windowWidthsTag);
252 vector<long>getWindowHeights(){
253 return GetValueLongVec(_windowHeightsTag);
255 int setWindowWidths(
const vector<long> widths){
256 return SetValueLong(_windowWidthsTag,
"Set window widths",widths);
259 int setWindowHeights(
const vector<long>& heights){
260 return SetValueLong(_windowHeightsTag,
"Set window heights",heights);
263 int setVisualizerNums(
const vector<long>& viznums){
264 return SetValueLong(_visualizerNumsTag,
"Set visualizer numbers",viznums);
266 vector<string> getWindowNames(){
267 std::vector<string> names;
268 GetValueStringVec(_windowNamesTag,names);
270 for (
int i = 0; i<names.size(); i++){
271 std::replace(names[i].begin(),names[i].end(),
'_',
' ');
275 int setWindowNames(
const vector<string> names){
277 vector<string> namemod = names;
278 for (
int i = 0; i<namemod.size(); i++){
279 std::replace(namemod[i].begin(),namemod[i].end(),
' ',
'_');
281 return SetValueStringVec(_windowNamesTag,
" Set visualizer names", namemod);
283 static vector<bool> _vizDirtyBits;
285 #endif //DOXYGEN_SKIP_THIS
289 #endif //VIZWINPARAMS_H
static int GetWindowHeight(int viznum)
static void SetVizDirty(int viznum, bool val=true)
static int SetWindowWidth(int viznum, int width)
static int SetWindowHeight(int viznum, int height)
Nodes with state in Xml tree representation.
A class for describing the vizualization windows in use in VAPOR.
static ParamsBase * CreateDefaultInstance()
static bool VizIsDirty(int viznum)
static int GetWindowWidth(int viznum)
static vector< long > GetVisualizerNums()
static string GetVizName(int viznum)
static int GetCurrentVizWin()
static int SetCurrentVizWin(int viz)
static int SetVizName(int viznum, string name)
const std::string getShortName()
static int GetNumVizWins()
A Params subclass for Params classes with one unique instance.
vector< long > getVisualizerNums()