Blender V4.3
blender::bke::PointCloudComponent Class Reference

#include <BKE_geometry_set.hh>

Inherits blender::bke::GeometryComponent.

Public Member Functions

std::optional< AttributeAccessorattributes () const final
 
std::optional< MutableAttributeAccessorattributes_for_write () final
 
Geometry Component Implementation
 PointCloudComponent ()
 
 PointCloudComponent (PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
 
 ~PointCloudComponent ()
 
GeometryComponentPtr copy () const override
 
void clear () override
 
bool has_pointcloud () const
 
void replace (PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
 
PointCloudrelease ()
 
const PointCloudget () const
 
PointCloudget_for_write ()
 
bool is_empty () const final
 
bool owns_direct_data () const override
 
void ensure_owns_direct_data () override
 
void count_memory (MemoryCounter &memory) const override
 
- Public Member Functions inherited from blender::bke::GeometryComponent
virtual ~GeometryComponent ()=default
 
 GeometryComponent (Type type)
 
int attribute_domain_size (AttrDomain domain) const
 
Type type () const
 
- Public Member Functions inherited from blender::ImplicitSharingInfo
virtual ~ImplicitSharingInfo ()
 
bool is_mutable () const
 
bool is_expired () const
 
void add_user () const
 
void add_weak_user () const
 
void tag_ensured_mutable () const
 
int64_t version () const
 
int strong_users () const
 
void remove_user_and_delete_if_last () const
 
void remove_weak_user_and_delete_if_last () const
 

Static Public Attributes

static constexpr GeometryComponent::Type static_type = Type::PointCloud
 

Additional Inherited Members

- Public Types inherited from blender::bke::GeometryComponent
enum class  Type {
  Mesh = 0 , PointCloud = 1 , Instance = 2 , Volume = 3 ,
  Curve = 4 , Edit = 5 , GreasePencil = 6
}
 
- Static Public Member Functions inherited from blender::bke::GeometryComponent
static GeometryComponentPtr create (Type component_type)
 

Detailed Description

A geometry component that stores a point cloud, corresponding to the PointCloud data structure. While a point cloud is technically a subset of a mesh in some respects, it is useful because of its simplicity, partly on a conceptual level for the user, but also in the code, though partly for historical reasons. Point clouds can also be rendered in special ways, based on the built-in radius attribute.

Attributes on point clouds are all stored in contiguous arrays in its CustomData, which makes them efficient to process, relative to some legacy built-in mesh attributes.

Definition at line 531 of file BKE_geometry_set.hh.

Constructor & Destructor Documentation

◆ PointCloudComponent() [1/2]

blender::bke::PointCloudComponent::PointCloudComponent ( )

Definition at line 19 of file geometry_component_pointcloud.cc.

Referenced by copy().

◆ PointCloudComponent() [2/2]

blender::bke::PointCloudComponent::PointCloudComponent ( PointCloud * pointcloud,
GeometryOwnershipType ownership = GeometryOwnershipType::Owned )

Definition at line 21 of file geometry_component_pointcloud.cc.

◆ ~PointCloudComponent()

blender::bke::PointCloudComponent::~PointCloudComponent ( )

Definition at line 26 of file geometry_component_pointcloud.cc.

References clear().

Member Function Documentation

◆ attributes()

std::optional< AttributeAccessor > blender::bke::PointCloudComponent::attributes ( ) const
finalvirtual

Get access to the attributes in this geometry component. May return none if the geometry does not support the attribute system.

Reimplemented from blender::bke::GeometryComponent.

Definition at line 231 of file geometry_component_pointcloud.cc.

References blender::bke::get_pointcloud_accessor_functions_ref().

◆ attributes_for_write()

std::optional< MutableAttributeAccessor > blender::bke::PointCloudComponent::attributes_for_write ( )
finalvirtual

◆ clear()

void blender::bke::PointCloudComponent::clear ( )
overridevirtual

◆ copy()

GeometryComponentPtr blender::bke::PointCloudComponent::copy ( ) const
overridevirtual

Copies the component. The returned component only has a single user and is therefor mutable.

Implements blender::bke::GeometryComponent.

Definition at line 31 of file geometry_component_pointcloud.cc.

References BKE_pointcloud_copy_for_eval(), blender::bke::Owned, and PointCloudComponent().

◆ count_memory()

void blender::bke::PointCloudComponent::count_memory ( MemoryCounter & memory) const
overridevirtual

Reimplemented from blender::bke::GeometryComponent.

Definition at line 109 of file geometry_component_pointcloud.cc.

◆ ensure_owns_direct_data()

void blender::bke::PointCloudComponent::ensure_owns_direct_data ( )
overridevirtual

◆ get()

const PointCloud * blender::bke::PointCloudComponent::get ( ) const

Get the point cloud from this component. This method can be used by multiple threads at the same time. Therefore, the returned point cloud should not be modified. No ownership is transferred.

Definition at line 73 of file geometry_component_pointcloud.cc.

Referenced by blender::nodes::node_geo_sample_nearest_cc::SampleNearestFunction::call(), blender::bke::GeometryFieldContext::GeometryFieldContext(), blender::bke::GeometrySet::get_pointcloud(), and blender::nodes::node_geo_split_to_instances_cc::split_pointcloud_groups().

◆ get_for_write()

PointCloud * blender::bke::PointCloudComponent::get_for_write ( )

Get the point cloud from this component. This method can only be used when the component is mutable, i.e. it is not shared. The returned point cloud can be modified. No ownership is transferred.

Definition at line 78 of file geometry_component_pointcloud.cc.

References BKE_pointcloud_copy_for_eval(), BLI_assert, blender::ImplicitSharingInfo::is_mutable(), blender::bke::Owned, and blender::bke::ReadOnly.

Referenced by blender::bke::GeometrySet::get_pointcloud_for_write().

◆ has_pointcloud()

bool blender::bke::PointCloudComponent::has_pointcloud ( ) const

◆ is_empty()

bool blender::bke::PointCloudComponent::is_empty ( ) const
finalvirtual

Reimplemented from blender::bke::GeometryComponent.

Definition at line 88 of file geometry_component_pointcloud.cc.

◆ owns_direct_data()

bool blender::bke::PointCloudComponent::owns_direct_data ( ) const
overridevirtual

Implements blender::bke::GeometryComponent.

Definition at line 93 of file geometry_component_pointcloud.cc.

References blender::bke::Owned.

◆ release()

PointCloud * blender::bke::PointCloudComponent::release ( )

Return the point cloud and clear the component. The caller takes over responsibility for freeing the point cloud (if the component was responsible before).

Definition at line 65 of file geometry_component_pointcloud.cc.

References BLI_assert, and blender::ImplicitSharingInfo::is_mutable().

Referenced by take_pointcloud_ownership_from_geometry_set().

◆ replace()

void blender::bke::PointCloudComponent::replace ( PointCloud * pointcloud,
GeometryOwnershipType ownership = GeometryOwnershipType::Owned )

Clear the component and replace it with the new point cloud.

Definition at line 57 of file geometry_component_pointcloud.cc.

References BLI_assert, clear(), and blender::ImplicitSharingInfo::is_mutable().

Referenced by blender::bke::GeometrySet::replace_pointcloud(), and take_pointcloud_ownership_from_geometry_set().

Member Data Documentation

◆ static_type

GeometryComponent::Type blender::bke::PointCloudComponent::static_type = Type::PointCloud
inlinestaticconstexpr

Definition at line 579 of file BKE_geometry_set.hh.


The documentation for this class was generated from the following files: