MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / cloneRegion

Method cloneRegion

source/MRMesh/MRMesh.cpp:390–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388}
389
390Mesh Mesh::cloneRegion( const FaceBitSet & region, bool flipOrientation, const PartMapping & map ) const
391{
392 MR_TIMER;
393
394 Mesh res;
395 const auto fcount = region.count();
396 res.topology.faceReserve( fcount );
397 const auto vcount = getIncidentVerts( topology, region ).count();
398 res.topology.vertReserve( vcount );
399 const auto ecount = 2 * getIncidentEdges( topology, region ).count();
400 res.topology.edgeReserve( ecount );
401
402 res.addMeshPart( { *this, &region }, flipOrientation, {}, {}, map );
403
404 assert( res.topology.faceSize() == fcount );
405 assert( res.topology.faceCapacity() == fcount );
406 assert( res.topology.vertSize() == vcount );
407 assert( res.topology.vertCapacity() == vcount );
408 assert( res.topology.edgeSize() == ecount );
409 assert( res.topology.edgeCapacity() == ecount );
410 return res;
411}
412
413void Mesh::pack( FaceMap * outFmap, VertMap * outVmap, WholeEdgeMap * outEmap, bool rearrangeTriangles )
414{

Callers 5

fixFunction · 0.80
cloneRegionFunction · 0.80
makeLevelOfDetailsFunction · 0.80

Calls 13

getIncidentVertsFunction · 0.85
getIncidentEdgesFunction · 0.85
countMethod · 0.80
faceReserveMethod · 0.80
addMeshPartMethod · 0.80
faceSizeMethod · 0.80
faceCapacityMethod · 0.80
vertReserveMethod · 0.45
edgeReserveMethod · 0.45
vertSizeMethod · 0.45
vertCapacityMethod · 0.45
edgeSizeMethod · 0.45

Tested by

no test coverage detected