This class is a helper to iterate over a geometry component, with an weight per component element.
More...
This class is a helper to iterate over a geometry component, with an weight per component element.
Using the same WeightedComponent interface, it is possible to iterate over the whole component or a subset of component elements, using an index and a weight.
const Points inputGeometry(ctx.
value(Dep_inputGeometry));
const auto &points = points_in.span();
const float weight = ctx.
as_float(Dep_weight);
const std::string &weights_name = ctx.
as_string(Dep_weights_name);
const WeightedComponent component(inputGeometry, weights_name.c_str(), weight, Shape::Topology::vertex);
for(const auto &ite : component)
{
const uint32_t index = ite.first;
const float weight = ite.second;
}