From 5759084d3699c7a8035ded4532e2b038d22cf3b3 Mon Sep 17 00:00:00 2001 From: Vaclav Blazek Date: Thu, 28 Nov 2019 11:38:45 +0100 Subject: [PATCH] better defaults handling --- mapproxy/src/mapproxy/generator/metatile.hpp | 18 +++++------------- .../src/mapproxy/generator/surface-dem.hpp | 2 +- mapproxy/src/mapproxy/generator/surface.hpp | 4 ++-- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/mapproxy/src/mapproxy/generator/metatile.hpp b/mapproxy/src/mapproxy/generator/metatile.hpp index 5dabfaf..23d1434 100644 --- a/mapproxy/src/mapproxy/generator/metatile.hpp +++ b/mapproxy/src/mapproxy/generator/metatile.hpp @@ -40,19 +40,13 @@ struct MetatileOverrides { enum class CreditsMode { replace, add }; - vts::SubMesh::TextureMode textureMode; + vts::SubMesh::TextureMode textureMode = vts::SubMesh::external; DualId::set credits; - CreditsMode creditsMode; - - MetatileOverrides() - : textureMode(vts::SubMesh::external) - , creditsMode(CreditsMode::add) - {} + CreditsMode creditsMode = CreditsMode::add; + MetatileOverrides() = default; MetatileOverrides(vts::SubMesh::TextureMode textureMode) : textureMode(textureMode) - , creditsMode(CreditsMode::add) - {} void addCredits(const DualId::set &addition); @@ -73,8 +67,7 @@ vts::MetaTile metatileFromDem(const vts::TileId &tileId, Sink &sink = boost::none , const HeightFunction::pointer &heightFunction = HeightFunction::pointer() - , const MetatileOverrides &overrides - = MetatileOverrides()); + , const MetatileOverrides &overrides = {}); vts::MetaTile metatileFromDem(const vts::TileId &tileId, Sink &sink , Arsenal &arsenal @@ -87,8 +80,7 @@ vts::MetaTile metatileFromDem(const vts::TileId &tileId, Sink &sink = boost::none , const HeightFunction::pointer &heightFunction = HeightFunction::pointer() - , const MetatileOverrides &overrides - = MetatileOverrides()); + , const MetatileOverrides &overrides = {}); // inines diff --git a/mapproxy/src/mapproxy/generator/surface-dem.hpp b/mapproxy/src/mapproxy/generator/surface-dem.hpp index 6f9d570..1f54a00 100644 --- a/mapproxy/src/mapproxy/generator/surface-dem.hpp +++ b/mapproxy/src/mapproxy/generator/surface-dem.hpp @@ -70,7 +70,7 @@ class SurfaceDem : public SurfaceBase { vts::MetaTile generateMetatileImpl(const vts::TileId &tileId , Sink &sink, Arsenal &arsenal , const MetatileOverrides &overrides - = MetatileOverrides()) + = {}) const; void addToRegistry(); diff --git a/mapproxy/src/mapproxy/generator/surface.hpp b/mapproxy/src/mapproxy/generator/surface.hpp index 71a11e3..b8842a4 100644 --- a/mapproxy/src/mapproxy/generator/surface.hpp +++ b/mapproxy/src/mapproxy/generator/surface.hpp @@ -73,8 +73,8 @@ class SurfaceBase : public Generator { , Sink &sink , const SurfaceFileInfo &fileInfo , Arsenal &arsenal - , const MetatileOverrides &overrides - = MetatileOverrides()) const = 0; + , const MetatileOverrides &overrides = {}) + const = 0; void generateMesh(const vts::TileId &tileId , Sink &sink