Blender
V3.3
|
#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< float3 > | ensure_barycentric_coords () |
Span< float3 > | ensure_nearest_weights () |
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.
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().
|
protected |
Definition at line 152 of file mesh_sample.cc.
References BKE_mesh_runtime_looptri_ensure(), BKE_mesh_runtime_looptri_len(), BLI_assert, MVert::co, interp_weights_tri_v3(), blender::IndexMask::min_array_size(), Mesh::mloop, Mesh::mvert, MLoopTri::tri, and MLoop::v.
Referenced by sample_data().
|
protected |
Definition at line 180 of file mesh_sample.cc.
References BKE_mesh_runtime_looptri_ensure(), BKE_mesh_runtime_looptri_len(), BLI_assert, MVert::co, len_squared_v3v3(), MIN3_PAIR, blender::IndexMask::min_array_size(), Mesh::mloop, Mesh::mvert, MLoopTri::tri, and MLoop::v.
Referenced by sample_data().
void blender::bke::mesh_surface_sample::MeshAttributeInterpolator::sample_attribute | ( | const GAttributeReader & | src_attribute, |
GSpanAttributeWriter & | dst_attribute, | ||
eAttributeMapMode | mode | ||
) |
Definition at line 255 of file mesh_sample.cc.
References blender::bke::GAttributeReader::domain, sample_data(), blender::bke::GSpanAttributeWriter::span, and blender::bke::GAttributeReader::varray.
void blender::bke::mesh_surface_sample::MeshAttributeInterpolator::sample_data | ( | const GVArray & | src, |
eAttrDomain | domain, | ||
eAttributeMapMode | mode, | ||
const GMutableSpan | dst | ||
) |
Definition at line 208 of file mesh_sample.cc.
References ATTR_DOMAIN_CORNER, ATTR_DOMAIN_EDGE, ATTR_DOMAIN_FACE, ATTR_DOMAIN_POINT, BLI_assert_unreachable, ELEM, ensure_barycentric_coords(), ensure_nearest_weights(), blender::bke::mesh_surface_sample::INTERPOLATED, blender::GMutableSpan::is_empty(), blender::bke::mesh_surface_sample::NEAREST, blender::bke::mesh_surface_sample::sample_corner_attribute(), blender::bke::mesh_surface_sample::sample_face_attribute(), blender::bke::mesh_surface_sample::sample_point_attribute(), and src.
Referenced by sample_attribute().