diff options
author | Sudarsana Babu Nagineni <sudarsana.babu@mapbox.com> | 2019-03-06 14:30:23 +0200 |
---|---|---|
committer | Sudarsana Babu Nagineni <sudarsana.babu@mapbox.com> | 2019-03-08 17:36:40 +0200 |
commit | 744d92e7636ffcba7aea7a302315326b1098d8dc (patch) | |
tree | 11df789f9b6dc0913b3d95f1debbfd87c9225a6a /include | |
parent | c6598fc5da063f9b60204639cd619647cbbc89da (diff) | |
download | qtlocation-mapboxgl-744d92e7636ffcba7aea7a302315326b1098d8dc.tar.gz |
[core] consolidate Axonometric rendering API
Instead of having individual APIs for setting axonometric
and skew options, create ProjectionMode struct that holds
all the relevant options for Axonometric rendering and
introduce setter/getter on the Map for those options.
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/map/map.hpp | 11 | ||||
-rw-r--r-- | include/mbgl/map/projection_mode.hpp | 34 |
2 files changed, 38 insertions, 7 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 55f2ab2895..1450b0b3ed 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -9,6 +9,7 @@ #include <mbgl/annotation/annotation.hpp> #include <mbgl/map/camera.hpp> #include <mbgl/util/geometry.hpp> +#include <mbgl/map/projection_mode.hpp> #include <cstdint> #include <string> @@ -101,13 +102,9 @@ public: void setViewportMode(ViewportMode); ViewportMode getViewportMode() const; - // Projection mode - void setAxonometric(bool); - bool getAxonometric() const; - void setXSkew(double ySkew); - double getXSkew() const; - void setYSkew(double ySkew); - double getYSkew() const; + //Projection Mode + void setProjectionMode(const ProjectionMode&); + ProjectionMode getProjectionMode() const; // Size void setSize(Size); diff --git a/include/mbgl/map/projection_mode.hpp b/include/mbgl/map/projection_mode.hpp new file mode 100644 index 0000000000..4617371e15 --- /dev/null +++ b/include/mbgl/map/projection_mode.hpp @@ -0,0 +1,34 @@ +#pragma once + +#include <mbgl/util/optional.hpp> + +#include <functional> + +namespace mbgl { + +/** + * @brief Holds values for Axonometric rendering. All fields are + * optional. + */ +struct ProjectionMode { + ProjectionMode& withAxonometric(bool o) { axonometric = o; return *this; } + ProjectionMode& withXSkew(double o) { xSkew = o; return *this; } + ProjectionMode& withYSkew(double o) { ySkew = o; return *this; } + + /** + * @brief Set to True to enable axonometric rendering, false otherwise. + */ + optional<bool> axonometric; + + /** + * @brief The X skew value represents how much to skew on the x-axis. + */ + optional<double> xSkew; + + /** + * @brief The Y skew value represents how much to skew on the y-axis. + */ + optional<double> ySkew; +}; + +} // namespace mbgl |