Blender V5.3
Attribute Class Reference

#include <attribute.h>

Classes

struct  Buffer

Public Member Functions

 Attribute (ustring name, const TypeDesc type, AttributeElement element, Geometry *geom, AttributePrimitive prim)
 Attribute (ustring name, const TypeDesc type, AttributeElement element, const void *data, int size, ImplicitSharingInfo sharing_info)
 Attribute (Attribute &&other)
Attribute & operator= (Attribute &&other)=delete
 Attribute (const Attribute &other)=delete
Attribute & operator= (const Attribute &other)=delete
 ~Attribute ()
void set (ustring name, const TypeDesc type, AttributeElement element)
void resize (Geometry *geom, AttributePrimitive prim)
void resize (const size_t num_elements)
void add_motion (const Geometry *geom)
void remove_motion ()
bool has_motion () const
int num_motion_steps () const
void take_motion_from (Attribute &other)
void set_motion_step_shared (int step, const void *data, int new_size, ImplicitSharingInfo sharing_info)
size_t data_sizeof () const
size_t buffer_size (Geometry *geom, AttributePrimitive prim) const
template<typename T = void>
const T * data (const int step=0) const
template<typename T = void>
T * data_for_write (const int step=0)
int time_step_to_attr_step (const int step, const int num_time_steps) const
template<typename T = void>
const T * data_at_time_step (const int step, const int num_time_steps) const
const ImageHandle & data_voxel () const
ImageHandle & data_voxel_for_write ()
void zero_data (void *dst)
void set_data_from (Attribute &&other)
void free_data ()
bool matches_standard (const Geometry *geometry, AttributeStandard std) const
void get_uv_tiles (Geometry *geom, AttributePrimitive prim, unordered_set< int > &tiles) const

Static Public Member Functions

static size_t element_size (Geometry *geom, AttributeElement element, AttributePrimitive prim)
static bool same_storage (const TypeDesc a, const TypeDesc b)
static const char * standard_name (AttributeStandard std)
static AttributeStandard name_standard (ustring name)
static AttributeStandard name_volume_standard (ustring name)
static ustring osl_name (AttributeStandard std)
static ustring osl_name (ustring name)
static AttrKernelDataType kernel_type (const Attribute &attr)

Public Attributes

ustring name
AttributeStandard std
TypeDesc type
Buffer center
vector< Buffer > motion
int size = 0
AttributeElement element
uint flags
bool modified

Detailed Description

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

Constructor & Destructor Documentation

◆ Attribute() [1/4]

◆ Attribute() [2/4]

Attribute::Attribute ( ustring name,
const TypeDesc type,
AttributeElement element,
const void * data,
int size,
ImplicitSharingInfo sharing_info )

◆ Attribute() [3/4]

Attribute::Attribute ( Attribute && other)

Definition at line 97 of file attribute.cpp.

References Attribute(), element, modified, name, set_data_from(), std, and type.

◆ Attribute() [4/4]

Attribute::Attribute ( const Attribute & other)
delete

References Attribute().

◆ ~Attribute()

Attribute::~Attribute ( )

Definition at line 117 of file attribute.cpp.

References free_data().

Member Function Documentation

◆ add_motion()

◆ buffer_size()

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

Definition at line 435 of file attribute.cpp.

References data_sizeof(), element, and element_size().

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

◆ data()

◆ data_at_time_step()

template<typename T = void>
const T * Attribute::data_at_time_step ( const int step,
const int num_time_steps ) const
inline

◆ data_for_write()

template<typename T = void>
T * Attribute::data_for_write ( const int step = 0)
inline

◆ data_sizeof()

◆ data_voxel()

const ImageHandle & Attribute::data_voxel ( ) const
inline

◆ data_voxel_for_write()

ImageHandle & Attribute::data_voxel_for_write ( )
inline

◆ element_size()

◆ free_data()

void Attribute::free_data ( )

Definition at line 107 of file attribute.cpp.

References center, data_sizeof(), element, element_size(), free_step_buffer(), motion, and size.

Referenced by resize(), set_data_from(), and ~Attribute().

◆ get_uv_tiles()

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

◆ has_motion()

◆ kernel_type()

◆ matches_standard()

bool Attribute::matches_standard ( const Geometry * geometry,
AttributeStandard std ) const

Definition at line 957 of file attribute.cpp.

References element, standard_type_element(), std, and type.

Referenced by AttributeSet::find().

◆ name_standard()

AttributeStandard Attribute::name_standard ( ustring name)
static

◆ name_volume_standard()

◆ num_motion_steps()

◆ operator=() [1/2]

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

References Attribute().

◆ operator=() [2/2]

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

References Attribute().

◆ osl_name() [1/2]

ustring Attribute::osl_name ( AttributeStandard std)
static

Definition at line 590 of file attribute.cpp.

References standard_name(), and std.

Referenced by osl_name().

◆ osl_name() [2/2]

ustring Attribute::osl_name ( ustring name)
static

Definition at line 595 of file attribute.cpp.

References ATTR_STD_NONE, name, name_standard(), osl_name(), and std.

◆ remove_motion()

◆ resize() [1/2]

void Attribute::resize ( const size_t num_elements)

◆ resize() [2/2]

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

◆ same_storage()

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

Definition at line 441 of file attribute.cpp.

References b.

Referenced by SubdAttributeInterpolation::setup_attribute().

◆ set()

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

◆ set_data_from()

◆ set_motion_step_shared()

void Attribute::set_motion_step_shared ( int step,
const void * data,
int new_size,
ImplicitSharingInfo sharing_info )

◆ standard_name()

◆ take_motion_from()

void Attribute::take_motion_from ( Attribute & other)

Definition at line 230 of file attribute.cpp.

References assert, Attribute(), element, modified, motion, remove_motion(), size, and type.

◆ time_step_to_attr_step()

int Attribute::time_step_to_attr_step ( const int step,
const int num_time_steps ) const
inline

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

References center, and step.

Referenced by data_at_time_step().

◆ zero_data()

void Attribute::zero_data ( void * dst)

Definition at line 455 of file attribute.cpp.

References data_sizeof(), spherical_harmonics_rest_fill_zero(), and type.

Member Data Documentation

◆ center

Buffer Attribute::center

◆ element

◆ flags

uint Attribute::flags

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

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

◆ modified

◆ motion

◆ name

◆ size

◆ std

◆ type


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