Blender V4.5
blender::offset_indices Namespace Reference

Namespaces

namespace  tests
 

Classes

struct  GroupedSpan
 
struct  NoSortCheck
 
class  OffsetIndices
 

Functions

OffsetIndices< int > accumulate_counts_to_offsets (MutableSpan< int > counts_to_offsets, int start_offset=0)
 
std::optional< OffsetIndices< int > > accumulate_counts_to_offsets_with_overflow_check (MutableSpan< int > counts_to_offsets, int start_offset=0)
 
void fill_constant_group_size (int size, int start_offset, MutableSpan< int > offsets)
 
void copy_group_sizes (OffsetIndices< int > offsets, const IndexMask &mask, MutableSpan< int > sizes)
 
void gather_group_sizes (OffsetIndices< int > offsets, const IndexMask &mask, MutableSpan< int > sizes)
 
void gather_group_sizes (OffsetIndices< int > offsets, Span< int > indices, MutableSpan< int > sizes)
 
int sum_group_sizes (OffsetIndices< int > offsets, const IndexMask &mask)
 
int sum_group_sizes (OffsetIndices< int > offsets, Span< int > indices)
 
OffsetIndices< int > gather_selected_offsets (OffsetIndices< int > src_offsets, const IndexMask &selection, int start_offset, MutableSpan< int > dst_offsets)
 
OffsetIndices< int > gather_selected_offsets (OffsetIndices< int > src_offsets, const IndexMask &selection, MutableSpan< int > dst_offsets)
 
void build_reverse_map (OffsetIndices< int > offsets, MutableSpan< int > r_map)
 
void build_reverse_offsets (Span< int > indices, MutableSpan< int > offsets)
 

Function Documentation

◆ accumulate_counts_to_offsets()

OffsetIndices< int > blender::offset_indices::accumulate_counts_to_offsets ( MutableSpan< int > counts_to_offsets,
int start_offset = 0 )

Turn an array of sizes into the offset at each index including all previous sizes.

Definition at line 15 of file offset_indices.cc.

References BLI_assert, BLI_assert_msg, count, blender::IndexRange::drop_back(), blender::MutableSpan< T >::index_range(), blender::MutableSpan< T >::last(), start_offset, and UNUSED_VARS_NDEBUG.

Referenced by blender::nodes::node_geo_duplicate_elements_cc::accumulate_counts_to_offsets(), blender::ed::curves::add_curves(), blender::build_concurrent(), blender::geometry::ngon::calc_edges_by_ngon(), blender::geometry::ngon::calc_tris_by_ngon(), blender::geometry::calculate_result_offsets(), blender::geometry::calculate_result_offsets(), blender::geometry::calculate_sphere_faces(), blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::geometry::create_cylinder_or_cone_mesh(), blender::create_envelope_strokes(), blender::bke::curves_copy_point_selection(), blender::geometry::extend_curves(), blender::io::grease_pencil::extend_curves_geometry(), blender::ed::sculpt_paint::greasepencil::find_curve_pair_offsets(), blender::nodes::node_geo_scale_elements_cc::from_indices_large_groups(), blender::ed::sculpt_paint::grease_pencil_fill_extension_cut(), blender::ed::sculpt_paint::greasepencil::interpolate_between_curves(), blender::geometry::remove_points_and_split(), blender::geometry::resample_to_count(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_length(), blender::ed::curves::resize_curves(), and blender::offset_indices::tests::TEST().

◆ accumulate_counts_to_offsets_with_overflow_check()

std::optional< OffsetIndices< int > > blender::offset_indices::accumulate_counts_to_offsets_with_overflow_check ( MutableSpan< int > counts_to_offsets,
int start_offset = 0 )

◆ build_reverse_map()

void blender::offset_indices::build_reverse_map ( OffsetIndices< int > offsets,
MutableSpan< int > r_map )

Create a map from indexed elements to the source indices, in other words from the larger array to the smaller array.

Definition at line 143 of file offset_indices.cc.

References blender::offset_indices::OffsetIndices< T >::index_range(), and range.

Referenced by blender::bke::CurvesGeometry::point_to_curve_map().

◆ build_reverse_offsets()

◆ copy_group_sizes()

◆ fill_constant_group_size()

void blender::offset_indices::fill_constant_group_size ( int size,
int start_offset,
MutableSpan< int > offsets )

◆ gather_group_sizes() [1/2]

void blender::offset_indices::gather_group_sizes ( OffsetIndices< int > offsets,
const IndexMask & mask,
MutableSpan< int > sizes )

Gather the number of indices in each indexed group to sizes.

Definition at line 78 of file offset_indices.cc.

References gather_group_sizes(), mask(), pos, and blender::offset_indices::OffsetIndices< T >::size().

Referenced by gather_group_sizes(), and gather_group_sizes().

◆ gather_group_sizes() [2/2]

void blender::offset_indices::gather_group_sizes ( OffsetIndices< int > offsets,
Span< int > indices,
MutableSpan< int > sizes )

◆ gather_selected_offsets() [1/2]

◆ gather_selected_offsets() [2/2]

OffsetIndices< int > blender::offset_indices::gather_selected_offsets ( OffsetIndices< int > src_offsets,
const IndexMask & selection,
MutableSpan< int > dst_offsets )
inline

Definition at line 179 of file BLI_offset_indices.hh.

References gather_selected_offsets().

◆ sum_group_sizes() [1/2]

int blender::offset_indices::sum_group_sizes ( OffsetIndices< int > offsets,
const IndexMask & mask )

◆ sum_group_sizes() [2/2]

int blender::offset_indices::sum_group_sizes ( OffsetIndices< int > offsets,
Span< int > indices )