|
Blender V5.0
|
#include <BLI_span.hh>
Inherited by blender::MutableVArraySpan< 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 = T * |
| using | size_type = int64_t |
Public Member Functions | |
| constexpr | MutableSpan ()=default |
| constexpr | MutableSpan (T *start, const int64_t size) |
| constexpr | MutableSpan (std::vector< T > &vector) |
| template<std::size_t N> | |
| constexpr | MutableSpan (std::array< T, N > &array) |
| template<typename U, BLI_ENABLE_IF((is_span_convertible_pointer_v< U, T >))> | |
| constexpr | MutableSpan (MutableSpan< U > span) |
| constexpr | operator Span< T > () const |
| template<typename U, BLI_ENABLE_IF((is_span_convertible_pointer_v< T, U >))> | |
| constexpr | operator Span< U > () const |
| constexpr int64_t | size () const |
| constexpr int64_t | size_in_bytes () const |
| constexpr bool | is_empty () const |
| constexpr void | fill (const T &value) const |
| template<typename IndexT> | |
| constexpr void | fill_indices (Span< IndexT > indices, const T &value) const |
| constexpr T * | data () const |
| constexpr T * | begin () const |
| constexpr T * | end () const |
| constexpr std::reverse_iterator< T * > | rbegin () const |
| constexpr std::reverse_iterator< T * > | rend () const |
| constexpr T & | operator[] (const int64_t index) const |
| constexpr MutableSpan | slice (const int64_t start, const int64_t size) const |
| constexpr MutableSpan | slice (IndexRange range) const |
| constexpr MutableSpan | slice_safe (const int64_t start, const int64_t size) const |
| constexpr MutableSpan | slice_safe (IndexRange range) const |
| constexpr MutableSpan | drop_front (const int64_t n) const |
| constexpr MutableSpan | drop_back (const int64_t n) const |
| constexpr MutableSpan | take_front (const int64_t n) const |
| constexpr MutableSpan | take_back (const int64_t n) const |
| constexpr void | reverse () const |
| constexpr Span< T > | as_span () const |
| constexpr IndexRange | index_range () const |
| constexpr T & | first () const |
| constexpr T & | last (const int64_t n=0) const |
| constexpr int64_t | count (const T &value) const |
| constexpr bool | contains (const T &value) const |
| constexpr bool | contains_ptr (const T *ptr) const |
| constexpr void | copy_from (Span< T > values) const |
| template<typename NewT> | |
| constexpr MutableSpan< NewT > | cast () const |
Protected Attributes | |
| T * | data_ = nullptr |
| int64_t | size_ = 0 |
Mostly the same as Span, except that one can change the array elements through a MutableSpan.
Definition at line 443 of file BLI_span.hh.
| using blender::MutableSpan< T >::const_pointer = const T * |
Definition at line 447 of file BLI_span.hh.
| using blender::MutableSpan< T >::const_reference = const T & |
Definition at line 449 of file BLI_span.hh.
| using blender::MutableSpan< T >::iterator = T * |
Definition at line 450 of file BLI_span.hh.
| using blender::MutableSpan< T >::pointer = T * |
Definition at line 446 of file BLI_span.hh.
| using blender::MutableSpan< T >::reference = T & |
Definition at line 448 of file BLI_span.hh.
| using blender::MutableSpan< T >::size_type = int64_t |
Definition at line 451 of file BLI_span.hh.
| using blender::MutableSpan< T >::value_type = T |
Definition at line 445 of file BLI_span.hh.
|
constexprdefault |
|
inlineconstexpr |
Definition at line 460 of file BLI_span.hh.
|
inlineconstexpr |
Definition at line 462 of file BLI_span.hh.
|
inlineconstexpr |
Definition at line 465 of file BLI_span.hh.
|
inlineconstexpr |
Support implicit conversions like the one below: MutableSpan<T *> -> MutableSpan<const T *>
Definition at line 474 of file BLI_span.hh.
|
inlineconstexpr |
Returns an (immutable) Span that references the same array. This is usually not needed, due to implicit conversions. However, sometimes automatic type deduction needs some help.
Definition at line 661 of file BLI_span.hh.
|
inlineconstexpr |
Definition at line 544 of file BLI_span.hh.
|
inlineconstexpr |
Returns a new span to the same underlying memory buffer. No conversions are done. The caller is responsible for making sure that the type cast is valid.
Definition at line 749 of file BLI_span.hh.
|
inlineconstexpr |
Does a linear search to see of the value is in the array. Returns true if it is, otherwise false.
Definition at line 715 of file BLI_span.hh.
|
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 729 of file BLI_span.hh.
|
inlineconstexpr |
Copy all values from another span into this span. This invokes undefined behavior when the destination contains uninitialized data and T is not trivially copy constructible. The size of both spans is expected to be the same.
Definition at line 739 of file BLI_span.hh.
Referenced by blender::ed::curves::copy_data_to_geometry(), blender::bke::copy_point_selection_custom_knots(), blender::io::obj::OBJCurvesTest::create_rational_nurbs(), blender::geometry::curves_merge_endpoints(), data_transfer_layersmapping_generate(), blender::geometry::debug_randomize_curve_order(), blender::io::grease_pencil::extend_curves_geometry(), blender::ed::sculpt_paint::greasepencil::interpolate_between_curves(), blender::ed::space_node::node_draw_zones_and_frames(), blender::io::usd::USDBasisCurvesReader::read_curve_sample(), blender::io::usd::USDNurbsReader::read_curve_sample(), blender::io::alembic::AbcCurveReader::read_curves_sample(), and blender::ed::sculpt_paint::expand::write_mask_data().
|
inlineconstexpr |
Does a linear search to count how often the value is in the array. Returns the number of occurrences.
Definition at line 700 of file BLI_span.hh.
|
inlineconstexpr |
Returns a pointer to the beginning of the referenced array. This may be nullptr, when the size is zero.
Definition at line 539 of file BLI_span.hh.
Referenced by do_weight_paint_vertex_multi(), and do_weight_paint_vertex_single().
|
inlineconstexpr |
Returns a new MutableSpan with n elements removed from the end. This invokes undefined behavior when n is negative.
Definition at line 618 of file BLI_span.hh.
Referenced by blender::geometry::create_curve_from_vert_indices(), and blender::ed::curves::resize_curves().
|
inlineconstexpr |
Returns a new MutableSpan with n elements removed from the beginning. This invokes undefined behavior when n is negative.
Definition at line 607 of file BLI_span.hh.
Referenced by blender::ed::greasepencil::extrude_grease_pencil_curves().
|
inlineconstexpr |
Definition at line 548 of file BLI_span.hh.
|
inlineconstexpr |
Replace all elements in the referenced array with the given value.
Definition at line 517 of file BLI_span.hh.
Referenced by blender::ed::object::convert_curves_legacy_to_grease_pencil(), blender::ed::object::convert_curves_to_grease_pencil(), blender::ed::object::convert_font_to_grease_pencil(), blender::nodes::node_geo_curve_primitive_bezier_segment_cc::create_bezier_segment_curve(), blender::geometry::create_curves_for_faces(), blender::io::obj::OBJCurvesTest::create_nurbs(), blender::bke::CurvesGeometry::CurvesGeometry(), blender::io::usd::USDBasisCurvesReader::read_curve_sample(), and blender::io::alembic::AbcCurveReader::read_curves_sample().
|
inlineconstexpr |
Replace a subset of all elements with the given value. This invokes undefined behavior when one of the indices is out of bounds.
Definition at line 526 of file BLI_span.hh.
Referenced by blender::ed::sculpt_paint::cloth::apply_grab_brush().
|
inlineconstexpr |
Return a reference to the first element in the array. This invokes undefined behavior when the array is empty.
Definition at line 679 of file BLI_span.hh.
Referenced by blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_points(), blender::nodes::node_geo_curve_primitive_arc_cc::create_arc_curve_from_radius(), blender::nodes::node_geo_curve_primitive_circle_cc::create_point_circle_curve(), blender::nodes::node_geo_curve_primitive_circle_cc::create_radius_circle_curve(), blender::nodes::node_geo_curve_primitive_star_cc::create_star_curve(), blender::ed::space_node::node_draw_zones_and_frames(), and blender::nodes::node_geo_curve_primitive_quadrilateral_cc::node_geo_exec().
|
inlineconstexpr |
Utility to make it more convenient to iterate over all indices that can be used with this array.
Definition at line 670 of file BLI_span.hh.
Referenced by cloth_make_rest_mesh(), grease_pencil_do_layer_adjustments(), and versioning_grease_pencil_stroke_radii_scaling().
|
inlineconstexpr |
Returns true if the size is zero.
Definition at line 509 of file BLI_span.hh.
|
inlineconstexpr |
Returns a reference to the nth last element. This invokes undefined behavior when the span is too short.
Definition at line 689 of file BLI_span.hh.
Referenced by blender::bke::Instances::add_instance(), blender::geometry::create_curve_from_vert_indices(), blender::create_envelope_strokes(), blender::geometry::execute_realize_curve_tasks(), blender::geometry::extract_greasepencil_layer_points(), and blender::ed::greasepencil::GreasePencilPenToolOperation::single_point_attributes().
|
inlineconstexpr |
Definition at line 479 of file BLI_span.hh.
|
inlineconstexpr |
Definition at line 485 of file BLI_span.hh.
|
inlineconstexpr |
Definition at line 562 of file BLI_span.hh.
|
inlineconstexpr |
Definition at line 553 of file BLI_span.hh.
|
inlineconstexpr |
Definition at line 557 of file BLI_span.hh.
|
inlineconstexpr |
Reverse the data in the MutableSpan.
Definition at line 650 of file BLI_span.hh.
|
inlineconstexpr |
Returns the number of elements in the array.
Definition at line 493 of file BLI_span.hh.
|
inlineconstexpr |
Returns the number of bytes referenced by this Span.
Definition at line 501 of file BLI_span.hh.
|
inlineconstexpr |
Returns a contiguous part of the array. This invokes undefined behavior when the start or size is negative.
Definition at line 573 of file BLI_span.hh.
Referenced by blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), blender::geometry::calc_radius_without_interpolation(), blender::geometry::create_curve_from_vert_indices(), blender::create_envelope_strokes(), blender::geometry::execute_realize_curve_task(), blender::ed::sculpt_paint::greasepencil::find_curve_mapping_from_index(), blender::ed::greasepencil::grease_pencil_primitive_update_curves(), and update_custom_knots().
|
inlineconstexpr |
Definition at line 581 of file BLI_span.hh.
|
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 590 of file BLI_span.hh.
|
inlineconstexpr |
Definition at line 598 of file BLI_span.hh.
|
inlineconstexpr |
Return a new MutableSpan that only contains the last n elements. This invokes undefined behavior when n is negative.
Definition at line 640 of file BLI_span.hh.
|
inlineconstexpr |
Returns a new MutableSpan that only contains the first n elements. This invokes undefined behavior when n is negative.
Definition at line 629 of file BLI_span.hh.
|
protected |
Definition at line 454 of file BLI_span.hh.
|
protected |
Definition at line 455 of file BLI_span.hh.