|
Blender V4.3
|
#include <BKE_curves_utils.hh>
Classes | |
| struct | CyclicIterator |
Public Member Functions | |
| constexpr | IndexRangeCyclic ()=default |
| ~IndexRangeCyclic ()=default | |
| constexpr | IndexRangeCyclic (const int start, const int end, const int iterable_range_size, const int cycles) |
| constexpr | IndexRangeCyclic (const int start, const int end, const int iterable_range_size) |
| template<typename IndexT > | |
| constexpr IndexT | next_index (const IndexT index, const bool cyclic) |
| template<typename IndexT > | |
| constexpr IndexT | previous_index (const IndexT index, const bool cyclic) |
| constexpr IndexRangeCyclic | push_loop (const int n=1) const |
| constexpr IndexRangeCyclic | push_front (const int n=1) const |
| constexpr IndexRangeCyclic | push_back (const int n=1) const |
| constexpr IndexRangeCyclic | drop_front (const int n=1) const |
| constexpr IndexRangeCyclic | drop_back (const int n=1) const |
| constexpr IndexRange | curve_range () const |
| constexpr IndexRange | range_before_loop () const |
| constexpr IndexRange | range_after_loop () const |
| constexpr int | size_range () const |
| constexpr int | size_before_loop () const |
| constexpr int | size_after_loop () const |
| constexpr int | size () const |
| constexpr int | cycles () const |
| constexpr int | first () const |
| constexpr int | last () const |
| constexpr int | one_after_last () const |
| constexpr bool | operator== (const IndexRangeCyclic &other) const |
| constexpr bool | operator!= (const IndexRangeCyclic &other) const |
| constexpr CyclicIterator | begin () const |
| constexpr CyclicIterator | end () const |
Static Public Member Functions | |
| static IndexRangeCyclic | get_range_from_size (const int start_index, const int iterator_size, const int iterable_range_size) |
| static IndexRangeCyclic | get_range_between_endpoints (const CurvePoint start_point, const CurvePoint end_point, const int iterable_range_size) |
Cyclical index range. Allows iteration over a plain 'IndexRange' interval on form [start, end) while also supporting treating the underlying array as a cyclic array where the last index is followed by the first index in the 'cyclical' range. The cyclical index range can then be considered a combination of the intervals separated by the last index of the underlying array, namely [start, range_size) and [0, end) where start/end is the indices iterated between and range_size is the size of the underlying array. To cycle the underlying array the interval [0, range_size) can be iterated over an arbitrary amount of times in between.
Definition at line 80 of file BKE_curves_utils.hh.
|
constexprdefault |
Referenced by get_range_between_endpoints(), and get_range_from_size().
|
default |
|
inlineconstexpr |
Definition at line 99 of file BKE_curves_utils.hh.
|
inlineconstexpr |
Create an iterator over the cyclical interval [start_index, end_index).
Definition at line 110 of file BKE_curves_utils.hh.
|
inlineconstexpr |
Definition at line 399 of file BKE_curves_utils.hh.
|
inlineconstexpr |
Get the index range for the curve buffer.
Definition at line 304 of file BKE_curves_utils.hh.
References size_range().
Referenced by blender::geometry::copy_point_data_between_endpoints(), and blender::geometry::sample_interval_bezier().
|
inlineconstexpr |
Return the number of times the iterator will cycle before ending.
Definition at line 366 of file BKE_curves_utils.hh.
Referenced by blender::geometry::copy_point_data_between_endpoints(), get_range_between_endpoints(), and blender::geometry::sample_interval_bezier().
|
inlineconstexpr |
Returns a new range with n indices removed from the end of the range. This invokes undefined behavior when n is negative or n is larger then the underlying range.
Definition at line 284 of file BKE_curves_utils.hh.
References BLI_assert, int, num_cycles, and size_range().
|
inlineconstexpr |
Returns a new range with n indices removed from the beginning of the range. This invokes undefined behavior.
Definition at line 262 of file BKE_curves_utils.hh.
References BLI_assert, int, num_cycles, and size_range().
Referenced by blender::geometry::sample_interval_bezier(), and blender::geometry::sample_interval_linear().
|
inlineconstexpr |
Definition at line 404 of file BKE_curves_utils.hh.
|
inlineconstexpr |
Definition at line 371 of file BKE_curves_utils.hh.
Referenced by blender::geometry::copy_point_data_between_endpoints(), and blender::geometry::sample_interval_bezier().
|
inlinestatic |
Create a cyclical iterator for all control points within the interval [start_point, end_point] including any control point at the start or end point.
| start_point | Point on the curve that define the starting point of the interval. |
| end_point | Point on the curve that define the end point of the interval (included). |
| iterable_range_size | Size of the underlying range (superset to the cyclical range). |
Definition at line 154 of file BKE_curves_utils.hh.
References BLI_assert, cycles(), blender::bke::curves::CurveSegment::index, IndexRangeCyclic(), blender::bke::curves::CurvePoint::is_controlpoint(), blender::bke::curves::CurveSegment::next_index, and blender::bke::curves::CurvePoint::parameter.
|
inlinestatic |
Create a cyclical iterator of the specified size.
| start_point | Point on the curve that define the starting point of the interval. |
| iterator_size | Number of elements to iterate (size of the iterated cyclical range). |
| iterable_range_size | Size of the underlying range (superset to the cyclical range). |
Definition at line 125 of file BKE_curves_utils.hh.
References BLI_assert, and IndexRangeCyclic().
|
inlineconstexpr |
Definition at line 376 of file BKE_curves_utils.hh.
References BLI_assert, int, and size().
|
inlineconstexpr |
Next index within the iterable range.
Definition at line 183 of file BKE_curves_utils.hh.
References blender::is_same_any_v, next_index(), and size_range().
Referenced by next_index().
|
inlineconstexpr |
Definition at line 382 of file BKE_curves_utils.hh.
Referenced by blender::geometry::copy_point_data_between_endpoints(), and blender::geometry::sample_interval_bezier().
|
inlineconstexpr |
Definition at line 392 of file BKE_curves_utils.hh.
References operator==().
|
inlineconstexpr |
Definition at line 387 of file BKE_curves_utils.hh.
Referenced by operator!=().
|
inlineconstexpr |
Previous index within the iterable range.
Definition at line 196 of file BKE_curves_utils.hh.
References blender::is_same_any_v, and size_range().
|
inlineconstexpr |
Increment the range by adding the given number of indices to the end of the iterated range. This invokes undefined behavior when n is negative.
Definition at line 241 of file BKE_curves_utils.hh.
References BLI_assert, int, num_cycles, and size_range().
|
inlineconstexpr |
Increment the range by adding the given number of indices to the beginning of the iterated range. This invokes undefined behavior when n is negative.
Definition at line 219 of file BKE_curves_utils.hh.
References BLI_assert, int, num_cycles, and size_range().
|
inlineconstexpr |
Increment the range by adding n loops to the range. This invokes undefined behavior when n is negative.
Definition at line 210 of file BKE_curves_utils.hh.
|
inlineconstexpr |
Range between the first element in the iterable range up to the last element in the range.
Definition at line 320 of file BKE_curves_utils.hh.
References size_after_loop().
|
inlineconstexpr |
Range between the first element up to the end of the range.
Definition at line 312 of file BKE_curves_utils.hh.
References size_before_loop().
|
inlineconstexpr |
Number of elements iterated by the cyclical index range.
Definition at line 353 of file BKE_curves_utils.hh.
References int, and size_before_loop().
Referenced by last().
|
inlineconstexpr |
Number of elements between the first element in the iterable range up to the last element in the range.
Definition at line 345 of file BKE_curves_utils.hh.
Referenced by blender::geometry::copy_point_data_between_endpoints(), range_after_loop(), and blender::geometry::sample_interval_bezier().
|
inlineconstexpr |
Number of elements between the first element in the range up to the last element in the curve.
Definition at line 336 of file BKE_curves_utils.hh.
Referenced by blender::geometry::copy_point_data_between_endpoints(), range_before_loop(), blender::geometry::sample_interval_bezier(), and size().
|
inlineconstexpr |
Number of elements in the underlying iterable range.
Definition at line 328 of file BKE_curves_utils.hh.
Referenced by curve_range(), drop_back(), drop_front(), next_index(), previous_index(), push_back(), push_front(), and blender::geometry::sample_interval_bezier().