diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2015-07-13 03:15:14 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2015-07-14 16:44:42 +0300 |
commit | 7d8b4dc6c0714aa43a85a56ea32fa5590dd843e6 (patch) | |
tree | 5aac7387dc34cf9ca2ab3a0070cdef607b5bc14a /src/mbgl | |
parent | 7023ea061c79468843178a636cb83e8c5044a1e5 (diff) | |
download | qtlocation-mapboxgl-7d8b4dc6c0714aa43a85a56ea32fa5590dd843e6.tar.gz |
s/properties/propertyValues/
This list stores different values for the same property, but the
property itself remains the same.
Diffstat (limited to 'src/mbgl')
-rw-r--r-- | src/mbgl/style/applied_class_properties.cpp | 14 | ||||
-rw-r--r-- | src/mbgl/style/applied_class_properties.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/style/style_layer.cpp | 5 |
3 files changed, 11 insertions, 12 deletions
diff --git a/src/mbgl/style/applied_class_properties.cpp b/src/mbgl/style/applied_class_properties.cpp index d42102b2a2..f0680dd0f4 100644 --- a/src/mbgl/style/applied_class_properties.cpp +++ b/src/mbgl/style/applied_class_properties.cpp @@ -10,15 +10,15 @@ AppliedClassProperty::AppliedClassProperty(ClassID class_id, TimePoint begin_, T // Returns the ID of the most recent ClassID AppliedClassProperties::mostRecent() const { - return properties.size() ? properties.back().name : ClassID::Fallback; + return propertyValues.empty() ? ClassID::Fallback : propertyValues.back().name; } void AppliedClassProperties::add(ClassID class_id, TimePoint begin, TimePoint end, const PropertyValue &value) { - properties.emplace_back(class_id, begin, end, value); + propertyValues.emplace_back(class_id, begin, end, value); } bool AppliedClassProperties::hasTransitions() const { - return properties.size() > 1; + return propertyValues.size() > 1; } // Erase all items in the property list that are before a completed transition. @@ -26,19 +26,19 @@ bool AppliedClassProperties::hasTransitions() const { void AppliedClassProperties::cleanup(TimePoint now) { // Iterate backwards, but without using the rbegin/rend interface since we need forward // iterators to use .erase(). - for (auto it = properties.end(), begin = properties.begin(); it != begin;) { + for (auto it = propertyValues.end(), begin = propertyValues.begin(); it != begin;) { // If the property is finished, break iteration and delete all remaining items. if ((--it)->end <= now) { // Removes all items that precede the current iterator, but *not* the element currently // pointed to by the iterator. This preserves the last completed transition as the // first element in the property list. - properties.erase(begin, it); + propertyValues.erase(begin, it); // Also erase the pivot element if it's a fallback value. This means we can remove the // entire applied properties object as well, because we already have the fallback // value set as the default. if (it->name == ClassID::Fallback) { - properties.erase(it); + propertyValues.erase(it); } break; } @@ -46,7 +46,7 @@ void AppliedClassProperties::cleanup(TimePoint now) { } bool AppliedClassProperties::empty() const { - return properties.empty(); + return propertyValues.empty(); } } diff --git a/src/mbgl/style/applied_class_properties.hpp b/src/mbgl/style/applied_class_properties.hpp index 6a0d2a6fba..350bb846c0 100644 --- a/src/mbgl/style/applied_class_properties.hpp +++ b/src/mbgl/style/applied_class_properties.hpp @@ -23,14 +23,14 @@ public: class AppliedClassProperties { public: - std::list<AppliedClassProperty> properties; + std::list<AppliedClassProperty> propertyValues; public: // Returns the ID of the most recent ClassID mostRecent() const; void add(ClassID class_id, TimePoint begin, TimePoint end, const PropertyValue &value); - bool hasTransitions() const; void cleanup(TimePoint now); + bool hasTransitions() const; bool empty() const; }; diff --git a/src/mbgl/style/style_layer.cpp b/src/mbgl/style/style_layer.cpp index c29c3ee28f..7f9c7ecbf7 100644 --- a/src/mbgl/style/style_layer.cpp +++ b/src/mbgl/style/style_layer.cpp @@ -140,7 +140,7 @@ void StyleLayer::applyStyleProperty(PropertyKey key, T &target, const float z, c AppliedClassProperties &applied = it->second; // Iterate through all properties that we need to apply in order. const PropertyEvaluator<T> evaluator(z, zoomHistory); - for (auto& property : applied.properties) { + for (auto& property : applied.propertyValues) { if (now >= property.begin) { // We overwrite the current property with the new value. target = mapbox::util::apply_visitor(evaluator, property.value); @@ -158,7 +158,7 @@ void StyleLayer::applyTransitionedStyleProperty(PropertyKey key, T &target, cons AppliedClassProperties &applied = it->second; // Iterate through all properties that we need to apply in order. const PropertyEvaluator<T> evaluator(z, zoomHistory); - for (auto& property : applied.properties) { + for (auto& property : applied.propertyValues) { if (now >= property.end) { // We overwrite the current property with the new value. target = mapbox::util::apply_visitor(evaluator, property.value); @@ -271,7 +271,6 @@ bool StyleLayer::hasTransitions() const { return false; } - void StyleLayer::cleanupAppliedStyleProperties(TimePoint now) { for (auto it = appliedStyle.begin(); it != appliedStyle.end();) { AppliedClassProperties& appliedPropertyValues = it->second; |