Blender  V2.93
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
blender::bke::WriteAttribute Class Referenceabstract

#include <BKE_attribute_access.hh>

Inherited by blender::bke::ArrayWriteAttribute< T >, blender::bke::DerivedArrayWriteAttribute< StructT, ElemT, GetFunc, SetFunc >, blender::bke::TemporaryWriteAttribute, and blender::bke::VertexWeightWriteAttribute.

Public Member Functions

 WriteAttribute (AttributeDomain domain, const CPPType &cpp_type, const int64_t size)
 
AttributeDomain domain () const
 
const CPPTypecpp_type () const
 
CustomDataType custom_data_type () const
 
int64_t size () const
 
void get (const int64_t index, void *r_value) const
 
void set (const int64_t index, const void *value)
 
template<typename T >
MutableSpan< Tget_span ()
 
template<typename T >
MutableSpan< Tget_span_for_write_only ()
 

Protected Member Functions

virtual void get_internal (const int64_t index, void *r_value) const =0
 
virtual void set_internal (const int64_t index, const void *value)=0
 

Protected Attributes

const AttributeDomain domain_
 
const CPPTypecpp_type_
 
const CustomDataType custom_data_type_
 
const int64_t size_
 
void * array_buffer_ = nullptr
 
bool array_is_temporary_ = false
 
bool array_should_be_applied_ = false
 

Attribute Accessor implementations

virtual ~WriteAttribute ()
 
fn::GMutableSpan get_span ()
 
fn::GMutableSpan get_span_for_write_only ()
 
void apply_span ()
 
virtual void initialize_span (const bool write_only)
 
virtual void apply_span_if_necessary ()
 

Detailed Description

This exists for similar reasons as the ReadAttribute class, except that it does not deal with interpolation between domains.

Definition at line 122 of file BKE_attribute_access.hh.

Constructor & Destructor Documentation

◆ WriteAttribute()

blender::bke::WriteAttribute::WriteAttribute ( AttributeDomain  domain,
const CPPType cpp_type,
const int64_t  size 
)
inline

Definition at line 137 of file BKE_attribute_access.hh.

◆ ~WriteAttribute()

blender::bke::WriteAttribute::~WriteAttribute ( )
virtual

Member Function Documentation

◆ apply_span()

void blender::bke::WriteAttribute::apply_span ( )

◆ apply_span_if_necessary()

void blender::bke::WriteAttribute::apply_span_if_necessary ( )
protectedvirtual

◆ cpp_type()

const CPPType& blender::bke::WriteAttribute::cpp_type ( ) const
inline

◆ custom_data_type()

CustomDataType blender::bke::WriteAttribute::custom_data_type ( ) const
inline

Definition at line 157 of file BKE_attribute_access.hh.

References custom_data_type_.

◆ domain()

AttributeDomain blender::bke::WriteAttribute::domain ( ) const
inline

Definition at line 147 of file BKE_attribute_access.hh.

References domain_.

◆ get()

void blender::bke::WriteAttribute::get ( const int64_t  index,
void *  r_value 
) const
inline

◆ get_internal()

virtual void blender::bke::WriteAttribute::get_internal ( const int64_t  index,
void *  r_value 
) const
protectedpure virtual

◆ get_span() [1/2]

fn::GMutableSpan blender::bke::WriteAttribute::get_span ( )

Get a mutable span that can be modified. When all modifications to the attribute are done, apply_span should be called.

Definition at line 103 of file attribute_access.cc.

References array_buffer_, array_should_be_applied_, cpp_type_, initialize_span(), and size_.

Referenced by blender::nodes::execute_on_component(), get_span(), blender::bke::TypedWriteAttribute< T >::get_span(), and blender::nodes::randomize_attribute_on_component().

◆ get_span() [2/2]

template<typename T >
MutableSpan<T> blender::bke::WriteAttribute::get_span ( )
inline

Definition at line 187 of file BKE_attribute_access.hh.

References get_span(), T, and blender::fn::GMutableSpan::typed().

◆ get_span_for_write_only() [1/2]

fn::GMutableSpan blender::bke::WriteAttribute::get_span_for_write_only ( )

◆ get_span_for_write_only() [2/2]

template<typename T >
MutableSpan<T> blender::bke::WriteAttribute::get_span_for_write_only ( )
inline

◆ initialize_span()

void blender::bke::WriteAttribute::initialize_span ( const bool  write_only)
protectedvirtual

◆ set()

void blender::bke::WriteAttribute::set ( const int64_t  index,
const void *  value 
)
inline

Definition at line 173 of file BKE_attribute_access.hh.

References BLI_assert, set_internal(), and size_.

Referenced by blender::bke::TypedWriteAttribute< T >::set().

◆ set_internal()

virtual void blender::bke::WriteAttribute::set_internal ( const int64_t  index,
const void *  value 
)
protectedpure virtual

◆ size()

int64_t blender::bke::WriteAttribute::size ( ) const
inline

Definition at line 162 of file BKE_attribute_access.hh.

References size_.

Referenced by blender::bke::TypedWriteAttribute< T >::size().

Member Data Documentation

◆ array_buffer_

void* blender::bke::WriteAttribute::array_buffer_ = nullptr
protected

◆ array_is_temporary_

bool blender::bke::WriteAttribute::array_is_temporary_ = false
protected

◆ array_should_be_applied_

bool blender::bke::WriteAttribute::array_should_be_applied_ = false
protected

◆ cpp_type_

const CPPType& blender::bke::WriteAttribute::cpp_type_
protected

◆ custom_data_type_

const CustomDataType blender::bke::WriteAttribute::custom_data_type_
protected

Definition at line 126 of file BKE_attribute_access.hh.

Referenced by custom_data_type().

◆ domain_

const AttributeDomain blender::bke::WriteAttribute::domain_
protected

Definition at line 124 of file BKE_attribute_access.hh.

Referenced by domain().

◆ size_

const int64_t blender::bke::WriteAttribute::size_
protected

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