VAPOR3 3.9.4
ImageParams.h
Go to the documentation of this file.
1#ifndef IMAGEPARAMS_H
2#define IMAGEPARAMS_H
3
5#include <vapor/DataMgr.h>
6#include <vapor/TMSUtils.h>
7
8namespace VAPoR {
9
11public:
12 ImageParams(DataMgr *dataManager, ParamsBase::StateSave *stateSave);
13 ImageParams(DataMgr *dataManager, ParamsBase::StateSave *stateSave, XmlNode *xmlNode);
14
15 virtual ~ImageParams();
16
17 virtual int Initialize() override;
18
19 static std::string GetClassType() { return ("ImageParams"); }
20
22 //
23 virtual size_t GetRenderDim() const override { return (2); }
24
27 void SetImagePath(std::string file)
28 {
29 BeginGroup("Set image path");
30 SetValueString(_fileNameTag, "Set image file path", file);
31 if (Wasp::TMSUtils::IsTMSFile(file)) {
32 int numTMSLODs = Wasp::TMSUtils::GetNumTMSLODs(file);
33 _setNumTMSLODs(numTMSLODs);
34 }
35 EndGroup();
36 }
37
40 std::string GetImagePath() const;
41
45 bool GetIsGeoRef() const { return (GetValueLong(_isGeoRefTag, (long)true)); }
46
50 void SetIsGeoRef(bool val) { SetValueLong(_isGeoRefTag, "Geo-reference the image", (long)val); }
51
55 bool GetIgnoreTransparency() const { return (0 != GetValueLong(_ignoreTransparencyTag, (long)false)); }
56
60 void SetIgnoreTransparency(bool val) { SetValueLong(_ignoreTransparencyTag, "if transparence is ignored", (long)val); }
61
62 //
63 // Get and set opacity value
64 //
65 /*
66 double GetOpacity() const
67 {
68 return GetValueDouble( _opacityTag, 1.0 );
69 }
70 void SetOpacity( double val )
71 {
72 SetValueDouble( _opacityTag, "set opacity value", val );
73 }
74 */
75
76 //
77 // Get and set orientation
78 //
79 int GetOrientation() const { return GetValueLong(_orientationTag, 2); }
80 void SetOrientation(int val) { SetValueLong(_orientationTag, "set orientation value", val); }
81
84 int GetTMSLOD() const
85 {
86 int value = ((int)GetValueLong(_TMSLODTag, -1));
87 return value;
88 }
89
92 void SetTMSLOD(int val) { SetValueLong(_TMSLODTag, "TMS level of detail", (long)val); }
93
96 int GetNumTMSLODs() const
97 {
98 int value = ((int)GetValueLong(_numTMSLODTag, 4));
99 return value;
100 }
101
103 virtual string GetActualColorMapVariableName() const override { return ""; }
104
105public:
106 static const std::string _fileNameTag;
107 static const std::string _isGeoRefTag;
108 static const std::string _ignoreTransparencyTag;
109 static const std::string _opacityTag;
110 static const std::string _TMSLODTag;
111 static const std::string _numTMSLODTag;
112 static const std::string _orientationTag; // If it's X-Y (orientation = 2)
113 // If it's X-Z (orientation = 1)
114 // If it's Y-Z (orientation = 0)
115
116private:
117 bool _initialized = false;
118
121 void _setNumTMSLODs(int val) { SetValueLong(_numTMSLODTag, "Number of TMS levels of detail", (long)val); }
122};
123} // namespace VAPoR
124
125#endif
A cache based data reader.
Definition: DataMgr.h:110
virtual ~ImageParams()
static const std::string _opacityTag
Definition: ImageParams.h:109
static const std::string _fileNameTag
Definition: ImageParams.h:106
static const std::string _TMSLODTag
Definition: ImageParams.h:110
ImageParams(DataMgr *dataManager, ParamsBase::StateSave *stateSave)
int GetOrientation() const
Definition: ImageParams.h:79
void SetTMSLOD(int val)
Definition: ImageParams.h:92
virtual size_t GetRenderDim() const override
Definition: ImageParams.h:23
virtual int Initialize() override
void SetImagePath(std::string file)
Definition: ImageParams.h:27
static const std::string _orientationTag
Definition: ImageParams.h:112
static std::string GetClassType()
Definition: ImageParams.h:19
int GetNumTMSLODs() const
Definition: ImageParams.h:96
virtual string GetActualColorMapVariableName() const override
Definition: ImageParams.h:103
void SetOrientation(int val)
Definition: ImageParams.h:80
std::string GetImagePath() const
static const std::string _isGeoRefTag
Definition: ImageParams.h:107
bool GetIgnoreTransparency() const
Definition: ImageParams.h:55
void SetIsGeoRef(bool val)
Definition: ImageParams.h:50
bool GetIsGeoRef() const
Definition: ImageParams.h:45
void SetIgnoreTransparency(bool val)
Definition: ImageParams.h:60
static const std::string _ignoreTransparencyTag
Definition: ImageParams.h:108
static const std::string _numTMSLODTag
Definition: ImageParams.h:111
ImageParams(DataMgr *dataManager, ParamsBase::StateSave *stateSave, XmlNode *xmlNode)
int GetTMSLOD() const
Definition: ImageParams.h:84
State capture class.
Definition: ParamsBase.h:62
A Params subclass for managing parameters used by Renderers.
Definition: RenderParams.h:43
An Xml tree.
Definition: XmlNode.h:49
#define PARAMS_API
Definition: common.h:77
COMMON_API int GetNumTMSLODs(std::string file)
COMMON_API bool IsTMSFile(std::string path)