62 const Points &inputGeometry,
63 const char *weights_name,
75 _size = uint32_t(_indices.size());
85 const Points& inputGeometry,
102 _size = uint32_t(_indices.size());
119 return {_wc->_indices[_index], _wc->_weights[_index]*_wc->_weight};
121 return {_index, _wc->_weight};
128 return _wc->_indices[_index];
137 return _wc->_weights[_index]*_wc->_weight;
144 assert(_index < _wc->_size);
151 assert(_index+d <= _wc->_size);
158 return _index != o._index;
175 return {_size,
this};
187 gsl::span<const uint32_t> _indices;
188 gsl::span<const float> _weights;
This class is a helper to iterate over a geometry component, with an weight per component element...
Definition: WeightedComponent.h:57
Iterator begin() const
The begin iterator.
Definition: WeightedComponent.h:167
const Value read_attribute(const char *attribute_name, Topology topology) const
Get a read access to an attribute.
Topology
The different attribute topologies.
Definition: Shape.h:38
std::pair< uint32_t, float > operator*() const
Definition: WeightedComponent.h:116
WeightedComponent(const Points &inputGeometry, float weight)
Build a WeightedComponent object from a geometry.
Definition: WeightedComponent.h:84
Iterator & operator++()
Definition: WeightedComponent.h:142
This version of the SDK is unstable, i-e, it may change with no warning.
Definition: AddCurveAction.h:20
float weight() const
Return the component element weight, including the global weight.
Definition: WeightedComponent.h:134
const BufferConstV3f read_points() const
Return the points buffer.
Iterator end() const
The end iterator.
Definition: WeightedComponent.h:173
gsl::span< const value_type > read_values() const
Return a readable accessor on the buffer indices.
bool operator!=(const Iterator &o) const
Definition: WeightedComponent.h:156
Iterator(uint32_t index, const WeightedComponent *wc)
Definition: WeightedComponent.h:114
static bool can_cast(const Value &v)
WeightedComponent(const SparseBufferConstFloat &weights, float weight)
Build a WeightedComponent object from a weight mask.
Definition: WeightedComponent.h:94
The component iterator.
Definition: WeightedComponent.h:111
size_t size() const
Return the number of element in the buffer.
WeightedComponent(const Points &inputGeometry, const char *weights_name, float weight, Shape::Topology topology)
Build a WeightedComponent object using a points geometry with an optional weight mask.
Definition: WeightedComponent.h:61
Iterator & operator+(uint32_t d)
Definition: WeightedComponent.h:149
uint32_t size() const
Return the number of component element to iterate.
Definition: WeightedComponent.h:179
uint32_t index() const
Return the component element index.
Definition: WeightedComponent.h:125
A set of 3d points.
Definition: Points.h:25
bool has_weights() const
Definition: WeightedComponent.h:105
gsl::span< const uint32_t > read_indices() const
Return a readable accessor on the indices buffer.
Base class of all Rumba values.
Definition: Value.h:34