45 PropertyExpression(std::unique_ptr<expression::Expression> expression_, std::optional<T> defaultValue_ = std::nullopt)
47 defaultValue(
std::move(defaultValue_)) {
53 const std::optional<T> typed = expression::fromExpressionValue<T>(*result);
54 return typed ? *typed : defaultValue ? *defaultValue : finalDefaultValue;
56 return defaultValue ? *defaultValue : finalDefaultValue;
65 T
evaluate(
const GeometryTileFeature& feature, T finalDefaultValue)
const {
72 const std::set<std::string>& availableImages,
73 T finalDefaultValue)
const {
83 const std::set<std::string>& availableImages,
85 T finalDefaultValue)
const {
87 .withAvailableImages(&availableImages)
88 .withCanonicalTileID(&canonical),
92 T
evaluate(
float zoom,
const GeometryTileFeature& feature, T finalDefaultValue)
const {
97 const GeometryTileFeature& feature,
98 const std::set<std::string>& availableImages,
99 T finalDefaultValue)
const {
105 const GeometryTileFeature& feature,
106 const std::set<std::string>& availableImages,
108 T finalDefaultValue)
const {
110 .withAvailableImages(&availableImages)
111 .withCanonicalTileID(&canonical),
116 const GeometryTileFeature& feature,
118 T finalDefaultValue)
const {
129 return expression::fromExpressionValues<T>(
expression->possibleOutputs());
138 std::optional<T> defaultValue;
variant< std::nullptr_t, const expression::Interpolate *, const expression::Step * > zoomCurve
float interpolationFactor(const Range< float > &, float) const noexcept
Range< float > getCoveringStops(float, float) const noexcept
std::shared_ptr< const expression::Expression > getSharedExpression() const noexcept
const expression::Expression & getExpression() const noexcept
bool isFeatureConstant() const noexcept
bool isZoomConstant() const noexcept
bool isRuntimeConstant() const noexcept
PropertyExpressionBase(std::unique_ptr< expression::Expression >)
std::shared_ptr< const expression::Expression > expression
T evaluate(const GeometryTileFeature &feature, T finalDefaultValue) const
T evaluate(float zoom, const GeometryTileFeature &feature, T finalDefaultValue) const
std::vector< std::optional< T > > possibleOutputs() const
PropertyExpression(std::unique_ptr< expression::Expression > expression_, std::optional< T > defaultValue_=std::nullopt)
T evaluate(const GeometryTileFeature &feature, const std::set< std::string > &availableImages, const CanonicalTileID &canonical, T finalDefaultValue) const
T evaluate(float zoom, const GeometryTileFeature &feature, const std::set< std::string > &availableImages, const CanonicalTileID &canonical, T finalDefaultValue) const
T evaluate(const GeometryTileFeature &feature, const std::set< std::string > &availableImages, T finalDefaultValue) const
T evaluate(const GeometryTileFeature &feature, const CanonicalTileID &canonical, T finalDefaultValue) const
friend bool operator==(const PropertyExpression &lhs, const PropertyExpression &rhs)
T evaluate(const expression::EvaluationContext &context, T finalDefaultValue=T()) const
T evaluate(float zoom, const GeometryTileFeature &feature, const std::set< std::string > &availableImages, T finalDefaultValue) const
T evaluate(float zoom) const
T evaluate(float zoom, const GeometryTileFeature &feature, const CanonicalTileID &canonical, T finalDefaultValue) const
T evaluate(float zoom, const GeometryTileFeature &feature, const FeatureState &state, T finalDefaultValue) const
std::unique_ptr< Expression > zoom()
mapbox::base::ValueObject FeatureState
mapbox::util::variant< T... > variant