Blender
V3.3
|
#include <BKE_geometry_set.hh>
Public Member Functions | |
Geometry Component Implementation | |
MeshComponent () | |
~MeshComponent () | |
GeometryComponent * | copy () const override |
void | clear () |
bool | has_mesh () const |
void | replace (Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned) |
Mesh * | release () |
const Mesh * | get_for_read () const |
Mesh * | get_for_write () |
bool | is_empty () const final |
bool | owns_direct_data () const override |
void | ensure_owns_direct_data () override |
Attribute Access | |
std::optional< blender::bke::AttributeAccessor > | attributes () const final |
std::optional< blender::bke::MutableAttributeAccessor > | attributes_for_write () final |
![]() | |
virtual | ~GeometryComponent ()=default |
GeometryComponent (GeometryComponentType type) | |
int | attribute_domain_size (eAttrDomain domain) const |
void | user_add () const |
void | user_remove () const |
bool | is_mutable () const |
GeometryComponentType | type () const |
Static Public Attributes | |
static constexpr GeometryComponentType | static_type = GEO_COMPONENT_TYPE_MESH |
Additional Inherited Members | |
![]() | |
static GeometryComponent * | create (GeometryComponentType component_type) |
A geometry component that can store a mesh, using the Mesh data-block.
Attributes are stored, on any of the four attribute domains. Generic attributes are stored in contiguous arrays, but often built-in attributes are stored in an array of structs fashion for historical reasons, requiring more complex attribute access.
Definition at line 364 of file BKE_geometry_set.hh.
MeshComponent::MeshComponent | ( | ) |
Definition at line 25 of file geometry_component_mesh.cc.
Referenced by copy().
MeshComponent::~MeshComponent | ( | ) |
Definition at line 29 of file geometry_component_mesh.cc.
References clear().
|
finalvirtual |
Get access to the attributes in this geometry component. May return none if the geometry does not support the attribute system.
Reimplemented from GeometryComponent.
Definition at line 1325 of file geometry_component_mesh.cc.
References blender::bke::get_mesh_accessor_functions_ref().
Referenced by blender::nodes::node_geo_mesh_to_points_cc::geometry_set_mesh_to_points(), blender::nodes::node_geo_edge_paths_to_selection_cc::PathToEdgeSelectionFieldInput::get_varray_for_context(), blender::nodes::node_geo_material_selection_cc::MaterialSelectionFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_mesh_edge_neighbors_cc::EdgeNeighborCountFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_mesh_island_cc::IslandFieldInput::get_varray_for_context(), blender::bke::mesh_normals_varray(), and blender::nodes::node_geo_distribute_points_on_faces_cc::propagate_existing_attributes().
|
finalvirtual |
Reimplemented from GeometryComponent.
Definition at line 1330 of file geometry_component_mesh.cc.
References get_for_write(), blender::bke::get_mesh_accessor_functions_ref(), and mesh.
Referenced by blender::nodes::node_geo_points_to_vertices_cc::geometry_set_points_to_vertices().
void MeshComponent::clear | ( | ) |
Definition at line 44 of file geometry_component_mesh.cc.
References BKE_id_free(), BLI_assert, GeometryComponent::is_mutable(), and Owned.
Referenced by replace(), and ~MeshComponent().
|
overridevirtual |
Implements GeometryComponent.
Definition at line 34 of file geometry_component_mesh.cc.
References BKE_mesh_copy_for_eval(), MeshComponent(), and Owned.
|
overridevirtual |
Implements GeometryComponent.
Definition at line 101 of file geometry_component_mesh.cc.
References BKE_mesh_copy_for_eval(), BLI_assert, GeometryComponent::is_mutable(), and Owned.
Referenced by modifier_modify_mesh_and_geometry_set().
const Mesh * MeshComponent::get_for_read | ( | ) | const |
Get the mesh from this component. This method can be used by multiple threads at the same time. Therefore, the returned mesh should not be modified. No ownership is transferred.
Definition at line 76 of file geometry_component_mesh.cc.
Referenced by blender::nodes::node_geo_dual_mesh_cc::calc_dual_mesh(), blender::nodes::node_geo_transfer_attribute_cc::NearestInterpolatedTransferFunction::call(), blender::nodes::node_geo_distribute_points_on_faces_cc::compute_attribute_outputs(), blender::nodes::node_geo_distribute_points_on_faces_cc::distribute_points_poisson_disk(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_edges(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_faces(), blender::geometry::gather_realize_tasks_recursive(), blender::nodes::node_geo_edge_paths_to_selection_cc::PathToEdgeSelectionFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_mesh_face_is_planar_cc::PlanarFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_shortest_edge_paths_cc::ShortestEdgePathsNextVertFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_shortest_edge_paths_cc::ShortestEdgePathsCostFieldInput::get_varray_for_context(), blender::nodes::node_geo_material_selection_cc::MaterialSelectionFieldInput::get_varray_for_context(), blender::bke::NormalFieldInput::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_edge_neighbors_cc::EdgeNeighborCountFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_mesh_island_cc::IslandFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_mesh_island_cc::IslandCountFieldInput::get_varray_for_context(), blender::nodes::node_geo_merge_by_distance_cc::mesh_merge_by_distance_all(), blender::nodes::node_geo_merge_by_distance_cc::mesh_merge_by_distance_connected(), modifier_modify_mesh_and_geometry_set(), blender::nodes::node_geo_edge_split_cc::node_geo_exec(), blender::nodes::node_geo_distribute_points_on_faces_cc::propagate_existing_attributes(), and blender::nodes::node_geo_delete_geometry_cc::separate_mesh_selection().
Mesh * MeshComponent::get_for_write | ( | ) |
Get the mesh from this component. This method can only be used when the component is mutable, i.e. it is not shared. The returned mesh can be modified. No ownership is transferred.
Definition at line 81 of file geometry_component_mesh.cc.
References BKE_mesh_copy_for_eval(), BLI_assert, GeometryComponent::is_mutable(), Owned, and ReadOnly.
Referenced by attributes_for_write(), blender::nodes::node_geo_set_material_cc::node_geo_exec(), blender::nodes::node_geo_scale_elements_cc::scale_edges_on_axis(), blender::nodes::node_geo_scale_elements_cc::scale_edges_uniformly(), blender::nodes::node_geo_scale_elements_cc::scale_faces_on_axis(), and blender::nodes::node_geo_scale_elements_cc::scale_faces_uniformly().
bool MeshComponent::has_mesh | ( | ) | const |
Definition at line 55 of file geometry_component_mesh.cc.
Referenced by blender::nodes::node_geo_transfer_attribute_cc::NearestInterpolatedTransferFunction::call().
|
finalvirtual |
Reimplemented from GeometryComponent.
Definition at line 91 of file geometry_component_mesh.cc.
|
overridevirtual |
Implements GeometryComponent.
Definition at line 96 of file geometry_component_mesh.cc.
References Owned.
Mesh * MeshComponent::release | ( | ) |
Return the mesh and clear the component. The caller takes over responsibility for freeing the mesh (if the component was responsible before).
Definition at line 68 of file geometry_component_mesh.cc.
References BLI_assert, GeometryComponent::is_mutable(), and mesh.
Referenced by modifier_modify_mesh_and_geometry_set().
void MeshComponent::replace | ( | Mesh * | mesh, |
GeometryOwnershipType | ownership = GeometryOwnershipType::Owned |
||
) |
Clear the component and replace it with the new mesh.
Definition at line 60 of file geometry_component_mesh.cc.
References BLI_assert, clear(), GeometryComponent::is_mutable(), and mesh.
Referenced by blender::geometry::execute_realize_mesh_tasks(), blender::nodes::node_geo_mesh_subdivide_cc::geometry_set_mesh_subdivide(), mesh_build_data(), modifier_modify_mesh_and_geometry_set(), and blender::ed::spreadsheet::spreadsheet_get_display_geometry_set().
|
inlinestaticconstexpr |
Definition at line 402 of file BKE_geometry_set.hh.