Skip to content

Commit dc11942

Browse files
committed
refactoring to ReosGriddedDataProvider
1 parent 04fd14b commit dc11942

File tree

2 files changed

+17
-23
lines changed

2 files changed

+17
-23
lines changed

src/core/data/reosgriddedrainfallprovider.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,9 @@ QString ReosGriddedRainfallMemoryProviderFactory::key() const
168168
ReosGriddedRainfallProvider::~ReosGriddedRainfallProvider()
169169
{}
170170

171-
const QVector<double> ReosGriddedRainfallProvider::qualifData( int ) const {return QVector<double>();}
172-
173171
ReosGriddedDataProvider::~ReosGriddedDataProvider()
174172
{}
175173

176-
bool ReosGriddedRainfallProvider::write( ReosGriddedRainfall *, const QString &, const ReosRasterExtent &, const ReosTimeWindow & ) const {return false;}
177-
178-
179174
ReosGriddedRainfallProvider *ReosGriddedRainfallMemoryProvider::clone() const
180175
{
181176
std::unique_ptr<ReosGriddedRainfallMemoryProvider> other = std::make_unique<ReosGriddedRainfallMemoryProvider>();

src/core/data/reosgriddedrainfallprovider.h

+17-18
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ class REOSCORE_EXPORT ReosGriddedDataProvider : public ReosDataProvider
5353
Q_DECLARE_FLAGS( GridCapabilities, GridCapability )
5454
Q_FLAG( GridCapabilities )
5555

56+
enum class ValueType
57+
{
58+
Instantaneous,
59+
CumulativeOnTimeStep,
60+
Cumulative
61+
};
62+
5663
struct FileDetails
5764
{
5865
QStringList availableVariables;
@@ -104,9 +111,19 @@ class REOSCORE_EXPORT ReosGriddedDataProvider : public ReosDataProvider
104111

105112
virtual void exportToTiff( int index, const QString &fileName ) const {};
106113

114+
virtual bool write(
115+
ReosGriddedRainfall *rainfall,
116+
const QString &uri,
117+
const ReosRasterExtent &destination,
118+
const ReosTimeWindow &timeWindow ) const {return false;}
119+
120+
virtual const QVector<double> qualifData( int ) const {return QVector<double>();}
107121
protected:
108122
QString mDataSource;
109123

124+
protected:
125+
ValueType mSourceValueType = ValueType::CumulativeOnTimeStep;
126+
110127
mutable int mLastFrameIndex = -1;
111128

112129

@@ -117,27 +134,9 @@ class REOSCORE_EXPORT ReosGriddedRainfallProvider : public ReosGriddedDataProvid
117134
{
118135
Q_OBJECT
119136
public:
120-
enum class ValueType
121-
{
122-
Intensity,
123-
Height,
124-
CumulativeHeight
125-
};
126-
127137
~ReosGriddedRainfallProvider();
128-
129138
virtual ReosGriddedRainfallProvider *clone() const = 0;
130139

131-
virtual bool write(
132-
ReosGriddedRainfall *rainfall,
133-
const QString &uri,
134-
const ReosRasterExtent &destination,
135-
const ReosTimeWindow &timeWindow ) const;
136-
virtual const QVector<double> qualifData( int ) const;
137-
138-
protected:
139-
ValueType mSourceValueType = ValueType::Height;
140-
141140
};
142141

143142
class REOSCORE_EXPORT ReosGriddedRainfallMemoryProvider : public ReosGriddedRainfallProvider

0 commit comments

Comments
 (0)