Blender V5.0
blender::bke::AttributeStorage Class Reference

#include <BKE_attribute_storage.hh>

Inherits AttributeStorage.

Classes

struct  BlendWriteData

Public Member Functions

 AttributeStorage ()
 AttributeStorage (const AttributeStorage &other)
 AttributeStorage (AttributeStorage &&other)
AttributeStorageoperator= (const AttributeStorage &other)
AttributeStorageoperator= (AttributeStorage &&other)
 ~AttributeStorage ()
void foreach (FunctionRef< void(Attribute &)> fn)
void foreach (FunctionRef< void(const Attribute &)> fn) const
void foreach_with_stop (FunctionRef< bool(Attribute &)> fn)
void foreach_with_stop (FunctionRef< bool(const Attribute &)> fn) const
int count () const
Attributeat_index (int index)
const Attributeat_index (int index) const
int index_of (StringRef name) const
Attributelookup (StringRef name)
const Attributelookup (StringRef name) const
bool remove (StringRef name)
Attributeadd (std::string name, bke::AttrDomain domain, bke::AttrType data_type, Attribute::DataVariant data)
std::string unique_name_calc (StringRef name) const
void rename (StringRef old_name, std::string new_name)
void resize (AttrDomain domain, int64_t new_size)
void blend_read (BlendDataReader &reader)
void blend_write (BlendWriter &writer, const BlendWriteData &write_data)
void foreach_working_space_color (const IDTypeForeachColorFunctionCallback &fn)
void count_memory (MemoryCounter &memory) const

Additional Inherited Members

Public Attributes inherited from AttributeStorage
struct Attributedna_attributes
int dna_attributes_num
char _pad [4]
AttributeStorageRuntimeHandleruntime

Detailed Description

Definition at line 131 of file BKE_attribute_storage.hh.

Constructor & Destructor Documentation

◆ AttributeStorage() [1/3]

◆ AttributeStorage() [2/3]

AttributeStorage::AttributeStorage ( const AttributeStorage & other)

◆ AttributeStorage() [3/3]

AttributeStorage::AttributeStorage ( AttributeStorage && other)

◆ ~AttributeStorage()

AttributeStorage::~AttributeStorage ( )

Definition at line 241 of file attribute_storage.cc.

References AttributeStorage::runtime.

Member Function Documentation

◆ add()

◆ at_index() [1/2]

Attribute & AttributeStorage::at_index ( int index)

Return the attribute at the given index.

Definition at line 251 of file attribute_storage.cc.

References AttributeStorage::runtime.

Referenced by BKE_attributes_active_name_get().

◆ at_index() [2/2]

const Attribute & AttributeStorage::at_index ( int index) const

Definition at line 255 of file attribute_storage.cc.

References AttributeStorage::runtime.

◆ blend_read()

◆ blend_write()

◆ count()

int AttributeStorage::count ( ) const

Return the number of attributes.

Definition at line 246 of file attribute_storage.cc.

References AttributeStorage::runtime.

Referenced by BKE_attributes_active_name_get().

◆ count_memory()

void AttributeStorage::count_memory ( MemoryCounter & memory) const

◆ foreach() [1/2]

void AttributeStorage::foreach ( FunctionRef< void(Attribute &)> fn)

Iterate over all attributes, with the order defined by the order of insertion. It is not safe to add or remove attributes while iterating.

Definition at line 126 of file attribute_storage.cc.

References AttributeStorage::runtime.

Referenced by AttributeStorage(), blender::bke::convert_storage_to_customdata(), blender::geometry::reorder_attribute_groups(), shrink_attribute_storage(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), and blender::bke::tests::TEST().

◆ foreach() [2/2]

void AttributeStorage::foreach ( FunctionRef< void(const Attribute &)> fn) const

Definition at line 132 of file attribute_storage.cc.

References AttributeStorage::runtime.

◆ foreach_with_stop() [1/2]

◆ foreach_with_stop() [2/2]

void AttributeStorage::foreach_with_stop ( FunctionRef< bool(const Attribute &)> fn) const

Definition at line 147 of file attribute_storage.cc.

References AttributeStorage::runtime.

◆ foreach_working_space_color()

void AttributeStorage::foreach_working_space_color ( const IDTypeForeachColorFunctionCallback & fn)

Iterate over every color to change it to another colorspace.

Definition at line 659 of file attribute_storage.cc.

References blender::bke::ColorFloat, data, and AttributeStorage::runtime.

◆ index_of()

int AttributeStorage::index_of ( StringRef name) const

Return the index of the attribute with the given name, or -1 if not found.

Definition at line 260 of file attribute_storage.cc.

References name, and AttributeStorage::runtime.

Referenced by BKE_attributes_active_set().

◆ lookup() [1/2]

◆ lookup() [2/2]

const Attribute * AttributeStorage::lookup ( StringRef name) const

Definition at line 265 of file attribute_storage.cc.

References name, and AttributeStorage::runtime.

◆ operator=() [1/2]

AttributeStorage & AttributeStorage::operator= ( AttributeStorage && other)

◆ operator=() [2/2]

AttributeStorage & AttributeStorage::operator= ( const AttributeStorage & other)

◆ remove()

bool AttributeStorage::remove ( StringRef name)

Attempt to remove the attribute with the given name, returning true if successful. Should not be called while iterating over attributes.

Definition at line 301 of file attribute_storage.cc.

References name, and AttributeStorage::runtime.

Referenced by blender::bke::curves::get_curves_accessor_functions(), blender::bke::greasepencil::get_grease_pencil_accessor_functions(), blender::bke::get_instances_accessor_functions(), blender::bke::get_mutable_attribute(), and blender::bke::get_pointcloud_accessor_functions().

◆ rename()

void AttributeStorage::rename ( StringRef old_name,
std::string new_name )

Change the name of a single existing attribute.

Definition at line 312 of file attribute_storage.cc.

References AttributeStorage::runtime, and blender::Vector< T, InlineBufferCapacity, Allocator >::size().

Referenced by BKE_attribute_rename().

◆ resize()

◆ unique_name_calc()

std::string AttributeStorage::unique_name_calc ( StringRef name) const

Return a possibly changed version of the input name that is unique within existing names.

Definition at line 306 of file attribute_storage.cc.

References BLI_uniquename_cb(), lookup(), and name.

Referenced by blender::bke::attribute_legacy_convert_customdata_to_storage(), BKE_attribute_calc_unique_name(), blender::ed::geometry::geometry_attribute_add_exec(), and blender::bke::tests::TEST().


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