VAPOR3 3.9.4
AnnotationParams.h
Go to the documentation of this file.
1//************************************************************************
2// *
3// Copyright (C) 2015 *
4// University Corporation for Atmospheric Research *
5// All Rights Reserved *
6// *
7//************************************************************************/
8//
9// File: AnnotationParams.h
10//
11// Author: Scott Pearse
12// Alan Norton
13// National Center for Atmospheric Research
14// PO 3000, Boulder, Colorado
15//
16// Date: June 2015
17//
18// Description: Defines the AnnotationParams class.
19// This class supports parameters associted with the
20// vizfeature panel, describing the visual features in the visualizer
21//
22#ifndef ANNOTATIONPARAMS_H
23#define ANNOTATIONPARAMS_H
24
25#include <vector>
26
27#include <vapor/common.h>
28#include <vapor/ParamsBase.h>
30
31using namespace Wasp;
32
33namespace VAPoR {
34
35class XmlNode;
36
43
52public:
54 //
56
58 //
60
62 //
64
65 virtual ~AnnotationParams(){};
66
67 void GetDomainColor(double color[3]) const;
68 void GetDomainColor(std::vector<double> &color) const { _getColor(color, _domainColorTag); }
69
70 void SetDomainColor(vector<double> color);
71
72 bool GetUseDomainFrame() const { return (0 != GetValueLong(_domainFrameTag, (long)false)); }
73 void SetUseDomainFrame(bool onOff) { SetValueLong(_domainFrameTag, "toggle domain frame", (long)onOff); }
74
75 bool GetUseRegionFrame() const { return (0 != GetValueLong(_regionFrameTag, (long)false)); }
76 void SetUseRegionFrame(bool onOff) { SetValueLong(_regionFrameTag, "toggle region frame", (long)onOff); }
77
78 void GetRegionColor(double color[3]) const;
79 void GetRegionColor(std::vector<double> &color) const { _getColor(color, _regionColorTag); }
80
81 void SetRegionColor(vector<double> color);
82
83 void GetBackgroundColor(double color[3]) const;
84 void GetBackgroundColor(std::vector<double> &color) const { _getColor(color, _backgroundColorTag); }
85
86 void SetBackgroundColor(std::vector<double> color);
87
89 void SetCurrentAxisDataMgrName(string dataMgr = "default");
90
92
93 void SetAxisFontSize(int size);
95
96 double GetTimeLLX() const;
97 void SetTimeLLX(double llx);
98
99 double GetTimeLLY() const;
100 void SetTimeLLY(double lly);
101
102 std::vector<double> GetTimeColor() const;
103 template<typename T> void GetTimeColor(T color[]) const { m_getColor(color, _timeColorTag); };
104 void SetTimeColor(std::vector<double> color);
105
106 int GetTimeType() const;
107 void SetTimeType(int type);
108
109 int GetTimeSize() const;
110 void SetTimeSize(int size);
111
112
114 double GetAxisArrowSize() const;
115 double GetAxisArrowXPos() const;
116 double GetAxisArrowYPos() const;
117
118 void SetAxisArrowEnabled(bool enabled);
119 void SetAxisArrowSize(double pos);
120 void SetAxisArrowXPos(double pos);
121 void SetAxisArrowYPos(double pos);
122
123 static string GetClassType() { return ("AnnotationParams"); }
124
125 static const string AxisArrowSizeTag;
126 static const string AxisArrowXPosTag;
127 static const string AxisArrowYPosTag;
128 static const string AxisArrowEnabledTag;
129
130private:
131 ParamsContainer *_axisAnnotations;
132
133public:
134 static const string _domainColorTag;
135 static const string _domainFrameTag;
136 static const string _regionFrameTag;
137 static const string _regionColorTag;
138
139 static const string _axisColorTag;
140 static const string _axisDigitsTag;
141 static const string _axisTextHeightTag;
142 static const string _axisFontSizeTag;
143 static const string _ticWidthTag;
144 static const string _ticDirsTag;
145 static const string _ticSizeTag;
146 static const string _minTicsTag;
147 static const string _maxTicsTag;
148 static const string _numTicsTag;
149 static const string _axisOriginTag;
150 static const string _backgroundColorTag;
151 static const string _axisAnnotationEnabledTag;
152 static const string _axisAnnotationsTag;
153 static const string _latLonAxesTag;
154
155 static const string _currentAxisDataMgrTag;
156 static vector<double> _previousStretch;
157
158 static const string _timeLLXTag;
159 static const string _timeLLYTag;
160 static const string _timeColorTag;
161 static const string _timeTypeTag;
162 static const string _timeSizeTag;
163
164 static const string _projStringTag;
165
166private:
167 void _init();
168
169 template<typename T> void m_getColor(T color[3], string tag) const
170 {
171 vector<double> defaultv(3, 1.0);
172 vector<double> val = GetValueDoubleVec(tag, defaultv);
173 for (int i = 0; i < val.size(); i++) {
174 color[i] = val[i];
175 if (color[i] < 0.0) color[i] = 0.0;
176 if (color[i] > 1.0) color[i] = 1.0;
177 }
178 }
179 // void m_getColor(double color[3], string tag) const;
180 void _getColor(vector<double> &color, string tag) const;
181 void m_setColor(vector<double> color, string tag, string msg);
182};
183
184}; // namespace VAPoR
185#endif // ANNOTATIONPARAMS_H
A class for describing visual features displayed in the visualizer.
static const string _timeColorTag
void SetDomainColor(vector< double > color)
void SetAxisArrowSize(double pos)
static const string _timeSizeTag
void SetAxisArrowEnabled(bool enabled)
static const string _maxTicsTag
static const string AxisArrowEnabledTag
static const string _ticDirsTag
void SetAxisArrowXPos(double pos)
AnnotationParams(ParamsBase::StateSave *ssave, XmlNode *node)
Create a AnnotationParams object from an existing XmlNode tree.
static const string _numTicsTag
static const string AxisArrowXPosTag
void GetRegionColor(double color[3]) const
void SetTimeLLX(double llx)
static vector< double > _previousStretch
void SetRegionColor(vector< double > color)
static const string _latLonAxesTag
void GetRegionColor(std::vector< double > &color) const
static const string AxisArrowSizeTag
string GetCurrentAxisDataMgrName() const
void SetTimeSize(int size)
bool GetAxisArrowEnabled() const
void GetTimeColor(T color[]) const
static string GetClassType()
static const string _backgroundColorTag
static const string _currentAxisDataMgrTag
double GetAxisArrowYPos() const
static const string _axisTextHeightTag
void GetDomainColor(std::vector< double > &color) const
void SetCurrentAxisDataMgrName(string dataMgr="default")
void SetUseDomainFrame(bool onOff)
std::vector< double > GetTimeColor() const
AxisAnnotation * GetAxisAnnotation()
double GetAxisArrowSize() const
static const string _domainFrameTag
double GetTimeLLY() const
void SetAxisFontSize(int size)
static const string _ticWidthTag
AnnotationParams(const AnnotationParams &rhs)
Copy from already existing instance.
static const string _axisFontSizeTag
void GetDomainColor(double color[3]) const
double GetTimeLLX() const
AnnotationParams(ParamsBase::StateSave *ssave)
Create a AnnotationParams object from scratch.
static const string _axisAnnotationEnabledTag
static const string _domainColorTag
void SetUseRegionFrame(bool onOff)
static const string _axisAnnotationsTag
static const string _axisColorTag
static const string _axisDigitsTag
bool GetUseRegionFrame() const
static const string _timeLLXTag
void SetBackgroundColor(std::vector< double > color)
static const string _ticSizeTag
static const string _minTicsTag
double GetAxisArrowXPos() const
static const string _regionFrameTag
void GetBackgroundColor(double color[3]) const
static const string _projStringTag
bool GetUseDomainFrame() const
static const string _timeTypeTag
void SetTimeLLY(double lly)
void GetBackgroundColor(std::vector< double > &color) const
static const string AxisArrowYPosTag
static const string _axisOriginTag
void SetTimeType(int type)
void SetTimeColor(std::vector< double > color)
static const string _timeLLYTag
static const string _regionColorTag
void SetAxisArrowYPos(double pos)
class that indicates location and direction of view
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
Definition: CFuncs.h:31