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

#include <BKE_attribute_storage.hh>

Inherits blender::AttributeStorage.

Classes

struct  BlendWriteData
class  Iterator
class  MutableIterator

Public Member Functions

 AttributeStorage ()
 AttributeStorage (const AttributeStorage &other)
 AttributeStorage (AttributeStorage &&other)
AttributeStorage & operator= (const AttributeStorage &other)
AttributeStorage & operator= (AttributeStorage &&other)
 ~AttributeStorage ()
int count () const
Attribute & at_index (int index)
const Attribute & at_index (int index) const
int index_of (StringRef name) const
Attribute * lookup (StringRef name)
const Attribute * lookup (StringRef name) const
bool remove (StringRef name)
bool remove (const Set< StringRef > &names)
bool remove (const Set< const Attribute * > &attributes)
Attribute & add (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 rename (Attribute &attr, std::string new_name)
void rename (const Map< Attribute *, StringRef > &renames)
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
Iterator begin () const
Iterator end () const
MutableIterator begin ()
MutableIterator end ()

Additional Inherited Members

Public Attributes inherited from blender::AttributeStorage
struct Attribute * dna_attributes = nullptr
int dna_attributes_num = 0
char _pad [4] = {}
bke::AttributeStorageRuntime * runtime = nullptr

Detailed Description

Definition at line 140 of file BKE_attribute_storage.hh.

Constructor & Destructor Documentation

◆ AttributeStorage() [1/3]

◆ AttributeStorage() [2/3]

blender::bke::AttributeStorage::AttributeStorage ( const AttributeStorage & other)

◆ AttributeStorage() [3/3]

blender::bke::AttributeStorage::AttributeStorage ( AttributeStorage && other)

◆ ~AttributeStorage()

blender::bke::AttributeStorage::~AttributeStorage ( )

Member Function Documentation

◆ add()

Attribute & blender::bke::AttributeStorage::add ( std::string name,
bke::AttrDomain domain,
bke::AttrType data_type,
Attribute::DataVariant data )

Add an attribute with the given name, which must not already be used by an existing attribute or this will invoke undefined behavior.

Definition at line 238 of file attribute_storage.cc.

References attribute, blender::BLI_assert(), blender::data, blender::bke::Attribute::data_type(), blender::bke::Attribute::domain(), lookup(), blender::bke::Attribute::name(), and blender::AttributeStorage::runtime.

Referenced by blender::bke::CurvesGeometry::fill_curve_types(), and blender::ed::geometry::geometry_attribute_add_exec().

◆ at_index() [1/2]

Attribute & blender::bke::AttributeStorage::at_index ( int index)

Return the attribute at the given index.

Definition at line 204 of file attribute_storage.cc.

References blender::AttributeStorage::runtime.

◆ at_index() [2/2]

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

Definition at line 208 of file attribute_storage.cc.

References blender::AttributeStorage::runtime.

◆ begin() [1/2]

◆ begin() [2/2]

AttributeStorage::Iterator blender::bke::AttributeStorage::begin ( ) const
inline

◆ blend_read()

◆ blend_write()

◆ count()

int blender::bke::AttributeStorage::count ( ) const

Return the number of attributes.

Definition at line 199 of file attribute_storage.cc.

References blender::AttributeStorage::runtime.

◆ count_memory()

◆ end() [1/2]

◆ end() [2/2]

AttributeStorage::Iterator blender::bke::AttributeStorage::end ( ) const
inline

◆ foreach_working_space_color()

void blender::bke::AttributeStorage::foreach_working_space_color ( const IDTypeForeachColorFunctionCallback & fn)

Iterate over every color to change it to another color-space.

Definition at line 714 of file attribute_storage.cc.

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

Referenced by blender::pointcloud_foreach_working_space_color().

◆ index_of()

int blender::bke::AttributeStorage::index_of ( StringRef name) const

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

Definition at line 213 of file attribute_storage.cc.

References blender::bke::Attribute::name(), and blender::AttributeStorage::runtime.

Referenced by blender::BKE_attributes_active_set().

◆ lookup() [1/2]

Attribute * blender::bke::AttributeStorage::lookup ( StringRef name)

Try to find the attribute with a given name. The non-const overload does not make the attribute data itself mutable.

Definition at line 228 of file attribute_storage.cc.

References attribute, blender::bke::Attribute::name(), and blender::AttributeStorage::runtime.

Referenced by add(), blender::BKE_attribute_rename(), blender::bke::CurvesGeometry::fill_curve_types(), blender::bke::LegacyMeshInterpolator::LegacyMeshInterpolator(), rename(), and unique_name_calc().

◆ lookup() [2/2]

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

◆ operator=() [1/2]

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

Definition at line 184 of file attribute_storage.cc.

References AttributeStorage().

◆ operator=() [2/2]

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

Definition at line 167 of file attribute_storage.cc.

References AttributeStorage().

◆ remove() [1/3]

◆ remove() [2/3]

bool blender::bke::AttributeStorage::remove ( const Set< StringRef > & names)

◆ remove() [3/3]

bool blender::bke::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 255 of file attribute_storage.cc.

References attribute, blender::bke::Attribute::name(), blender::Vector< T, InlineBufferCapacity, Allocator >::remove(), blender::AttributeStorage::runtime, and blender::Vector< T, InlineBufferCapacity, Allocator >::size().

Referenced by blender::bke::CurvesGeometry::blend_read().

◆ rename() [1/3]

void blender::bke::AttributeStorage::rename ( Attribute & attr,
std::string new_name )

◆ rename() [2/3]

◆ rename() [3/3]

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

Change the name of a single existing attribute.

Definition at line 317 of file attribute_storage.cc.

References blender::BLI_assert(), lookup(), and rename().

Referenced by blender::BKE_attribute_rename(), and rename().

◆ resize()

◆ unique_name_calc()

std::string blender::bke::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 292 of file attribute_storage.cc.

References blender::BLI_uniquename_cb(), DATA_, blender::blender::StringRefBase::is_empty(), lookup(), and blender::bke::Attribute::name().


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