Blender V4.3
Attribute Class Reference

#include <attribute.h>

Public Member Functions

 Attribute (ustring name, 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, TypeDesc type, AttributeElement element)
 
void resize (Geometry *geom, AttributePrimitive prim, bool reserve_only)
 
void resize (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 ()
 
float4 * data_float4 ()
 
floatdata_float ()
 
uchar4data_uchar4 ()
 
Transformdata_transform ()
 
ImageHandledata_voxel ()
 
const char * data () const
 
const float2data_float2 () const
 
const float3data_float3 () const
 
const float4 * data_float4 () const
 
const floatdata_float () const
 
const Transformdata_transform () const
 
const ImageHandledata_voxel () const
 
void zero_data (void *dst)
 
void add_with_weight (void *dst, void *src, float weight)
 
void add (const float &f)
 
void add (const float2 &f)
 
void add (const float3 &f)
 
void add (const uchar4 &f)
 
void add (const Transform &tfm)
 
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 (TypeDesc a, 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

ustring name
 
AttributeStandard std
 
TypeDesc type
 
vector< char > buffer
 
AttributeElement element
 
uint flags
 
bool modified
 

Detailed Description

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

Constructor & Destructor Documentation

◆ Attribute() [1/3]

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

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

References ATTR_ELEMENT_VOXEL, buffer, resize(), TypeFloat2(), and TypeRGBA().

◆ Attribute() [2/3]

Attribute::Attribute ( Attribute && other)
default

◆ Attribute() [3/3]

Attribute::Attribute ( const Attribute & other)
delete

◆ ~Attribute()

Attribute::~Attribute ( )

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

References ATTR_ELEMENT_VOXEL, buffer, and data_voxel().

Member Function Documentation

◆ add() [1/6]

void Attribute::add ( const char * data)

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

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

◆ add() [2/6]

◆ add() [3/6]

void Attribute::add ( const float2 & f)

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

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

◆ add() [4/6]

void Attribute::add ( const float3 & f)

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

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

◆ add() [5/6]

void Attribute::add ( const Transform & tfm)

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

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

◆ add() [6/6]

void Attribute::add ( const uchar4 & f)

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

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

◆ add_with_weight()

void Attribute::add_with_weight ( void * dst,
void * src,
float weight )

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

References ATTR_ELEMENT_CORNER_BYTE, same_storage(), and TypeFloat2().

Referenced by Mesh::tessellate().

◆ buffer_size()

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

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

References data_sizeof(), and element_size().

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

◆ data() [1/2]

◆ data() [2/2]

const char * Attribute::data ( ) const
inline

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

References buffer, and NULL.

◆ data_float() [1/2]

float * Attribute::data_float ( )
inline

◆ data_float() [2/2]

const float * Attribute::data_float ( ) const
inline

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

References data(), and data_sizeof().

◆ data_float2() [1/2]

◆ data_float2() [2/2]

const float2 * Attribute::data_float2 ( ) const
inline

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

References data(), and data_sizeof().

◆ data_float3() [1/2]

◆ data_float3() [2/2]

const float3 * Attribute::data_float3 ( ) const
inline

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

References data(), and data_sizeof().

◆ data_float4() [1/2]

◆ data_float4() [2/2]

const float4 * Attribute::data_float4 ( ) const
inline

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

References data(), and data_sizeof().

◆ data_sizeof()

◆ data_transform() [1/2]

Transform * Attribute::data_transform ( )
inline

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

References data(), and data_sizeof().

Referenced by create_mesh().

◆ data_transform() [2/2]

const Transform * Attribute::data_transform ( ) const
inline

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

References data(), and data_sizeof().

◆ data_uchar4()

uchar4 * Attribute::data_uchar4 ( )
inline

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

References data(), and data_sizeof().

Referenced by attr_create_generic().

◆ data_voxel() [1/2]

◆ data_voxel() [2/2]

const ImageHandle & Attribute::data_voxel ( ) const
inline

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

References 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

◆ resize() [1/2]

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

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

References ATTR_ELEMENT_VOXEL, buffer, and buffer_size().

Referenced by Attribute(), and AttributeSet::resize().

◆ resize() [2/2]

void Attribute::resize ( size_t num_elements)

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

References ATTR_ELEMENT_VOXEL, buffer, and data_sizeof().

◆ same_storage()

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

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

References b.

Referenced by add_with_weight().

◆ set()

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

◆ set_data_from()

void Attribute::set_data_from ( Attribute && other)

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

References buffer, data(), flags, modified, and std.

Referenced by AttributeSet::update().

◆ standard_name()

◆ zero_data()

void Attribute::zero_data ( void * dst)

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

References data_sizeof().

Referenced by Mesh::tessellate().

Member Data Documentation

◆ buffer

◆ element

◆ flags

◆ modified

◆ name

ustring Attribute::name

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

Referenced by AttributeSet::find(), and AttributeSet::update().

◆ std

◆ type


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