Blender  V3.3
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
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 ()
 
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_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 44 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 18 of file scene/attribute.cpp.

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

◆ Attribute() [2/3]

Attribute::Attribute ( Attribute &&  other)
default

◆ Attribute() [3/3]

Attribute::Attribute ( const Attribute other)
delete

◆ ~Attribute()

Attribute::~Attribute ( )

Member Function Documentation

◆ add() [1/6]

void Attribute::add ( const char *  data)

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

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

◆ add() [2/6]

void Attribute::add ( const float f)

◆ add() [3/6]

void Attribute::add ( const float2 f)

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

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

◆ add() [4/6]

void Attribute::add ( const float3 f)

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

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

◆ add() [5/6]

void Attribute::add ( const Transform tfm)

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

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

◆ add() [6/6]

void Attribute::add ( const uchar4 f)

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

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

◆ add_with_weight()

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

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

References ATTR_ELEMENT_CORNER_BYTE, element, same_storage(), src, type, and TypeFloat2().

Referenced by Mesh::tessellate().

◆ buffer_size()

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

Definition at line 264 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

◆ data() [2/2]

const char* Attribute::data ( ) const
inline

Definition at line 116 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 135 of file scene/attribute.h.

References data(), and data_sizeof().

◆ data_float2() [1/2]

float2* Attribute::data_float2 ( )
inline

◆ data_float2() [2/2]

const float2* Attribute::data_float2 ( ) const
inline

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

References data(), and data_sizeof().

◆ data_float3() [1/2]

float3* Attribute::data_float3 ( )
inline

◆ data_float3() [2/2]

const float3* Attribute::data_float3 ( ) const
inline

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

References data(), and data_sizeof().

◆ data_float4() [1/2]

float4* Attribute::data_float4 ( )
inline

◆ data_float4() [2/2]

const float4* Attribute::data_float4 ( ) const
inline

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

References data(), and data_sizeof().

◆ data_sizeof()

size_t Attribute::data_sizeof ( ) const

◆ data_transform() [1/2]

Transform* Attribute::data_transform ( )
inline

Definition at line 103 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 140 of file scene/attribute.h.

References data(), and data_sizeof().

◆ data_uchar4()

uchar4* Attribute::data_uchar4 ( )
inline

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

References data(), and data_sizeof().

Referenced by attr_create_generic().

◆ data_voxel() [1/2]

ImageHandle& Attribute::data_voxel ( )
inline

◆ data_voxel() [2/2]

const ImageHandle& Attribute::data_voxel ( ) const
inline

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

References data(), and data_sizeof().

◆ element_size()

size_t Attribute::element_size ( Geometry geom,
AttributePrimitive  prim 
) const

◆ 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 46 of file scene/attribute.cpp.

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

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

◆ resize() [2/2]

void Attribute::resize ( size_t  num_elements)

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

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

◆ same_storage()

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

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

References Freestyle::a, and usdtokens::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 140 of file scene/attribute.cpp.

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

Referenced by AttributeSet::update().

◆ standard_name()

const char * Attribute::standard_name ( AttributeStandard  std)
static

◆ zero_data()

void Attribute::zero_data ( void dst)

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

References data_sizeof().

Referenced by Mesh::tessellate().

Member Data Documentation

◆ buffer

vector<char> Attribute::buffer

◆ element

AttributeElement Attribute::element

◆ flags

uint Attribute::flags

◆ modified

bool Attribute::modified

◆ name

ustring Attribute::name

◆ std

AttributeStandard Attribute::std

◆ type

TypeDesc Attribute::type

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