MCPcopy Create free account
hub / github.com/ImageEngine/cortex / merge

Method merge

src/IECoreScene/MeshAlgoMerge.cpp:370–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

368} // namespace
369
370MeshPrimitivePtr IECoreScene::MeshAlgo::merge( const std::vector<const MeshPrimitive *> &meshes, const Canceller *canceller )
371{
372 if( meshes.empty() )
373 {
374 throw IECore::InvalidArgumentException( "IECoreScene::MeshAlgo::merge : No Mesh Primitives were provided." );
375 }
376
377 /// \todo: This scales poorly with increasing numbers of meshes.
378 /// Rather than allocating enough memory for everything and filling
379 /// it once, we're re-allocating and re-copying from the start for
380 /// each mesh. Improve the algorithm.
381 MeshPrimitivePtr result = meshes[0]->copy();
382 auto it = meshes.begin() + 1;
383 for( ; it != meshes.end(); ++it )
384 {
385 Canceller::check( canceller );
386 ::merge( result.get(), *it, canceller );
387 }
388
389 return result;
390}

Callers 7

testPlanesMethod · 0.80
testDifferentPrimVarsMethod · 0.80
testReferencedDataMethod · 0.80
testIndexedPrimVarsMethod · 0.80
testMultipleMeshesMethod · 0.80
testCornersAndCreasesMethod · 0.80

Calls 6

InvalidArgumentExceptionFunction · 0.85
mergeFunction · 0.70
copyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getMethod · 0.45

Tested by 7

testPlanesMethod · 0.64
testDifferentPrimVarsMethod · 0.64
testReferencedDataMethod · 0.64
testIndexedPrimVarsMethod · 0.64
testMultipleMeshesMethod · 0.64
testCornersAndCreasesMethod · 0.64