61 const Points &inputGeometry,
62 const char *weights_name,
74 _size = uint32_t(_indices.size());
96 return {_wc->_indices[_index], _wc->_weights[_index]*_wc->_weight};
98 return {_index, _wc->_weight};
105 return _wc->_indices[_index];
114 return _wc->_weights[_index]*_wc->_weight;
121 assert(_index < _wc->_size);
128 assert(_index+d <= _wc->_size);
135 return _index != o._index;
152 return {_size,
this};
164 gsl::span<const uint32_t> _indices;
165 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:56
Iterator begin() const
The begin iterator.
Definition: WeightedComponent.h:144
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:36
std::pair< uint32_t, float > operator*() const
Definition: WeightedComponent.h:93
Iterator & operator++()
Definition: WeightedComponent.h:119
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:111
const BufferConstV3f read_points() const
Return the points buffer.
Iterator end() const
The end iterator.
Definition: WeightedComponent.h:150
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:133
Iterator(uint32_t index, const WeightedComponent *wc)
Definition: WeightedComponent.h:91
static bool can_cast(const Value &v)
The component iterator.
Definition: WeightedComponent.h:88
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.
Definition: WeightedComponent.h:60
Iterator & operator+(uint32_t d)
Definition: WeightedComponent.h:126
uint32_t size() const
Return the number of component element to iterate.
Definition: WeightedComponent.h:156
uint32_t index() const
Return the component element index.
Definition: WeightedComponent.h:102
A set of 3d points.
Definition: Points.h:26
bool has_weights() const
Definition: WeightedComponent.h:82
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
A read only buffer of sparse values. It is composed of a buffer of values and a buffer of the index i...
Definition: SparseBuffer.h:23