Blender  V2.93
Public Member Functions | List of all members
GeometryComponent Class Referenceabstract

#include <BKE_geometry_set.hh>

Inherited by InstancesComponent, MeshComponent, PointCloudComponent, and VolumeComponent.

Public Member Functions

virtual ~GeometryComponent ()=default
 
virtual GeometryComponentcopy () const =0
 
virtual bool owns_direct_data () const =0
 
virtual void ensure_owns_direct_data ()=0
 
template<typename T >
blender::bke::TypedReadAttribute< Tattribute_get_for_read (const blender::StringRef attribute_name, const AttributeDomain domain, const T &default_value) const
 
template<typename T >
blender::bke::TypedReadAttribute< Tattribute_get_constant_for_read (const AttributeDomain domain, const T &value) const
 

Geometry Component

 GeometryComponent (GeometryComponentType type)
 
void user_add () const
 
void user_remove () const
 
bool is_mutable () const
 
GeometryComponentType type () const
 
virtual bool is_empty () const
 
static GeometryComponentcreate (GeometryComponentType component_type)
 

Geometry Component

bool attribute_exists (const blender::StringRef attribute_name) const
 
bool attribute_domain_supported (const AttributeDomain domain) const
 
virtual int attribute_domain_size (const AttributeDomain domain) const
 
blender::bke::ReadAttributePtr attribute_try_get_for_read (const blender::StringRef attribute_name) const
 
blender::bke::WriteAttributePtr attribute_try_get_for_write (const blender::StringRef attribute_name)
 
virtual blender::bke::ReadAttributePtr attribute_try_adapt_domain (blender::bke::ReadAttributePtr attribute, const AttributeDomain new_domain) const
 
bool attribute_try_delete (const blender::StringRef attribute_name)
 
bool attribute_try_create (const blender::StringRef attribute_name, const AttributeDomain domain, const CustomDataType data_type)
 
blender::Set< std::string > attribute_names () const
 
bool attribute_foreach (const AttributeForeachCallback callback) const
 
blender::bke::ReadAttributePtr attribute_try_get_for_read (const blender::StringRef attribute_name, const AttributeDomain domain, const CustomDataType data_type) const
 
blender::bke::ReadAttributePtr attribute_try_get_for_read (const blender::StringRef attribute_name, const AttributeDomain domain) const
 
blender::bke::ReadAttributePtr attribute_get_for_read (const blender::StringRef attribute_name, const AttributeDomain domain, const CustomDataType data_type, const void *default_value) const
 
blender::bke::ReadAttributePtr attribute_get_constant_for_read (const AttributeDomain domain, const CustomDataType data_type, const void *value) const
 
blender::bke::ReadAttributePtr attribute_get_constant_for_read_converted (const AttributeDomain domain, const CustomDataType in_data_type, const CustomDataType out_data_type, const void *value) const
 
OutputAttributePtr attribute_try_get_for_output (const blender::StringRef attribute_name, const AttributeDomain domain, const CustomDataType data_type, const void *default_value=nullptr)
 

Detailed Description

This is the base class for specialized geometry component types.

Definition at line 129 of file BKE_geometry_set.hh.

Constructor & Destructor Documentation

◆ GeometryComponent()

GeometryComponent::GeometryComponent ( GeometryComponentType  type)

Definition at line 48 of file geometry_set.cc.

◆ ~GeometryComponent()

virtual GeometryComponent::~GeometryComponent ( )
virtualdefault

Member Function Documentation

◆ attribute_domain_size()

int GeometryComponent::attribute_domain_size ( const AttributeDomain  domain) const
virtual

◆ attribute_domain_supported()

bool GeometryComponent::attribute_domain_supported ( const AttributeDomain  domain) const

◆ attribute_exists()

bool GeometryComponent::attribute_exists ( const blender::StringRef  attribute_name) const

Definition at line 868 of file attribute_access.cc.

◆ attribute_foreach()

bool GeometryComponent::attribute_foreach ( const AttributeForeachCallback  callback) const

◆ attribute_get_constant_for_read() [1/2]

blender::bke::ReadAttributePtr GeometryComponent::attribute_get_constant_for_read ( const AttributeDomain  domain,
const CustomDataType  data_type,
const void *  value 
) const

◆ attribute_get_constant_for_read() [2/2]

template<typename T >
blender::bke::TypedReadAttribute<T> GeometryComponent::attribute_get_constant_for_read ( const AttributeDomain  domain,
const T value 
) const
inline

◆ attribute_get_constant_for_read_converted()

blender::bke::ReadAttributePtr GeometryComponent::attribute_get_constant_for_read_converted ( const AttributeDomain  domain,
const CustomDataType  in_data_type,
const CustomDataType  out_data_type,
const void *  value 
) const

◆ attribute_get_for_read() [1/2]

ReadAttributePtr GeometryComponent::attribute_get_for_read ( const blender::StringRef  attribute_name,
const AttributeDomain  domain,
const CustomDataType  data_type,
const void *  default_value 
) const

◆ attribute_get_for_read() [2/2]

template<typename T >
blender::bke::TypedReadAttribute<T> GeometryComponent::attribute_get_for_read ( const blender::StringRef  attribute_name,
const AttributeDomain  domain,
const T default_value 
) const
inline

◆ attribute_names()

Set< std::string > GeometryComponent::attribute_names ( ) const

◆ attribute_try_adapt_domain()

ReadAttributePtr GeometryComponent::attribute_try_adapt_domain ( blender::bke::ReadAttributePtr  attribute,
const AttributeDomain  new_domain 
) const
virtual

Reimplemented in MeshComponent.

Definition at line 734 of file attribute_access.cc.

◆ attribute_try_create()

bool GeometryComponent::attribute_try_create ( const blender::StringRef  attribute_name,
const AttributeDomain  domain,
const CustomDataType  data_type 
)

◆ attribute_try_delete()

bool GeometryComponent::attribute_try_delete ( const blender::StringRef  attribute_name)

◆ attribute_try_get_for_output()

OutputAttributePtr GeometryComponent::attribute_try_get_for_output ( const blender::StringRef  attribute_name,
const AttributeDomain  domain,
const CustomDataType  data_type,
const void *  default_value = nullptr 
)

If an attribute with the given params exist, it is returned. If no attribute with the given name exists, create it and fill it with the default value if it is provided. If an attribute with the given name but different domain or type exists, a temporary attribute is created that has to be saved after the output has been computed. This avoids deleting another attribute, before a computation is finished.

This might return no attribute when the attribute cannot exist on the component.

Definition at line 1004 of file attribute_access.cc.

References BLI_assert, blender::bke::custom_data_type_to_cpp_type(), data, and blender::fn::CPPType::fill_initialized().

Referenced by blender::nodes::calculate_sphere_uvs(), blender::nodes::calculate_uvs(), and blender::nodes::copy_attributes_based_on_mask().

◆ attribute_try_get_for_read() [1/3]

ReadAttributePtr GeometryComponent::attribute_try_get_for_read ( const blender::StringRef  attribute_name) const

◆ attribute_try_get_for_read() [2/3]

ReadAttributePtr GeometryComponent::attribute_try_get_for_read ( const blender::StringRef  attribute_name,
const AttributeDomain  domain 
) const

Definition at line 923 of file attribute_access.cc.

◆ attribute_try_get_for_read() [3/3]

ReadAttributePtr GeometryComponent::attribute_try_get_for_read ( const blender::StringRef  attribute_name,
const AttributeDomain  domain,
const CustomDataType  data_type 
) const

◆ attribute_try_get_for_write()

WriteAttributePtr GeometryComponent::attribute_try_get_for_write ( const blender::StringRef  attribute_name)

◆ copy()

virtual GeometryComponent* GeometryComponent::copy ( ) const
pure virtual

◆ create()

GeometryComponent * GeometryComponent::create ( GeometryComponentType  component_type)
static

◆ ensure_owns_direct_data()

virtual void GeometryComponent::ensure_owns_direct_data ( )
pure virtual

◆ is_empty()

bool GeometryComponent::is_empty ( ) const
virtual

Reimplemented in InstancesComponent, PointCloudComponent, and MeshComponent.

Definition at line 93 of file geometry_set.cc.

◆ is_mutable()

bool GeometryComponent::is_mutable ( ) const

◆ owns_direct_data()

virtual bool GeometryComponent::owns_direct_data ( ) const
pure virtual

◆ type()

GeometryComponentType GeometryComponent::type ( ) const

◆ user_add()

void GeometryComponent::user_add ( ) const

Definition at line 68 of file geometry_set.cc.

◆ user_remove()

void GeometryComponent::user_remove ( ) const

Definition at line 73 of file geometry_set.cc.


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