26bool projectFaceAttribute(
const MeshPart& mp,
const Mesh& oldMesh, F&& func,
const ProjectAttributeParams& params = {} );
32 return BitSetParallelFor( mp.mesh.topology.getVertIds( mp.region ), [&] ( VertId
id )
34 auto point = !params.xfs.rigidXfPoint ? mp.mesh.points[id] : ( *params.xfs.rigidXfPoint )( mp.mesh.points[id] );
35 auto projectionResult = findProjection( point, oldMesh, FLT_MAX, params.xfs.nonRigidXfTree );
36 auto res = projectionResult.mtp;
37 VertId v1 = oldMesh.topology.org( res.e );
38 VertId v2 = oldMesh.topology.dest( res.e );
39 VertId v3 = oldMesh.topology.dest( oldMesh.topology.next( res.e ) );
40 func( id, projectionResult, v1, v2, v3 );
48 return BitSetParallelFor( mp.mesh.topology.getFaceIds( mp.region ), [&] ( FaceId newFaceId )
50 auto point = !params.xfs.rigidXfPoint ? mp.mesh.triCenter( newFaceId ) : ( *params.xfs.rigidXfPoint )( mp.mesh.triCenter( newFaceId ) );
51 auto projectionResult = findProjection( point, oldMesh, FLT_MAX, params.xfs.nonRigidXfTree );
52 func( newFaceId, projectionResult );
auto BitSetParallelFor(const BS &bs, F &&f, Cb &&... cb)
Definition MRBitSetParallelFor.h:191
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:728
Definition MRCameraOrientationPlugin.h:8
struct MRMESH_CLASS Mesh
Definition MRMesh/MRMeshFwd.h:617
bool projectVertAttribute(const MeshVertPart &mp, const Mesh &oldMesh, F &&func, const ProjectAttributeParams ¶ms={})
Definition MRProjectionMeshAttribute.h:30
bool projectFaceAttribute(const MeshPart &mp, const Mesh &oldMesh, F &&func, const ProjectAttributeParams ¶ms={})
Definition MRProjectionMeshAttribute.h:46
Definition MRMesh/MRMesh.h:23
Definition MRProjectionMeshAttribute.h:13
MeshProjectionTransforms xfs
Definition MRProjectionMeshAttribute.h:14
ProgressCallback progressCb
Definition MRProjectionMeshAttribute.h:15