|
Blender V5.0
|
#include <BLI_virtual_array.hh>
Inherits blender::VArrayCommon< T >.
Public Member Functions | |
| VArray ()=default | |
| VArray (const VArray &other)=default | |
| VArray (VArray &&other) noexcept=default | |
| VArray (const VArrayImpl< T > *impl) | |
| VArray (std::shared_ptr< const VArrayImpl< T > > impl) | |
| VArray (varray_tag::span, Span< T > span) | |
| VArray (varray_tag::single, T value, const int64_t size) | |
| VArray & | operator= (const VArray &other) |
| VArray & | operator= (VArray &&other) noexcept |
| Public Member Functions inherited from blender::VArrayCommon< T > | |
| operator bool () const | |
| T | operator[] (const int64_t index) const |
| T | get (const int64_t index) const |
| int64_t | size () const |
| T | first () const |
| T | last (const int64_t n=0) const |
| bool | is_empty () const |
| IndexRange | index_range () const |
| CommonVArrayInfo | common_info () const |
| bool | is_span () const |
| Span< T > | get_internal_span () const |
| bool | is_single () const |
| T | get_internal_single () const |
| std::optional< T > | get_if_single () const |
| void | materialize (MutableSpan< T > r_span) const |
| void | materialize (const IndexMask &mask, MutableSpan< T > r_span) const |
| void | materialize_to_uninitialized (MutableSpan< T > r_span) const |
| void | materialize_to_uninitialized (const IndexMask &mask, MutableSpan< T > r_span) const |
| void | materialize_compressed (const IndexMask &mask, MutableSpan< T > r_span) const |
| void | materialize_compressed_to_uninitialized (const IndexMask &mask, MutableSpan< T > r_span) const |
| bool | try_assign_GVArray (GVArray &varray) const |
| const VArrayImpl< T > * | get_implementation () const |
Static Public Member Functions | |
| template<typename ImplT, typename... Args> | |
| static VArray | from (Args &&...args) |
| static VArray | from_single (T value, const int64_t size) |
| static VArray | from_span (Span< T > values) |
| template<typename GetFunc> | |
| static VArray | from_func (const int64_t size, GetFunc get_func) |
| static VArray | from_std_func (const int64_t size, std::function< T(int64_t index)> get_func) |
| template<typename StructT, T(*)(const StructT &) GetFunc> | |
| static VArray | from_derived_span (Span< StructT > values) |
| template<typename ContainerT> | |
| static VArray | from_container (ContainerT container) |
Additional Inherited Members | |
| Protected Types inherited from blender::VArrayCommon< T > | |
| using | Storage = Any<blender::detail::VArrayAnyExtraInfo<T>, 24, 8> |
| Protected Member Functions inherited from blender::VArrayCommon< T > | |
| VArrayCommon ()=default | |
| VArrayCommon (const VArrayCommon &other) | |
| VArrayCommon (VArrayCommon &&other) noexcept | |
| VArrayCommon (const VArrayImpl< T > *impl) | |
| VArrayCommon (std::shared_ptr< const VArrayImpl< T > > impl) | |
| template<typename ImplT, typename... Args> | |
| void | emplace (Args &&...args) |
| void | copy_from (const VArrayCommon &other) |
| void | move_from (VArrayCommon &&other) noexcept |
| const VArrayImpl< T > * | impl_from_storage () const |
| Protected Attributes inherited from blender::VArrayCommon< T > | |
| const VArrayImpl< T > * | impl_ = nullptr |
| Storage | storage_ |
A VArray wraps a virtual array implementation and provides easy access to its elements. It can be copied and moved. While it is relatively small, it should still be passed by reference if possible (other than e.g. Span).
Definition at line 858 of file BLI_virtual_array.hh.
|
default |
Referenced by from(), from_container(), from_derived_span(), from_func(), from_single(), from_span(), from_std_func(), operator=(), operator=(), VArray(), and VArray().
|
default |
References VArray().
|
defaultnoexcept |
References VArray().
|
inline |
Definition at line 866 of file BLI_virtual_array.hh.
References T, and blender::VArrayCommon< T >::VArrayCommon().
|
inline |
Definition at line 868 of file BLI_virtual_array.hh.
References T, and blender::VArrayCommon< T >::VArrayCommon().
|
inline |
Definition at line 870 of file BLI_virtual_array.hh.
References blender::VArrayCommon< T >::emplace().
|
inline |
Definition at line 875 of file BLI_virtual_array.hh.
References blender::VArrayCommon< T >::emplace(), blender::VArrayCommon< T >::size(), and T.
|
inlinestatic |
Construct a new virtual array for a custom VArrayImpl.
Definition at line 883 of file BLI_virtual_array.hh.
References blender::VArrayCommon< T >::emplace(), and VArray().
Referenced by from_container(), from_derived_span(), and from_func().
|
inlinestatic |
Construct a new virtual array for an existing container. Every container that lays out the elements in a plain array works. This takes ownership of the passed in container. If that is not desired, use from_span instead.
Definition at line 944 of file BLI_virtual_array.hh.
References from(), and VArray().
Referenced by blender::draw::attribute_interpolate(), blender::ed::greasepencil::clipboard_paste_strokes_ex(), blender::nodes::node_geo_uv_pack_islands_cc::construct_uv_gvarray(), blender::nodes::node_geo_uv_unwrap_cc::construct_uv_gvarray(), blender::bke::curve_normals_varray(), blender::deform_drawing(), blender::modifier::greasepencil::get_influence_vertex_weights(), blender::nodes::node_geo_curve_handle_type_selection_cc::HandleTypeFieldInput::get_varray_for_context(), blender::nodes::node_geo_curve_topology_curve_of_point_cc::CurveOfPointInput::get_varray_for_context(), blender::nodes::node_geo_curve_topology_points_of_curve_cc::PointsOfCurveInput::get_varray_for_context(), blender::nodes::node_geo_edges_to_face_groups_cc::FaceSetFromBoundariesInput::get_varray_for_context(), blender::nodes::node_geo_index_of_nearest_cc::HasNeighborFieldInput::get_varray_for_context(), blender::nodes::node_geo_index_of_nearest_cc::IndexOfNearestFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_curve_handles_cc::HandlePositionFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_instance_bounds_cc::InstanceBoundsField::get_varray_for_context(), blender::nodes::node_geo_input_mesh_edge_neighbors_cc::EdgeNeighborCountFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_mesh_vertex_neighbors_cc::VertexCountFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_mesh_vertex_neighbors_cc::VertexFaceCountFieldInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_corners_of_edge_cc::CornersOfEdgeCountInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_corners_of_edge_cc::CornersOfEdgeInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_corners_of_face_cc::CornersOfFaceInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_corners_of_vertex_cc::CornersOfVertCountInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_corners_of_vertex_cc::CornersOfVertInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_edges_of_vertex_cc::EdgesOfVertCountInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_edges_of_vertex_cc::EdgesOfVertInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_offset_corner_in_face_cc::OffsetCornerInFaceFieldInput::get_varray_for_context(), blender::nodes::node_geo_offset_point_in_curve_cc::ControlPointNeighborFieldInput::get_varray_for_context(), blender::nodes::node_geo_offset_point_in_curve_cc::OffsetValidFieldInput::get_varray_for_context(), blender::nodes::node_geo_tool_selection_cc::SculptSelectionFieldInput::get_varray_for_context(), blender::bke::mesh_normals_varray(), blender::nodes::node_geo_material_selection_cc::select_by_material(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), and blender::tests::TEST().
|
inlinestatic |
Construct a new virtual array for an existing span with a mapping function. This does not take ownership of the span.
Definition at line 931 of file BLI_virtual_array.hh.
References blender::Span< T >::data(), from(), blender::Span< T >::size(), and VArray().
Referenced by blender::bke::instance_position_varray(), and blender::tests::TEST().
|
inlinestatic |
Construct a new virtual that will invoke the provided function whenever an element is accessed.
Definition at line 912 of file BLI_virtual_array.hh.
References from(), blender::VArrayCommon< T >::size(), T, and VArray().
Referenced by blender::bke::construct_curve_length_gvarray(), blender::nodes::node_geo_input_spline_length_cc::construct_curve_point_count_gvarray(), blender::nodes::node_geo_input_mesh_edge_vertices_cc::construct_edge_positions_gvarray(), blender::nodes::node_geo_input_mesh_edge_vertices_cc::construct_edge_verts_gvarray(), blender::nodes::node_geo_input_mesh_face_area_cc::construct_face_area_varray(), from_std_func(), blender::ed::spreadsheet::BundleDataSource::get_column_values(), blender::ed::spreadsheet::ClosureSignatureDataSource::get_column_values(), blender::fn::IndexFieldInput::get_index_varray(), blender::bke::NamedLayerSelectionFieldInput::get_varray_for_context(), blender::fn::tests::IndexFieldInput::get_varray_for_context(), blender::nodes::node_geo_curve_topology_curve_of_point_cc::PointIndexInCurveInput::get_varray_for_context(), blender::nodes::node_geo_curve_topology_points_of_curve_cc::CurvePointCountInput::get_varray_for_context(), blender::nodes::node_geo_input_instance_rotation_cc::InstanceRotationFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_instance_scale_cc::InstanceScaleFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_mesh_edge_angle_cc::AngleFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_mesh_edge_angle_cc::SignedAngleFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_mesh_face_is_planar_cc::PlanarFieldInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_corners_of_face_cc::CornersOfFaceCountInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_edges_of_corner_cc::CornerPreviousEdgeFieldInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_face_of_corner_cc::CornerIndexInFaceInput::get_varray_for_context(), blender::ed::sculpt_paint::greasepencil::SmoothOperation::on_stroke_extended(), blender::tests::TEST(), blender::tests::TEST(), and blender::tests::TEST().
|
inlinestatic |
Construct a new virtual array that has the same value at every index.
Definition at line 894 of file BLI_virtual_array.hh.
References blender::VArrayCommon< T >::size(), T, and VArray().
Referenced by blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::active_smoothing(), blender::ed::curves::pen_tool::add_single_point_and_curve(), blender::ed::greasepencil::boundary_to_curves(), blender::create_envelope_strokes(), blender::ed::sculpt_paint::face_set::create_face_sets_mesh(), blender::ed::transform::curves::createTransCurvesVerts(), blender::deform_drawing(), blender::deform_drawing(), blender::draw::CurvesEvalCache::ensure_common(), blender::draw::ensure_curve_attribute(), blender::ed::sculpt_paint::face_set::ensure_face_sets_mesh(), blender::ed::curves::ensure_selection_attribute(), blender::ed::pointcloud::ensure_selection_attribute(), blender::ed::curves::extrude_curves(), blender::geometry::fillet_curves_bezier(), blender::ed::sculpt_paint::float_selection_ensure(), blender::io::grease_pencil::GreasePencilExporter::foreach_stroke_in_layer(), blender::modifier::greasepencil::get_influence_vertex_weights(), blender::ed::greasepencil::get_stroke_colors(), blender::bke::AttributeExistsFieldInput::get_varray_for_context(), blender::bke::NamedLayerSelectionFieldInput::get_varray_for_context(), blender::nodes::node_geo_index_of_nearest_cc::HasNeighborFieldInput::get_varray_for_context(), blender::ed::sculpt_paint::grease_pencil_apply_fill(), blender::ed::sculpt_paint::grease_pencil_fill_overlay_cb(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_sequence_exec(), blender::ed::sculpt_paint::greasepencil::grease_pencil_interpolate_update(), blender::ed::greasepencil::grease_pencil_primitive_init_curves(), blender::ed::greasepencil::grease_pencil_set_corner_type_exec(), blender::ed::greasepencil::grease_pencil_set_uniform_opacity_exec(), blender::ed::greasepencil::grease_pencil_stroke_simplify_exec(), blender::io::csv::import_csv_as_pointcloud(), blender::draw::interpolate_corners(), blender::ed::greasepencil::join_geometries_with_transform(), blender::bke::AttributeAccessor::lookup_or_default(), blender::bke::mesh_calc_edges(), blender::bke::mesh_smooth_set(), blender::modify_drawing(), blender::modify_drawing(), blender::modify_fill_color(), blender::ed::space_node::node_draw_zones_and_frames(), blender::nodes::node_geo_set_grease_pencil_color_cc::node_geo_exec(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_start_sample(), blender::bke::curves::reader_for_vertex_group_index(), blender::nodes::node_geo_material_selection_cc::select_by_material(), blender::bke::greasepencil::Drawing::set_texture_matrices(), blender::simplify_drawing(), blender::ed::greasepencil::GreasePencilPenToolOperation::single_point_attributes(), blender::geometry::smooth_curve_attribute(), blender::geometry::smooth_curve_positions(), blender::ed::sculpt_paint::smooth_fill_strokes(), blender::ed::sculpt_paint::greasepencil::smooth_stroke(), blender::subdivide_drawing(), blender::tests::TEST(), blender::tests::TEST(), blender::GVArray::typed(), and blender::write_stroke_transforms().
Construct a new virtual array for an existing span. This does not take ownership of the underlying memory.
Definition at line 903 of file BLI_virtual_array.hh.
References VArray().
Referenced by blender::ed::geometry::add_shape_keys_as_attributes(), blender::ed::spreadsheet::build_mesh_debug_columns(), blender::ed::spreadsheet::calc_mesh_selection_mask(), blender::nodes::node_geo_distribute_points_on_faces_cc::compute_normal_outputs(), blender::io::ply::convert_ply_to_mesh(), blender::bke::curve_normals_varray(), blender::deform_drawing(), blender::ed::curves::subdivide::exec(), blender::ed::spreadsheet::BundleDataSource::get_column_values(), blender::nodes::node_geo_curve_topology_points_of_curve_cc::PointsOfCurveInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_edges_of_corner_cc::CornerNextEdgeFieldInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_face_of_corner_cc::CornerFaceIndexInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_vertex_of_corner_cc::CornerVertFieldInput::get_varray_for_context(), blender::ed::sculpt_paint::grease_pencil_fill_overlay_cb(), blender::ed::object::mesh_data_to_grease_pencil(), blender::bke::mesh_normals_varray(), blender::bke::MeshTopologyState::MeshTopologyState(), blender::ed::sculpt_paint::greasepencil::SmoothOperation::on_stroke_extended(), blender::bke::MeshTopologyState::same_topology_as(), blender::ed::sculpt_paint::set_persistent_base_exec(), blender::geometry::smooth_curve_attribute(), blender::geometry::smooth_curve_positions(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::GVArray::typed(), and blender::ed::sculpt_paint::expand::write_mask_data().
|
inlinestatic |
Same as from_func, but uses a std::function instead of a template. This is slower, but requires less code generation. Therefore this should be used in non-performance critical code.
Definition at line 921 of file BLI_virtual_array.hh.
References from_func(), blender::VArrayCommon< T >::size(), and VArray().
Referenced by blender::ed::spreadsheet::build_mesh_debug_columns(), blender::ed::spreadsheet::GeometryDataSource::get_column_values(), blender::ed::spreadsheet::VolumeDataSource::get_column_values(), and blender::ed::sculpt_paint::get_fill_boundary_layers().
Definition at line 949 of file BLI_virtual_array.hh.
References blender::VArrayCommon< T >::copy_from(), and VArray().
|
inlinenoexcept |
Definition at line 955 of file BLI_virtual_array.hh.
References blender::VArrayCommon< T >::move_from(), and VArray().