VAPOR3 3.9.4
regionparams.h
Go to the documentation of this file.
1//************************************************************************
2// *
3// Copyright (C) 2004 *
4// University Corporation for Atmospheric Research *
5// All Rights Reserved *
6// *
7//************************************************************************/
8//
9// File: regionparams.h
10//
11// Author: Alan Norton
12// National Center for Atmospheric Research
13// PO 3000, Boulder, Colorado
14//
15// Date: September 2004
16//
17// Description: Defines the RegionParams class.
18// This class supports parameters associted with the
19// region panel, describing the rendering region
20//
21#ifndef REGIONPARAMS_H
22#define REGIONPARAMS_H
23
24#include <vapor/ParamsBase.h>
25#include <vapor/Box.h>
26
27namespace VAPoR {
28
35
45public:
47
49
51
53
54 virtual ~RegionParams();
55
59 virtual Box *GetBox() const { return m_Box; }
60
64
65#ifdef VAPOR3_0_0_ALPHA
66 void getLocalRegionExtents(double exts[6], int timestep) const
67 {
68 GetBox()->GetLocalExtents(exts, timestep);
69 return;
70 }
71
76 double getLocalRegionCenter(int indx, int timestep) const
77 {
78 if (indx < 0 || indx > 2) indx = 0;
79 return (0.5 * (getLocalRegionMin(indx, timestep) + getLocalRegionMax(indx, timestep)));
80 }
81#endif
82
83#ifdef VAPOR3_0_0_ALPHA
86 const vector<long> GetTimes() const { return GetBox()->GetTimes(); }
87
90 bool extentsAreVarying() { return GetBox()->GetTimes().size() > 1; }
91
95 bool insertTime(int timestep);
96
100 bool removeTime(int timestep);
101#endif
102
103#ifdef VAPOR3_0_0_ALPHA
107 vector<double> GetAllExtents() const { return GetBox()->GetLocalExtents(); }
108#endif
109
110#ifdef VAPOR3_0_0_ALPHA
115 static const vector<string> GetDomainVariables()
116 {
117 ((RegionParams *)_paramsMgr->GetParamsInstance(_regionParamsTag, -1, -1))->GetValueStringVec(_domainVariablesTag);
118 return vec;
119 }
124 static int SetDomainVariables(vector<string> varnames)
125 {
126 if (varnames.size() == 0) return -1;
127 return ((RegionParams *)_paramsMgr->GetParamsInstance(_regionParamsTag, -1, -1))->SetValueStringVec(_domainVariablesTag, "Set Domain-defining variables", varnames);
128 }
129#endif
130
131 // Get static string identifier for this params class
132 //
133 static string GetClassType() { return ("RegionParams"); }
134
135private:
136 Box *m_Box;
137
138 static const string _domainVariablesTag;
139
140 void _init();
141 void _reconcile();
142};
143
144}; // namespace VAPoR
145#endif // REGIONPARAMS_H
3D or 2D box with options for orientation angles .
Definition: Box.h:39
State capture class.
Definition: ParamsBase.h:62
Nodes with state in Xml tree representation.
Definition: ParamsBase.h:50
A class for describing a 3D axis-aligned region in user space.
Definition: regionparams.h:44
RegionParams(ParamsBase::StateSave *ssave, XmlNode *node)
RegionParams(const RegionParams &rhs)
virtual Box * GetBox() const
Definition: regionparams.h:59
static string GetClassType()
Definition: regionparams.h:133
virtual ~RegionParams()
RegionParams(ParamsBase::StateSave *ssave)
RegionParams & operator=(const RegionParams &rhs)
An Xml tree.
Definition: XmlNode.h:49
#define PARAMS_API
Definition: common.h:77