aboutsummaryrefslogtreecommitdiff
path: root/src/grids.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/grids.cpp')
-rw-r--r--src/grids.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/grids.cpp b/src/grids.cpp
index 54dae555..7d19b1f7 100644
--- a/src/grids.cpp
+++ b/src/grids.cpp
@@ -70,13 +70,24 @@ bool ExtentAndRes::fullWorldLongitude() const {
// ---------------------------------------------------------------------------
+Grid::Grid(int widthIn, int heightIn, const ExtentAndRes &extentIn)
+ : m_width(widthIn), m_height(heightIn), m_extent(extentIn) {}
+
+// ---------------------------------------------------------------------------
+
+Grid::~Grid() = default;
+
+// ---------------------------------------------------------------------------
+
VerticalShiftGrid::VerticalShiftGrid(int widthIn, int heightIn,
const ExtentAndRes &extentIn)
- : m_width(widthIn), m_height(heightIn), m_extent(extentIn) {}
+ : Grid(widthIn, heightIn, extentIn) {}
// ---------------------------------------------------------------------------
-VerticalShiftGrid::~VerticalShiftGrid() = default;
+bool VerticalShiftGrid::isNodata(float /*val*/, double /* multiplier */) const {
+ return false;
+}
// ---------------------------------------------------------------------------
@@ -98,6 +109,7 @@ class NullVerticalShiftGrid : public VerticalShiftGrid {
public:
NullVerticalShiftGrid() : VerticalShiftGrid(3, 3, globalExtent()) {}
+ bool isNullGrid() const override { return true; }
bool valueAt(int, int, float &out) const override;
bool isNodata(float, double) const override { return false; }
};
@@ -306,7 +318,7 @@ const VerticalShiftGrid *VerticalShiftGridSet::gridAt(double lon,
HorizontalShiftGrid::HorizontalShiftGrid(int widthIn, int heightIn,
const ExtentAndRes &extentIn)
- : m_width(widthIn), m_height(heightIn), m_extent(extentIn) {}
+ : Grid(widthIn, heightIn, extentIn) {}
// ---------------------------------------------------------------------------