MeshLib
 
Loading...
Searching...
No Matches
MRPartMapping.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRphmap.h"
4
5namespace MR
6{
7
8// mapping among elements of source mesh, from which a part is taken, and target (this) mesh
10{
11 // from.id -> this.id
12 // hash maps are used to minimize memory consumption when only a small portion of source mesh is copied
16 // this.id -> from.id
17 FaceMap * tgt2srcFaces = nullptr;
18 VertMap * tgt2srcVerts = nullptr;
19 WholeEdgeMap * tgt2srcEdges = nullptr;
20};
21
22// the class to convert mappings from new HashMap format to old Vector format
24{
25public:
26 MRMESH_API HashToVectorMappingConverter( const MeshTopology & srcTopology, FaceMap * outFmap, VertMap * outVmap, WholeEdgeMap * outEmap );
27 const PartMapping & getPartMapping() const { return map_; }
28 MRMESH_API ~HashToVectorMappingConverter(); //conversion takes place here
29
30private:
31 FaceMap * outFmap_ = nullptr;
32 VertMap * outVmap_ = nullptr;
33 WholeEdgeMap * outEmap_ = nullptr;
34 PartMapping map_;
35 FaceHashMap src2tgtFaces_;
36 VertHashMap src2tgtVerts_;
37 WholeEdgeHashMap src2tgtEdges_;
38};
39
40}
List< VertId > VertMap
Definition MRDotNet/MRMeshFwd.h:84
List< FaceId > FaceMap
Definition MRDotNet/MRMeshFwd.h:87
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
Definition MRPartMapping.h:24
MRMESH_API ~HashToVectorMappingConverter()
const PartMapping & getPartMapping() const
Definition MRPartMapping.h:27
MRMESH_API HashToVectorMappingConverter(const MeshTopology &srcTopology, FaceMap *outFmap, VertMap *outVmap, WholeEdgeMap *outEmap)
Definition MRMesh/MRMeshTopology.h:18
Definition MRCameraOrientationPlugin.h:7
HashMap< VertId, VertId > VertHashMap
Definition MRMesh/MRMeshFwd.h:455
HashMap< UndirectedEdgeId, EdgeId > WholeEdgeHashMap
mapping of whole edges: map[e]->f, map[e.sym()]->f.sym(), where only map[e] for even edges is stored
Definition MRMesh/MRMeshFwd.h:459
HashMap< FaceId, FaceId > FaceHashMap
Definition MRMesh/MRMeshFwd.h:454
Definition MRPartMapping.h:10
FaceHashMap * src2tgtFaces
Definition MRPartMapping.h:13
WholeEdgeMap * tgt2srcEdges
Definition MRPartMapping.h:19
FaceMap * tgt2srcFaces
Definition MRPartMapping.h:17
VertMap * tgt2srcVerts
Definition MRPartMapping.h:18
WholeEdgeHashMap * src2tgtEdges
Definition MRPartMapping.h:15
VertHashMap * src2tgtVerts
Definition MRPartMapping.h:14