|
Blender V5.3
|
#include <bmesh_polygon.hh>
Inherited by blender::VArraySpan< T >.
Public Types | |
| using | value_type = T |
| using | pointer = T * |
| using | const_pointer = const T * |
| using | reference = T & |
| using | const_reference = const T & |
| using | iterator = const T * |
| using | size_type = int64_t |
Public Member Functions | |
| constexpr | Span ()=default |
| constexpr | Span (const T *start, int64_t size) |
| template<typename U> requires (is_span_convertible_pointer_v<U, T>) | |
| constexpr | Span (const U *start, int64_t size) |
| constexpr | Span (const std::initializer_list< T > &list) |
| constexpr | Span (const std::vector< T > &vector) |
| template<std::size_t N> | |
| constexpr | Span (const std::array< T, N > &array) |
| template<typename U> requires (is_span_convertible_pointer_v<U, T>) | |
| constexpr | Span (Span< U > span) |
| constexpr Span | slice (int64_t start, int64_t size) const |
| constexpr Span | slice (IndexRange range) const |
| constexpr Span | slice_safe (const int64_t start, const int64_t size) const |
| constexpr Span | slice_safe (IndexRange range) const |
| constexpr Span | drop_front (int64_t n) const |
| constexpr Span | drop_back (int64_t n) const |
| constexpr Span | take_front (int64_t n) const |
| constexpr Span | take_back (int64_t n) const |
| constexpr const T * | data () const |
| constexpr const T * | begin () const |
| constexpr const T * | end () const |
| constexpr std::reverse_iterator< const T * > | rbegin () const |
| constexpr std::reverse_iterator< const T * > | rend () const |
| constexpr const T & | operator[] (int64_t index) const |
| constexpr int64_t | size () const |
| constexpr bool | is_empty () const |
| constexpr int64_t | size_in_bytes () const |
| constexpr bool | contains (const T &value) const |
| constexpr bool | contains_ptr (const T *ptr) const |
| constexpr int64_t | count (const T &value) const |
| constexpr const T & | first () const |
| constexpr const T & | last (const int64_t n=0) const |
| constexpr bool | has_duplicates__linear_search () const |
| constexpr bool | intersects__linear_search (Span other) const |
| constexpr int64_t | first_index (const T &search_value) const |
| constexpr int64_t | first_index_try (const T &search_value) const |
| constexpr IndexRange | index_range () const |
| constexpr uint64_t | hash () const |
| template<typename NewT> | |
| Span< NewT > constexpr | cast () const |
Protected Attributes | |
| const T * | data_ = nullptr |
| int64_t | size_ = 0 |
Friends | |
| bool | operator== (const Span< T > a, const Span< T > b) |
| bool | operator!= (const Span< T > a, const Span< T > b) |
References an array of type T that is owned by someone else. The data in the array cannot be modified.
Definition at line 74 of file bmesh_polygon.hh.
| using blender::blender::Span< T >::const_pointer = const T * |
Definition at line 78 of file bmesh_polygon.hh.
| using blender::blender::Span< T >::const_reference = const T & |
Definition at line 80 of file bmesh_polygon.hh.
| using blender::blender::Span< T >::iterator = const T * |
Definition at line 81 of file bmesh_polygon.hh.
| using blender::blender::Span< T >::pointer = T * |
Definition at line 77 of file bmesh_polygon.hh.
| using blender::blender::Span< T >::reference = T & |
Definition at line 79 of file bmesh_polygon.hh.
| using blender::blender::Span< T >::size_type = int64_t |
Definition at line 82 of file bmesh_polygon.hh.
| using blender::blender::Span< T >::value_type = T |
Definition at line 76 of file bmesh_polygon.hh.
|
constexprdefault |
Create a reference to an empty array.
Referenced by blender::VArraySpan< T >::VArraySpan().
|
inlineconstexpr |
Definition at line 94 of file bmesh_polygon.hh.
References blender::ATTR_WARN_UNUSED_RESULT.
|
inlineconstexpr |
Definition at line 100 of file bmesh_polygon.hh.
|
inlineconstexpr |
Reference an initializer_list. Note that the data in the initializer_list is only valid until the expression containing it is fully computed.
Do: call_function_with_array({1, 2, 3, 4});
Don't: Span<int> span = {1, 2, 3, 4}; call_function_with_array(span);
Definition at line 118 of file bmesh_polygon.hh.
|
inlineconstexpr |
Definition at line 122 of file bmesh_polygon.hh.
|
inlineconstexpr |
Definition at line 124 of file bmesh_polygon.hh.
|
inlineconstexpr |
Support implicit conversions like the one below: Span<T *> -> Span<const T *>
Definition at line 131 of file bmesh_polygon.hh.
|
inlineconstexpr |
Definition at line 224 of file bmesh_polygon.hh.
Referenced by blender::ed::greasepencil::attributes_elements_are_equal(), blender::nodes::node_geo_field_variance_cc::FieldVarianceInput::get_varray_for_context(), and blender::ed::mesh::join_face_sets().
|
inlineconstexpr |
Returns a new Span to the same underlying memory buffer. No conversions are done.
Definition at line 422 of file bmesh_polygon.hh.
Referenced by attr_create_generic(), blender::nodes::node_fn_separate_matrix_cc::SeparateMatrixFunction::call(), blender::mesh_loops_to_tessdata(), and blender::bke::validate_bool_attribute().
|
inlineconstexpr |
Does a linear search to see of the value is in the array. Returns true if it is, otherwise false.
Definition at line 281 of file bmesh_polygon.hh.
References blender::ATTR_NONNULL(), and blender::BM_face_as_array_loop_quad().
Referenced by blender::BKE_grease_pencil_material_index_used(), blender::BKE_mesh_material_index_used(), blender::ed::sculpt_paint::face_set::change_visibility_exec(), blender::ed::greasepencil::grease_pencil_copy_strokes_exec(), and blender::bke::write_sharp_bezier_edges().
|
inlineconstexpr |
Does a constant time check to see if the pointer points to a value in the referenced array. Return true if it is, otherwise false.
Definition at line 295 of file bmesh_polygon.hh.
|
inlineconstexpr |
Does a linear search to count how often the value is in the array. Returns the number of occurrences.
Definition at line 304 of file bmesh_polygon.hh.
References blender::BM_vert_tri_calc_tangent_edge_pair().
|
inlineconstexpr |
Returns the pointer to the beginning of the referenced array. This may be nullptr when the size is zero.
Definition at line 219 of file bmesh_polygon.hh.
Referenced by blender::file_draw_preview(), and blender::make_duplis_faces().
|
inlineconstexpr |
Returns a new Span with n elements removed from the end. This invokes undefined behavior when n is negative.
Definition at line 186 of file bmesh_polygon.hh.
Referenced by blender::create_envelope_strokes().
|
inlineconstexpr |
Returns a new Span with n elements removed from the beginning. This invokes undefined behavior when n is negative.
Definition at line 175 of file bmesh_polygon.hh.
References blender::BM_vert_calc_normal(), and blender::v.
Referenced by blender::bmo_space_edge_loops_evenly_exec().
|
inlineconstexpr |
Definition at line 228 of file bmesh_polygon.hh.
Referenced by blender::ed::greasepencil::attributes_elements_are_equal(), and blender::nodes::node_geo_field_variance_cc::FieldVarianceInput::get_varray_for_context().
|
inlineconstexpr |
Return a reference to the first element in the array. This invokes undefined behavior when the array is empty.
Definition at line 319 of file bmesh_polygon.hh.
|
inlineconstexpr |
Returns the index of the first occurrence of the given value. This invokes undefined behavior when the value is not in the array.
Definition at line 381 of file bmesh_polygon.hh.
|
inlineconstexpr |
Returns the index of the first occurrence of the given value or -1 if it does not exist.
Definition at line 391 of file bmesh_polygon.hh.
|
inlineconstexpr |
Check if the array contains duplicates. Does a linear search for every element. So the total running time is O(n^2). Only use this for small arrays.
Definition at line 340 of file bmesh_polygon.hh.
|
inlineconstexpr |
Definition at line 410 of file bmesh_polygon.hh.
|
inlineconstexpr |
Utility to make it more convenient to iterate over all indices that can be used with this array.
Definition at line 405 of file bmesh_polygon.hh.
Referenced by blender::bke::SampleIndexFunction::call(), blender::geometry::create_id_index_map(), create_subd_mesh(), blender::io::alembic::ABCPointCloudWriter::do_write(), blender::ed::sculpt_paint::face_set::find_next_available_id(), blender::io::usd::get_loops_polys(), blender::nodes::node_geo_field_average_cc::FieldAverageInput::get_varray_for_context(), blender::nodes::node_geo_field_variance_cc::FieldVarianceInput::get_varray_for_context(), blender::io::alembic::get_velocities(), blender::io::alembic::get_vert_creases(), blender::io::usd::get_vert_creases(), blender::bounds::max(), and blender::ed::greasepencil::select_similar_by_layer().
|
inlineconstexpr |
Returns true when this and the other array have an element in common. This should only be called on small arrays, because it has a running time of O(n*m) where n and m are the sizes of the arrays.
Definition at line 362 of file bmesh_polygon.hh.
|
inlineconstexpr |
Returns true if the size is zero.
Definition at line 264 of file bmesh_polygon.hh.
Referenced by blender::BKE_shrinkwrap_compute_smooth_normal(), blender::BM_mesh_bm_from_me(), blender::draw::calc_face_tri_starts_mesh(), blender::draw::calc_face_visibility_mesh(), blender::ed::sculpt_paint::auto_mask::calc_grids_factors(), blender::draw::calc_mesh_edge_visibility(), blender::ed::sculpt_paint::islands::calc_topology_islands_mesh(), blender::draw::pbvh::calc_use_flat_layout(), blender::draw::calc_vert_visibility_mapped_mesh(), blender::draw::calc_vert_visibility_mesh(), blender::draw::calc_visible_loose_edge_indices(), blender::geometry::construct::check_edge_data_seam_sharp_edges(), blender::ed::sculpt_paint::face_set::check_single_face_set(), blender::geometry::construct::choose_rep_face(), create_mesh(), blender::ed::sculpt_paint::face_set::create_op_exec(), create_subd_mesh(), blender::ed::sculpt_paint::face_set::delete_geometry(), blender::ed::sculpt_paint::brushes::do_layer_brush(), blender::do_vpaint_brush_blur_loops(), blender::do_vpaint_brush_blur_verts(), blender::do_vpaint_brush_smear(), blender::io::alembic::ABCPointCloudWriter::do_write(), blender::draw::draw_subdiv_cache_extra_coarse_face_data_mapped(), blender::draw::draw_subdiv_cache_extra_coarse_face_data_mesh(), blender::dynamicPaint_createUVSurface(), blender::dynamicPaint_setInitialColor(), blender::ed::sculpt_paint::face_set::edit_grow_shrink(), blender::ed::sculpt_paint::expand::enabled_state_to_bitmap(), blender::ed::sculpt_paint::cloth::ensure_nodes_constraints(), blender::bke::CurvesGeometry::evaluated_normals(), blender::ed::sculpt_paint::AddOperationExecutor::execute(), blender::ed::sculpt_paint::DensityAddOperationExecutor::execute(), blender::ed::sculpt_paint::SlideOperationExecutor::execute(), export_pointcloud_motion(), blender::draw::extract_edituv_lines_mesh(), blender::draw::extract_edituv_lines_subdiv_mesh(), blender::draw::extract_paint_overlay_flags(), blender::ed::sculpt_paint::fill_mesh_face_or_corner_attribute(), blender::draw::pbvh::fill_normals_grids(), blender::geometry::fit_poly_to_bezier_curves(), blender::bke::pbvh::Tree::from_mesh(), blender::io::ply::generate_vertex_map(), blender::get_compositor_group_output_extra_info(), blender::io::alembic::get_uv_sample(), blender::io::alembic::get_velocities(), blender::gradientVertInit__mapFunc(), blender::ed::sculpt_paint::imapaint_pick_uv(), blender::ed::sculpt_paint::auto_mask::init_face_sets_masking(), blender::ed::sculpt_paint::face_set::init_flood_fill(), blender::ed::mesh::join_face_sets(), blender::lineart_load_tri_task(), blender::make_duplis_faces(), blender::ed::sculpt_paint::hide::mesh_show_all(), blender::MOD_solidify_extrude_modifyMesh(), blender::MOD_solidify_nonmanifold_modifyMesh(), blender::modify_mesh(), blender::ed::object::multiresbake_check(), blender::nodes::node_geo_deform_curves_on_surface_cc::node_geo_exec(), blender::RE_bake_pixels_populate(), blender::draw::detail::read_radiance_sh_attributes(), blender::ed::curves::snap_curves_to_surface::snap_curves_to_surface_exec_object(), blender::ed::sculpt_paint::undo::store_face_sets(), blender::ed::sculpt_paint::undo::store_face_visibility(), blender::io::obj::OBJMesh::store_uv_coords_and_indices(), blender::ed::sculpt_paint::undo::store_vert_visibility_mesh(), blender::tests::TEST_F(), blender::bke::Instances::unique_ids(), blender::draw::pbvh::update_face_sets_mesh(), blender::draw::pbvh::update_normals_mesh(), blender::bke::pbvh::update_visibility_faces(), and blender::weight_paint_set().
|
inlineconstexpr |
Returns a reference to the nth last element. This invokes undefined behavior when the span is too short.
Definition at line 329 of file bmesh_polygon.hh.
|
inlineconstexpr |
Access an element in the array. This invokes undefined behavior when the index is out of bounds.
Definition at line 246 of file bmesh_polygon.hh.
|
inlineconstexpr |
Definition at line 233 of file bmesh_polygon.hh.
|
inlineconstexpr |
Definition at line 237 of file bmesh_polygon.hh.
|
inlineconstexpr |
Returns the number of elements in the referenced array.
Definition at line 256 of file bmesh_polygon.hh.
References blender::ATTR_NONNULL(), blender::BM_face_splits_check_optimal(), and len().
Referenced by blender::io::obj::OBJMesh::calc_face_order(), blender::geometry::construct::check_edge_data_seam_sharp_edges(), blender::console_line_wrap_offset_to_xy(), blender::draw::create_edit_points_radius(), blender::geometry::create_id_index_map(), blender::get_compositor_group_output_extra_info(), blender::nodes::node_geo_uv_tangent_cc::TangentFieldInput::get_varray_for_context(), blender::io::alembic::get_velocities(), blender::io::obj::OBJMesh::store_uv_coords_and_indices(), blender::fn::tests::TEST_F(), and blender::tests::TEST_F().
|
inlineconstexpr |
Returns the number of bytes referenced by this Span.
Definition at line 272 of file bmesh_polygon.hh.
|
inlineconstexpr |
Definition at line 149 of file bmesh_polygon.hh.
|
inlineconstexpr |
Returns a contiguous part of the array. This invokes undefined behavior when the start or size is negative.
Definition at line 141 of file bmesh_polygon.hh.
Referenced by blender::bke::CurvesGeometry::calculate_bezier_auto_handles(), blender::bke::calculate_evaluated_offsets(), blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_curves(), blender::bke::CurvesGeometry::evaluated_normals(), blender::geometry::fillet_curves(), blender::io::grease_pencil::GreasePencilExporter::foreach_shape_in_layer(), blender::draw::grease_pencil_edit_batch_ensure(), blender::make_child_duplis_faces_from_mesh(), blender::geometry::sample_curve_positions_and_handles(), blender::geometry::smooth_curve_attribute(), blender::geometry::subdivide_curves(), blender::geometry::trim_bezier_curves(), and blender::bke::write_sharp_bezier_edges().
|
inlineconstexpr |
Returns a contiguous part of the array. This invokes undefined behavior when the start or size is negative. Clamps the size of the new span so it fits in the current one.
Definition at line 158 of file bmesh_polygon.hh.
|
inlineconstexpr |
Definition at line 166 of file bmesh_polygon.hh.
|
inlineconstexpr |
Returns a new Span that only contains the last n elements. This invokes undefined behavior when n is negative.
Definition at line 208 of file bmesh_polygon.hh.
|
inlineconstexpr |
Returns a new Span that only contains the first n elements. This invokes undefined behavior when n is negative.
Definition at line 197 of file bmesh_polygon.hh.
Referenced by blender::geometry::construct::build_output_mesh().
Definition at line 437 of file bmesh_polygon.hh.
Definition at line 429 of file bmesh_polygon.hh.
|
protected |
Definition at line 85 of file bmesh_polygon.hh.
|
protected |
Definition at line 86 of file bmesh_polygon.hh.
Referenced by blender::VArraySpan< T >::VArraySpan(), and blender::VArraySpan< T >::VArraySpan().