|
Blender V4.3
|
#include <BLI_offset_indices.hh>
Public Member Functions | |
| OffsetIndices ()=default | |
| OffsetIndices (const Span< T > offsets) | |
| OffsetIndices (const Span< T > offsets, NoSortCheck) | |
| T | total_size () const |
| int64_t | size () const |
| bool | is_empty () const |
| IndexRange | index_range () const |
| IndexRange | operator[] (const int64_t index) const |
| IndexRange | operator[] (const IndexRange indices) const |
| OffsetIndices | slice (const IndexRange range) const |
| Span< T > | data () const |
References an array of ascending indices. A pair of consecutive indices encode an index range. Another common way to store the same kind of data is to store the start and size of every range separately. Using offsets instead halves the memory consumption. The downside is that the array has to be one element longer than the total number of ranges. The extra element is necessary to be able to get the last index range without requiring an extra branch for the case.
This class is a thin wrapper around such an array that makes it easy to retrieve the index range at a specific index.
Definition at line 29 of file BLI_offset_indices.hh.
|
default |
Referenced by blender::offset_indices::OffsetIndices< T >::slice().
|
inline |
Definition at line 37 of file BLI_offset_indices.hh.
References blender::Span< T >::begin(), BLI_assert, blender::Span< T >::end(), and blender::Span< T >::size().
|
inline |
Same as above, but skips the debug check that indices are sorted, because that can have a high performance impact making debug builds unusable for files that would be fine otherwise. This can be used when it is known that the indices are sorted already.
Definition at line 47 of file BLI_offset_indices.hh.
|
inline |
Definition at line 101 of file BLI_offset_indices.hh.
Referenced by export_hair_curves(), blender::offset_indices::gather_group_sizes(), blender::ed::sculpt_paint::grease_pencil_fill_extension_cut(), blender::geometry::join_curves_ranges(), blender::geometry::make_new_offset_indices(), and modify_mesh().
|
inline |
Definition at line 69 of file BLI_offset_indices.hh.
References blender::offset_indices::OffsetIndices< T >::size().
Referenced by blender::ed::greasepencil::apply_mask_as_segment_selection(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), BKE_mesh_remap_calc_faces_from_mesh(), BKE_mesh_remap_calc_loops_from_mesh(), BKE_mesh_to_curve_nurblist(), blender::offset_indices::build_reverse_map(), buildAdjacencyMap(), blender::geometry::calc_new_edges(), construct_param_handle_subsurfed(), blender::geometry::create_merged_mesh(), blender::draw::create_sculpt_cage_ibo(), blender::deform_drawing(), blender::io::alembic::ABCCurveWriter::do_write(), ED_mesh_uv_loop_reset_ex(), blender::ed::curves::subdivide::exec(), export_hair_curves(), export_hair_curves_motion(), blender::draw::fill_curve_offsets_vbos(), blender::draw::fill_points_position_time_vbo(), blender::bke::find_nearest_faces(), blender::nodes::node_geo_points_to_curves_cc::grouped_sort(), blender::nodes::node_geo_sort_elements_cc::grouped_sort(), blender::offset_indices::GroupedSpan< T >::index_range(), blender::ed::sculpt_paint::greasepencil::interpolate_between_curves(), blender::geometry::make_new_offset_indices(), blender::draw::mesh_is_single_material(), MOD_solidify_extrude_modifyMesh(), MOD_solidify_nonmanifold_modifyMesh(), modify_mesh(), blender::bke::offsets_contain_single_point(), blender::nodes::node_geo_duplicate_elements_cc::threaded_id_offset_copy(), timeline_cache_draw_geometry_nodes(), and blender::geometry::weld_poly_find_doubles().
|
inline |
Definition at line 64 of file BLI_offset_indices.hh.
References blender::offset_indices::OffsetIndices< T >::size().
Referenced by blender::ed::sculpt_paint::greasepencil::interpolate_between_curves(), blender::modify_fill_color(), and blender::modify_fill_color().
|
inline |
Definition at line 83 of file BLI_offset_indices.hh.
References blender::IndexRange::from_begin_end().
|
inline |
Definition at line 74 of file BLI_offset_indices.hh.
References BLI_assert, blender::IndexRange::from_begin_end(), and blender::Span< T >::size().
|
inline |
Return the number of ranges encoded by the offsets, not including the last value used internally.
Definition at line 59 of file BLI_offset_indices.hh.
References blender::Span< T >::size().
Referenced by BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), BKE_mesh_remap_calc_faces_from_mesh(), BKE_mesh_remap_calc_loops_from_mesh(), BKE_object_data_transfer_ex(), blender::bke::mesh::build_vert_to_edge_map(), blender::geometry::compute_curve_trim_parameters(), blender::nodes::node_geo_interpolate_curves_cc::compute_points_per_curve_by_group(), blender::nodes::node_geo_input_spline_length_cc::construct_curve_point_count_gvarray(), blender::offset_indices::copy_group_sizes(), blender::geometry::create_merged_mesh(), blender::draw::create_sculpt_cage_ibo(), blender::nodes::node_geo_curve_fill_cc::do_cdt_with_mask(), blender::io::alembic::ABCCurveWriter::do_write(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_curves_CurveGeometry(), blender::geometry::execute_realize_mesh_task(), export_hair_curves(), blender::geometry::extend_curves(), blender::geometry::extend_curves_curved(), blender::io::grease_pencil::extend_curves_geometry(), blender::nodes::node_geo_extrude_mesh_cc::extrude_individual_mesh_faces(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_edges(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_face_regions(), blender::draw::fill_curve_offsets_vbos(), blender::offset_indices::gather_group_sizes(), blender::offset_indices::gather_selected_offsets(), blender::io::obj::OBJMesh::get_face_uv_indices(), blender::ed::greasepencil::grease_pencil_clean_loose_exec(), blender::draw::grease_pencil_weight_batch_ensure(), blender::draw::grease_pencil_wire_batch_ensure(), blender::offset_indices::OffsetIndices< T >::index_range(), blender::ed::sculpt_paint::greasepencil::interpolate_between_curves(), blender::offset_indices::OffsetIndices< T >::is_empty(), blender::geometry::join_curves_ranges(), blender::geometry::make_new_offset_indices(), MOD_solidify_extrude_modifyMesh(), MOD_solidify_nonmanifold_modifyMesh(), modify_mesh(), blender::modify_stroke_color(), blender::point_counts_to_keep_concurrent(), blender::points_info_sequential(), blender::geometry::poly_find_doubles(), blender::io::usd::populate_curve_props_for_nurbs(), blender::io::usd::populate_curve_verts(), blender::io::usd::populate_curve_verts_for_bezier(), blender::reorder_cyclic_curve_points(), blender::geometry::resample_to_uniform(), blender::bke::mesh::reverse_group_indices_in_groups(), blender::bke::mesh::reverse_indices_in_groups(), blender::nodes::node_geo_scale_elements_cc::reverse_indices_in_groups(), blender::ed::curves::select_alternate(), blender::offset_indices::GroupedSpan< T >::size(), blender::offset_indices::sum_group_sizes(), blender::offset_indices::sum_group_sizes(), blender::ed::curves::convert_to_particle_system::try_convert_single_object(), and blender::geometry::weld_poly_find_doubles().
|
inline |
Return a subset of the offsets describing the specified range of source elements. This is a slice into the source ranges rather than the indexed elements described by the offset values.
Definition at line 95 of file BLI_offset_indices.hh.
References BLI_assert, blender::IndexRange::contains(), blender::IndexRange::drop_back(), blender::Span< T >::index_range(), blender::offset_indices::OffsetIndices< T >::OffsetIndices(), and blender::Span< T >::slice().
Referenced by blender::ed::curves::duplicate_curves(), blender::ed::sculpt_paint::greasepencil::CloneOperation::on_stroke_begin(), blender::geometry::resample_to_evaluated(), blender::ed::sculpt_paint::select_random::select_random_exec(), and blender::io::grease_pencil::shape_attributes_to_curves().
|
inline |
Return the total number of elements in the referenced arrays.
Definition at line 50 of file BLI_offset_indices.hh.
References blender::Span< T >::first(), blender::Span< T >::last(), and blender::Span< T >::size().
Referenced by blender::bke::mesh::build_vert_to_edge_map(), blender::draw::calc_edit_handles_ibo(), blender::geometry::calc_new_edges(), blender::bke::curves::bezier::calculate_evaluated_positions(), blender::geometry::curve_constraints::compute_segment_lengths(), blender::draw::create_edit_lines_ibo(), blender::draw::create_edit_points_position_and_data(), blender::draw::create_edit_points_selection(), blender::create_envelope_strokes(), blender::draw::create_sculpt_cage_ibo(), blender::ed::transform::curves::createTransCurvesVerts(), blender::ed::transform::greasepencil::createTransGreasePencilVerts(), blender::draw::curve_eval_render_wire_verts_edges_len_get(), blender::bke::curves_copy_curve_selection(), blender::nodes::node_geo_curve_fill_cc::do_cdt_with_mask(), blender::ed::curves::duplicate_curves(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_edges(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_instances(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_layers(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_CurvesGeometry(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_mesh(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_pointcloud(), blender::geometry::execute_instances_tasks(), blender::io::grease_pencil::extend_curves_geometry(), blender::nodes::node_geo_extrude_mesh_cc::extrude_individual_mesh_faces(), blender::ed::greasepencil::find_curve_segments(), blender::offset_indices::GroupedSpan< T >::GroupedSpan(), blender::ed::sculpt_paint::greasepencil::interpolate_between_curves(), blender::bke::curves::bezier::interpolate_to_evaluated(), blender::geometry::join_instances(), blender::bke::mesh_calc_edges(), blender::geometry::mesh_copy_selection(), blender::geometry::mesh_copy_selection_keep_edges(), blender::geometry::mesh_copy_selection_keep_verts(), blender::geometry::offsets_to_map(), blender::ed::sculpt_paint::greasepencil::CloneOperation::on_stroke_begin(), blender::points_info_sequential(), blender::geometry::reorder_customdata_groups(), blender::ed::sculpt_paint::mask::sculpt_mask_filter_exec(), blender::geometry::smooth_curve_attribute(), blender::geometry::curve_constraints::solve_length_constraints(), blender::bke::greasepencil::Drawing::tag_topology_changed(), blender::nodes::node_geo_duplicate_elements_cc::threaded_id_offset_copy(), and blender::bke::greasepencil::Drawing::triangles().