Blender  V3.3
Public Member Functions | Protected Member Functions | List of all members
blender::bke::mesh_surface_sample::MeshAttributeInterpolator Class Reference

#include <BKE_mesh_sample.hh>

Public Member Functions

 MeshAttributeInterpolator (const Mesh *mesh, const IndexMask mask, const Span< float3 > positions, const Span< int > looptri_indices)
 
void sample_data (const GVArray &src, eAttrDomain domain, eAttributeMapMode mode, const GMutableSpan dst)
 
void sample_attribute (const GAttributeReader &src_attribute, GSpanAttributeWriter &dst_attribute, eAttributeMapMode mode)
 

Protected Member Functions

Span< float3ensure_barycentric_coords ()
 
Span< float3ensure_nearest_weights ()
 

Detailed Description

A utility class that performs attribute interpolation from a source mesh.

The interpolator is only valid as long as the mesh is valid. Barycentric weights are needed when interpolating point or corner domain attributes, these are computed lazily when needed and re-used.

Definition at line 59 of file BKE_mesh_sample.hh.

Constructor & Destructor Documentation

◆ MeshAttributeInterpolator()

blender::bke::mesh_surface_sample::MeshAttributeInterpolator::MeshAttributeInterpolator ( const Mesh mesh,
const IndexMask  mask,
const Span< float3 positions,
const Span< int >  looptri_indices 
)

Definition at line 143 of file mesh_sample.cc.

References BLI_assert, positions, and blender::Span< T >::size().

Member Function Documentation

◆ ensure_barycentric_coords()

Span< float3 > blender::bke::mesh_surface_sample::MeshAttributeInterpolator::ensure_barycentric_coords ( )
protected

◆ ensure_nearest_weights()

Span< float3 > blender::bke::mesh_surface_sample::MeshAttributeInterpolator::ensure_nearest_weights ( )
protected

◆ sample_attribute()

void blender::bke::mesh_surface_sample::MeshAttributeInterpolator::sample_attribute ( const GAttributeReader src_attribute,
GSpanAttributeWriter dst_attribute,
eAttributeMapMode  mode 
)

◆ sample_data()

void blender::bke::mesh_surface_sample::MeshAttributeInterpolator::sample_data ( const GVArray src,
eAttrDomain  domain,
eAttributeMapMode  mode,
const GMutableSpan  dst 
)

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