29bool projectFaceAttribute(
const MeshPart& mp,
const Mesh& oldMesh, F&& func,
const ProjectAttributeParams& params = {} );
46 return BitSetParallelFor( mp.mesh.topology.getVertIds( mp.region ), [&] ( VertId
id )
48 auto point = !params.xfs.rigidXfPoint ? mp.mesh.points[id] : ( *params.xfs.rigidXfPoint )( mp.mesh.points[id] );
49 auto projectionResult = findProjection( point, oldMesh, FLT_MAX, params.xfs.nonRigidXfTree );
50 auto res = projectionResult.mtp;
51 VertId v1 = oldMesh.topology.org( res.e );
52 VertId v2 = oldMesh.topology.dest( res.e );
53 VertId v3 = oldMesh.topology.dest( oldMesh.topology.next( res.e ) );
54 func( id, projectionResult, v1, v2, v3 );
62 return BitSetParallelFor( mp.mesh.topology.getFaceIds( mp.region ), [&] ( FaceId newFaceId )
64 auto point = !params.xfs.rigidXfPoint ? mp.mesh.triCenter( newFaceId ) : ( *params.xfs.rigidXfPoint )( mp.mesh.triCenter( newFaceId ) );
65 auto projectionResult = findProjection( point, oldMesh, FLT_MAX, params.xfs.nonRigidXfTree );
66 func( newFaceId, projectionResult );
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:80
auto BitSetParallelFor(const BS &bs, F &&f, Cb &&... cb)
Definition MRBitSetParallelFor.h:191
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:732
Definition MRCameraOrientationPlugin.h:8
struct MRMESH_CLASS Mesh
Definition MRMesh/MRMeshFwd.h:617
tl::expected< T, E > Expected
Definition MRExpected.h:28
MRMESH_API Expected< void > projectObjectMeshData(const ObjectMeshData &oldMeshData, ObjectMeshData &newMeshData, const FaceBitSet *region=nullptr, const ProjectAttributeParams ¶ms={})
finds attributes of new mesh by projecting faces/vertices on old mesh
bool projectVertAttribute(const MeshVertPart &mp, const Mesh &oldMesh, F &&func, const ProjectAttributeParams ¶ms={})
Definition MRProjectionMeshAttribute.h:44
bool projectFaceAttribute(const MeshPart &mp, const Mesh &oldMesh, F &&func, const ProjectAttributeParams ¶ms={})
Definition MRProjectionMeshAttribute.h:60
Definition MRMesh/MRMesh.h:23
mesh and its per-element attributes for ObjectMeshHolder
Definition MRObjectMeshData.h:14
this structure contains transformation for projection from one mesh to another and progress callback
Definition MRProjectionMeshAttribute.h:16
MeshProjectionTransforms xfs
Definition MRProjectionMeshAttribute.h:17
ProgressCallback progressCb
Definition MRProjectionMeshAttribute.h:18