VAPOR3 3.9.4
AnnotationsParams.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: AnnotationsParams.h
10//
11// Author: Alan Norton
12// National Center for Atmospheric Research
13// PO 3000, Boulder, Colorado
14//
15// Date: June 2015
16//
17// Description: Defines the AnnotationsParams class.
18// This class supports parameters associted with the
19// vizfeature panel, describing the visual features in the visualizer
20//
21#ifndef ANNOTATIONSPARAMS_H
22#define ANNOTATIONSPARAMS_H
23
24#include <vector>
25
26#include <vapor/common.h>
27#include <vapor/ParamsBase.h>
29
30using namespace Wasp;
31
32namespace VAPoR {
33
34class XmlNode;
35
42
51public:
53 //
55
57 //
59
61 //
63
64 virtual ~AnnotationsParams(){};
65
67 void GetDomainColor(double color[3]) const;
68 void GetDomainColor(std::vector<double> &color) const { _getColor(color, _domainColorTag); }
69
71 void SetDomainColor(vector<double> color);
72
73 bool GetUseDomainFrame() const { return (0 != GetValueLong(_domainFrameTag, (long)false)); }
74 void SetUseDomainFrame(bool onOff) { SetValueLong(_domainFrameTag, "toggle domain frame", (long)onOff); }
75
76 bool GetUseRegionFrame() const { return (0 != GetValueLong(_regionFrameTag, (long)false)); }
77 void SetUseRegionFrame(bool onOff) { SetValueLong(_regionFrameTag, "toggle region frame", (long)onOff); }
78
80 void GetRegionColor(double color[3]) const;
81 void GetRegionColor(std::vector<double> &color) const { _getColor(color, _regionColorTag); }
82
84 void SetRegionColor(vector<double> color);
85
87 void GetBackgroundColor(double color[3]) const;
88 void GetBackgroundColor(std::vector<double> &color) const { _getColor(color, _backgroundColorTag); }
89
91 void SetBackgroundColor(std::vector<double> color);
92
94 void SetCurrentAxisDataMgrName(string dataMgr);
95
96 AxisAnnotation *GetAxisAnnotation(string dataMgr = "");
97
98 void SetAxisArrowCoords(std::vector<double> coords);
99 std::vector<double> GetAxisArrowCoords() const;
100
101 bool GetShowAxisArrows() const;
102 void SetShowAxisArrows(bool val);
103
104 void SetAxisFontSize(int size);
106
107 // Get static string identifier for this params class
108 //
109 static string GetClassType() { return ("AnnotationsParams"); }
110
111private:
112#ifdef VAPOR3_0_0_ALPHA
113 static void changeStretch(vector<double> prevStretch, vector<double> newStretch);
114#endif
115
116 ParamsContainer *_axisAnnotations;
117
118 static const string _domainColorTag;
119 static const string _domainFrameTag;
120 static const string _regionFrameTag;
121 static const string _regionColorTag;
122
123 static const string _axisColorTag;
124 static const string _axisDigitsTag;
125 static const string _axisTextHeightTag;
126 static const string _axisFontSizeTag;
127 static const string _ticWidthTag;
128 static const string _ticDirsTag;
129 static const string _ticSizeTag;
130 static const string _minTicsTag;
131 static const string _maxTicsTag;
132 static const string _numTicsTag;
133 static const string _axisOriginTag;
134 static const string _backgroundColorTag;
135 static const string _axisAnnotationEnabledTag;
136 static const string _axisAnnotationsTag;
137 static const string _latLonAxesTag;
138
139 static const string _axisArrowCoordsTag;
140 static const string _showAxisArrowsTag;
141 static const string _currentAxisDataMgrTag;
142 static vector<double> _previousStretch;
143
144 void _init();
145
146 void m_getColor(double color[3], string tag) const;
147 void _getColor(vector<double> &color, string tag) const;
148 void m_setColor(vector<double> color, string tag, string msg);
149};
150
151}; // namespace VAPoR
152#endif // ANNOTATIONSPARAMS_H
A class for describing visual features displayed in the visualizer.
std::vector< double > GetAxisArrowCoords() const
void GetDomainColor(std::vector< double > &color) const
void SetShowAxisArrows(bool val)
void GetRegionColor(double color[3]) const
Obtain region frame color.
void GetBackgroundColor(std::vector< double > &color) const
string GetCurrentAxisDataMgrName() const
void SetRegionColor(vector< double > color)
Set region frame color.
AnnotationsParams(ParamsBase::StateSave *ssave)
Create a AnnotationsParams object from scratch.
void GetBackgroundColor(double color[3]) const
Obtain background color.
void SetUseRegionFrame(bool onOff)
void SetBackgroundColor(std::vector< double > color)
Set background color.
AnnotationsParams(const AnnotationsParams &rhs)
Copy from already existing instance.
void SetAxisArrowCoords(std::vector< double > coords)
AxisAnnotation * GetAxisAnnotation(string dataMgr="")
bool GetShowAxisArrows() const
void SetAxisFontSize(int size)
void GetDomainColor(double color[3]) const
Obtain domain frame color.
AnnotationsParams(ParamsBase::StateSave *ssave, XmlNode *node)
Create a AnnotationsParams object from an existing XmlNode tree.
void SetDomainColor(vector< double > color)
Set domain frame color.
void SetUseDomainFrame(bool onOff)
void GetRegionColor(std::vector< double > &color) const
void SetCurrentAxisDataMgrName(string dataMgr)
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