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

#include <BKE_geometry_set.hh>

Inherits blender::bke::GeometryComponent.

Public Member Functions

Geometry Component Implementation
 VolumeComponent ()
 
 ~VolumeComponent ()
 
GeometryComponentPtr copy () const override
 
void clear () override
 
bool has_volume () const
 
void replace (Volume *volume, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
 
Volumerelease ()
 
const Volumeget () const
 
Volumeget_for_write ()
 
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
 
virtual std::optional< AttributeAccessorattributes () const
 
virtual std::optional< MutableAttributeAccessorattributes_for_write ()
 
Type type () const
 
virtual bool is_empty () 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::Volume
 

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 volume grids, corresponding to the Volume data structure. This component does not implement an attribute API, partly because storage of sparse volume information in grids is much more complicated than it is for other types

Definition at line 679 of file BKE_geometry_set.hh.

Constructor & Destructor Documentation

◆ VolumeComponent()

blender::bke::VolumeComponent::VolumeComponent ( )

Definition at line 15 of file geometry_component_volume.cc.

Referenced by copy().

◆ ~VolumeComponent()

blender::bke::VolumeComponent::~VolumeComponent ( )

Definition at line 17 of file geometry_component_volume.cc.

References clear().

Member Function Documentation

◆ clear()

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

Remove referenced data from the geometry component.

Implements blender::bke::GeometryComponent.

Definition at line 32 of file geometry_component_volume.cc.

References BKE_id_free(), BLI_assert, blender::ImplicitSharingInfo::is_expired(), blender::ImplicitSharingInfo::is_mutable(), and blender::bke::Owned.

Referenced by replace(), and ~VolumeComponent().

◆ copy()

GeometryComponentPtr blender::bke::VolumeComponent::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 22 of file geometry_component_volume.cc.

References BKE_volume_copy_for_eval(), blender::bke::Owned, and VolumeComponent().

◆ count_memory()

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

Reimplemented from blender::bke::GeometryComponent.

Definition at line 95 of file geometry_component_volume.cc.

References BKE_volume_count_memory().

◆ ensure_owns_direct_data()

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

◆ get()

const Volume * blender::bke::VolumeComponent::get ( ) const

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

Definition at line 64 of file geometry_component_volume.cc.

Referenced by blender::bke::GeometrySet::get_volume(), and blender::nodes::node_geo_distribute_points_in_volume_cc::node_geo_exec().

◆ get_for_write()

Volume * blender::bke::VolumeComponent::get_for_write ( )

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

Definition at line 69 of file geometry_component_volume.cc.

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

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

◆ has_volume()

bool blender::bke::VolumeComponent::has_volume ( ) const

Definition at line 43 of file geometry_component_volume.cc.

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

◆ owns_direct_data()

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

Implements blender::bke::GeometryComponent.

Definition at line 79 of file geometry_component_volume.cc.

References blender::bke::Owned.

◆ release()

Volume * blender::bke::VolumeComponent::release ( )

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

Definition at line 56 of file geometry_component_volume.cc.

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

◆ replace()

void blender::bke::VolumeComponent::replace ( Volume * volume,
GeometryOwnershipType ownership = GeometryOwnershipType::Owned )

Clear the component and replace it with the new volume.

Definition at line 48 of file geometry_component_volume.cc.

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

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

Member Data Documentation

◆ static_type

GeometryComponent::Type blender::bke::VolumeComponent::static_type = Type::Volume
inlinestaticconstexpr

Definition at line 718 of file BKE_geometry_set.hh.


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