summaryrefslogtreecommitdiff
path: root/include/llmr/style/style.hpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-06-30 11:46:03 +0200
committerKonstantin Käfer <mail@kkaefer.com>2014-06-30 11:46:03 +0200
commit93cd4c5c7b0939038eab38a6f6eb71eae4014acb (patch)
tree76d8efb417a20f16e32e3d5901fd5d9db351ac60 /include/llmr/style/style.hpp
parent8feedf7fc2f9b41a48d9f02ea572d312514f115f (diff)
downloadqtlocation-mapboxgl-93cd4c5c7b0939038eab38a6f6eb71eae4014acb.tar.gz
move StyleLayerGroup and PropertyTransition to their own files
Diffstat (limited to 'include/llmr/style/style.hpp')
-rw-r--r--include/llmr/style/style.hpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/include/llmr/style/style.hpp b/include/llmr/style/style.hpp
index 383aa5d75d..62864b75ff 100644
--- a/include/llmr/style/style.hpp
+++ b/include/llmr/style/style.hpp
@@ -1,11 +1,12 @@
#ifndef LLMR_STYLE_STYLE
#define LLMR_STYLE_STYLE
-#include <cstdint>
+#include <llmr/style/property_transition.hpp>
#include <llmr/util/time.hpp>
#include <llmr/util/uv.hpp>
+#include <cstdint>
#include <map>
#include <unordered_map>
#include <vector>
@@ -17,7 +18,7 @@ namespace llmr {
class Sprite;
class Source;
class StyleLayer;
-typedef std::vector<std::shared_ptr<StyleLayer>> StyleLayerGroup;
+class StyleLayerGroup;
class Style {
public:
@@ -26,20 +27,13 @@ public:
public:
Style();
- void reset();
-
void loadJSON(const uint8_t *const data);
size_t layerCount() const;
- void cascade(float z);
+ void updateProperties(float z, timestamp t);
- bool needsTransition() const;
- void updateTransitions(timestamp now);
- void cancelTransitions();
+ void setDefaultTransitionDuration(uint16_t duration_milliseconds = 0);
- void setDefaultTransitionDuration(uint64_t duration_milliseconds = 0);
-
- void updateSources();
const std::set<std::shared_ptr<Source>> getActiveSources() const;
const std::vector<std::string> &getAppliedClasses() const;
@@ -51,14 +45,17 @@ public:
std::shared_ptr<StyleLayer> background;
std::vector<std::string> appliedClasses;
-
private:
- void updateSources(const std::shared_ptr<StyleLayerGroup> &layers);
- void cascade(const std::shared_ptr<StyleLayerGroup> &layers, float z);
+ void updateSources();
+ void updateSources(const std::shared_ptr<StyleLayerGroup> &group);
+
+ void updateProperties(const std::shared_ptr<StyleLayerGroup> &group, float z, timestamp t);
+
+ void updateClasses();
private:
std::set<std::shared_ptr<Source>> activeSources;
- uint64_t default_transition_duration = 0;
+ PropertyTransition defaultTransition;
bool initial_render_complete = false;
mutable uv::rwlock mtx;