25bool projectFaceAttribute(
const MeshPart& mp,
const Mesh& oldMesh, F&& func,
const ProjectAttributeParams& params = {} );
31 return BitSetParallelFor( mp.mesh.topology.getVertIds( mp.region ), [&] ( VertId
id )
33 auto point = !params.xfs.rigidXfPoint ? mp.mesh.points[id] : ( *params.xfs.rigidXfPoint )( mp.mesh.points[id] );
34 auto projectionResult = findProjection( point, oldMesh, FLT_MAX, params.xfs.nonRigidXfTree );
35 auto res = projectionResult.mtp;
36 VertId v1 = oldMesh.topology.org( res.e );
37 VertId v2 = oldMesh.topology.dest( res.e );
38 VertId v3 = oldMesh.topology.dest( oldMesh.topology.next( res.e ) );
39 func( id, projectionResult, v1, v2, v3 );
47 return BitSetParallelFor( mp.mesh.topology.getFaceIds( mp.region ), [&] ( FaceId newFaceId )
49 auto point = !params.xfs.rigidXfPoint ? mp.mesh.triCenter( newFaceId ) : ( *params.xfs.rigidXfPoint )( mp.mesh.triCenter( newFaceId ) );
50 auto projectionResult = findProjection( point, oldMesh, FLT_MAX, params.xfs.nonRigidXfTree );
51 func( newFaceId, projectionResult );
auto BitSetParallelFor(const BS &bs, F &&f, Cb &&... cb)
Definition MRBitSetParallelFor.h:189
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:626
struct MRMESH_CLASS Mesh
Definition MRMesh/MRMeshFwd.h:520
bool projectVertAttribute(const MeshVertPart &mp, const Mesh &oldMesh, F &&func, const ProjectAttributeParams ¶ms={})
Definition MRProjectionMeshAttribute.h:29
bool projectFaceAttribute(const MeshPart &mp, const Mesh &oldMesh, F &&func, const ProjectAttributeParams ¶ms={})
Definition MRProjectionMeshAttribute.h:45
Definition MRMesh/MRMesh.h:23
Definition MRProjectionMeshAttribute.h:12
MeshProjectionTransforms xfs
Definition MRProjectionMeshAttribute.h:13
ProgressCallback progressCb
Definition MRProjectionMeshAttribute.h:14