15struct ProjectAttributeParams
17 MeshProjectionTransforms xfs;
18 ProgressCallback progressCb;
24bool projectVertAttribute(
const MeshVertPart& mp,
const Mesh& oldMesh, F&& func,
const ProjectAttributeParams& params = {} );
29bool projectFaceAttribute(
const MeshPart& mp,
const Mesh& oldMesh, F&& func,
const ProjectAttributeParams& params = {} );
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 );
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 MRMeshFwd.h:80
Definition MRMesh/MRMesh.h:23
Definition MRObjectMeshData.h:14
Definition MRProjectionMeshAttribute.h:16
auto BitSetParallelFor(const BS &bs, F &&f, Cb &&... cb)
Definition MRBitSetParallelFor.h:191
Definition MRCameraOrientationPlugin.h:8
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