[core] InterpolateBase → Interpolate; Interpolate → InterpolateImpl
This commit is contained in:
@@ -11,9 +11,9 @@ namespace mbgl {
|
||||
namespace style {
|
||||
namespace expression {
|
||||
|
||||
optional<variant<const InterpolateBase*, const Step*, ParsingError>> findZoomCurve(const expression::Expression* e);
|
||||
optional<variant<const Interpolate*, const Step*, ParsingError>> findZoomCurve(const expression::Expression* e);
|
||||
|
||||
variant<const InterpolateBase*, const Step*> findZoomCurveChecked(const expression::Expression* e);
|
||||
variant<const Interpolate*, const Step*> findZoomCurveChecked(const expression::Expression* e);
|
||||
|
||||
} // namespace expression
|
||||
} // namespace style
|
||||
|
||||
@@ -16,9 +16,9 @@ namespace expression {
|
||||
|
||||
ParseResult parseInterpolate(const mbgl::style::conversion::Convertible& value, ParsingContext& ctx);
|
||||
|
||||
class InterpolateBase : public Expression {
|
||||
class Interpolate : public Expression {
|
||||
public:
|
||||
InterpolateBase(const type::Type& type_,
|
||||
Interpolate(const type::Type& type_,
|
||||
Interpolator interpolator_,
|
||||
std::unique_ptr<Expression> input_,
|
||||
std::map<double, std::unique_ptr<Expression>> stops_
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
}
|
||||
|
||||
bool operator==(const Expression& e) const override {
|
||||
if (auto rhs = dynamic_cast<const InterpolateBase*>(&e)) {
|
||||
if (auto rhs = dynamic_cast<const Interpolate*>(&e)) {
|
||||
if (interpolator != rhs->interpolator ||
|
||||
*input != *(rhs->input) ||
|
||||
stops.size() != rhs->stops.size())
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
|
||||
float interpolationFactor(const Range<float>& inputLevels, const float inputValue) const {
|
||||
return zoomCurve.match(
|
||||
[&](const expression::InterpolateBase* z) {
|
||||
[&](const expression::Interpolate* z) {
|
||||
return z->interpolationFactor(Range<double> { inputLevels.min, inputLevels.max }, inputValue);
|
||||
},
|
||||
[&](const expression::Step*) { return 0.0f; }
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
|
||||
private:
|
||||
std::shared_ptr<expression::Expression> expression;
|
||||
const variant<const expression::InterpolateBase*, const expression::Step*> zoomCurve;
|
||||
const variant<const expression::Interpolate*, const expression::Step*> zoomCurve;
|
||||
};
|
||||
|
||||
} // namespace style
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
|
||||
float interpolationFactor(const Range<float>& inputLevels, const float inputValue) const {
|
||||
return zoomCurve.match(
|
||||
[&](const expression::InterpolateBase* z) {
|
||||
[&](const expression::Interpolate* z) {
|
||||
return z->interpolationFactor(Range<double> { inputLevels.min, inputLevels.max }, inputValue);
|
||||
},
|
||||
[&](const expression::Step*) { return 0.0f; }
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
private:
|
||||
optional<T> defaultValue;
|
||||
std::shared_ptr<expression::Expression> expression;
|
||||
const variant<const expression::InterpolateBase*, const expression::Step*> zoomCurve;
|
||||
const variant<const expression::Interpolate*, const expression::Step*> zoomCurve;
|
||||
};
|
||||
|
||||
} // namespace style
|
||||
|
||||
Reference in New Issue
Block a user