Blender V5.0
Attribute Class Reference

#include <DNA_attribute_types.h>

Public Member Functions

 Attribute (ustring name, const TypeDesc type, AttributeElement element, Geometry *geom, AttributePrimitive prim)
 Attribute (Attribute &&other)=default
 Attribute (const Attribute &other)=delete
Attributeoperator= (const Attribute &other)=delete
 ~Attribute ()
void set (ustring name, const TypeDesc type, AttributeElement element)
void resize (Geometry *geom, AttributePrimitive prim, bool reserve_only)
void resize (const size_t num_elements)
size_t data_sizeof () const
size_t element_size (Geometry *geom, AttributePrimitive prim) const
size_t buffer_size (Geometry *geom, AttributePrimitive prim) const
char * data ()
float2data_float2 ()
float3data_float3 ()
float4data_float4 ()
floatdata_float ()
uchar4data_uchar4 ()
Transformdata_transform ()
ImageHandledata_voxel ()
const char * data () const
const float2data_float2 () const
const float3data_float3 () const
const float4data_float4 () const
const floatdata_float () const
const Transformdata_transform () const
const ImageHandledata_voxel () const
void zero_data (void *dst)
void add (const float &f)
void add (const float2 &f)
void add (const float3 &f)
void add (const uchar4 &f)
void add (const Transform &f)
void add (const char *data)
void set_data_from (Attribute &&other)
void get_uv_tiles (Geometry *geom, AttributePrimitive prim, unordered_set< int > &tiles) const

Static Public Member Functions

static bool same_storage (const TypeDesc a, const TypeDesc b)
static const char * standard_name (AttributeStandard std)
static AttributeStandard name_standard (const char *name)
static AttrKernelDataType kernel_type (const Attribute &attr)

Public Attributes

const char * name
int16_t data_type
int8_t domain
int8_t storage_type
char _pad [4]
void * data
ustring name
AttributeStandard std
TypeDesc type
vector< char > buffer
AttributeElement element
uint flags
bool modified

Detailed Description

DNA data for bke::Attribute.

Definition at line 38 of file DNA_attribute_types.h.

Constructor & Destructor Documentation

◆ Attribute() [1/3]

CCL_NAMESPACE_BEGIN Attribute::Attribute ( ustring name,
const TypeDesc type,
AttributeElement element,
Geometry * geom,
AttributePrimitive prim )

◆ Attribute() [2/3]

Attribute::Attribute ( Attribute && other)
default

References Attribute().

◆ Attribute() [3/3]

Attribute::Attribute ( const Attribute & other)
delete

References Attribute().

◆ ~Attribute()

Attribute::~Attribute ( )

Member Function Documentation

◆ add() [1/6]

void Attribute::add ( const char * data)

Definition at line 137 of file scene/attribute.cpp.

References buffer, data, data_sizeof(), i, modified, and size().

◆ add() [2/6]

void Attribute::add ( const float & f)

Definition at line 67 of file scene/attribute.cpp.

References assert, buffer, data, data_sizeof(), i, modified, and size().

Referenced by ExportCurveSegments().

◆ add() [3/6]

void Attribute::add ( const float2 & f)

Definition at line 95 of file scene/attribute.cpp.

References assert, buffer, data, data_sizeof(), i, modified, and size().

◆ add() [4/6]

void Attribute::add ( const float3 & f)

Definition at line 109 of file scene/attribute.cpp.

References assert, buffer, data, data_sizeof(), i, modified, and size().

◆ add() [5/6]

void Attribute::add ( const Transform & f)

Definition at line 123 of file scene/attribute.cpp.

References assert, buffer, data, data_sizeof(), i, modified, and size().

◆ add() [6/6]

void Attribute::add ( const uchar4 & f)

Definition at line 81 of file scene/attribute.cpp.

References assert, buffer, data, data_sizeof(), i, modified, and size().

◆ buffer_size()

size_t Attribute::buffer_size ( Geometry * geom,
AttributePrimitive prim ) const

Definition at line 284 of file scene/attribute.cpp.

References data_sizeof(), and element_size().

Referenced by Mesh::add_undisplaced(), and resize().

◆ data() [1/2]

char * Attribute::data ( )
inline

Definition at line 74 of file scene/attribute.h.

References buffer.

◆ data() [2/2]

const char * Attribute::data ( ) const
inline

Definition at line 116 of file scene/attribute.h.

References buffer.

◆ data_float() [1/2]

◆ data_float() [2/2]

const float * Attribute::data_float ( ) const
inline

Definition at line 135 of file scene/attribute.h.

References assert, data, and data_sizeof().

◆ data_float2() [1/2]

◆ data_float2() [2/2]

const float2 * Attribute::data_float2 ( ) const
inline

Definition at line 120 of file scene/attribute.h.

References assert, data, and data_sizeof().

◆ data_float3() [1/2]

◆ data_float3() [2/2]

const float3 * Attribute::data_float3 ( ) const
inline

Definition at line 125 of file scene/attribute.h.

References assert, data, and data_sizeof().

◆ data_float4() [1/2]

◆ data_float4() [2/2]

const float4 * Attribute::data_float4 ( ) const
inline

Definition at line 130 of file scene/attribute.h.

References assert, data, and data_sizeof().

◆ data_sizeof()

◆ data_transform() [1/2]

Transform * Attribute::data_transform ( )
inline

Definition at line 103 of file scene/attribute.h.

References assert, data, and data_sizeof().

Referenced by AttributeTableBuilder::add(), and create_mesh().

◆ data_transform() [2/2]

const Transform * Attribute::data_transform ( ) const
inline

Definition at line 140 of file scene/attribute.h.

References assert, data, and data_sizeof().

◆ data_uchar4()

uchar4 * Attribute::data_uchar4 ( )
inline

Definition at line 98 of file scene/attribute.h.

References assert, data, and data_sizeof().

Referenced by AttributeTableBuilder::add(), and attr_create_generic().

◆ data_voxel() [1/2]

◆ data_voxel() [2/2]

const ImageHandle & Attribute::data_voxel ( ) const
inline

Definition at line 145 of file scene/attribute.h.

References assert, data, and data_sizeof().

◆ element_size()

◆ get_uv_tiles()

void Attribute::get_uv_tiles ( Geometry * geom,
AttributePrimitive prim,
unordered_set< int > & tiles ) const

◆ kernel_type()

AttrKernelDataType Attribute::kernel_type ( const Attribute & attr)
static

◆ name_standard()

AttributeStandard Attribute::name_standard ( const char * name)
static

◆ operator=()

Attribute & Attribute::operator= ( const Attribute & other)
delete

References Attribute().

◆ resize() [1/2]

void Attribute::resize ( const size_t num_elements)

Definition at line 60 of file scene/attribute.cpp.

References ATTR_ELEMENT_VOXEL, buffer, data_sizeof(), and element.

◆ resize() [2/2]

void Attribute::resize ( Geometry * geom,
AttributePrimitive prim,
bool reserve_only )

Definition at line 48 of file scene/attribute.cpp.

References ATTR_ELEMENT_VOXEL, buffer, buffer_size(), and element.

Referenced by Attribute().

◆ same_storage()

bool Attribute::same_storage ( const TypeDesc a,
const TypeDesc b )
static

Definition at line 289 of file scene/attribute.cpp.

References b.

Referenced by SubdAttributeInterpolation::setup_attribute().

◆ set()

void Attribute::set ( ustring name,
const TypeDesc type,
AttributeElement element )

References element, name, and type.

◆ set_data_from()

void Attribute::set_data_from ( Attribute && other)

Definition at line 148 of file scene/attribute.cpp.

References assert, Attribute(), buffer, data, element, flags, modified, std, and type.

Referenced by AttributeSet::update().

◆ standard_name()

◆ zero_data()

void Attribute::zero_data ( void * dst)

Definition at line 303 of file scene/attribute.cpp.

References data_sizeof().

Member Data Documentation

◆ _pad

char Attribute::_pad[4]

Definition at line 46 of file DNA_attribute_types.h.

◆ buffer

◆ data

◆ data_type

◆ domain

◆ element

◆ flags

uint Attribute::flags

Definition at line 52 of file scene/attribute.h.

Referenced by attr_create_subd_uv_map(), Attribute(), and set_data_from().

◆ modified

◆ name [1/2]

ustring Attribute::name

Definition at line 46 of file scene/attribute.h.

◆ name [2/2]

◆ std

◆ storage_type

◆ type


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