MCPcopy Create free account
hub / github.com/RenderKit/embree / initializeHalfEdgeStructures

Method initializeHalfEdgeStructures

kernels/common/scene_subdiv_mesh.cpp:627–664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

625 }
626
627 void SubdivMesh::Topology::initializeHalfEdgeStructures ()
628 {
629 /* if vertex indices not set we ignore this topology */
630 if (!vertexIndices)
631 return;
632
633 /* allocate half edge array */
634 halfEdges.resize(mesh->numEdges());
635
636 /* check if we have to recalculate the half edges */
637 bool recalculate = false;
638 recalculate |= vertexIndices.isLocalModified();
639 recalculate |= mesh->faceVertices.isLocalModified();
640 recalculate |= mesh->holes.isLocalModified();
641
642 /* check if we can simply update the half edges */
643 bool update = false;
644 update |= mesh->topology[0].vertexIndices.isLocalModified(); // we use this buffer to copy creases to interpolation topologies
645 update |= mesh->edge_creases.isLocalModified();
646 update |= mesh->edge_crease_weights.isLocalModified();
647 update |= mesh->vertex_creases.isLocalModified();
648 update |= mesh->vertex_crease_weights.isLocalModified();
649 update |= mesh->levels.isLocalModified();
650
651 /* now either recalculate or update the half edges */
652 if (recalculate) calculateHalfEdges();
653 else if (update) updateHalfEdges();
654
655 /* cleanup some state for static scenes */
656 /* if (mesh->scene_ == nullptr || mesh->scene_->isStaticAccel())
657 {
658 halfEdges0.clear();
659 halfEdges1.clear();
660 } */
661
662 /* clear modified state of all buffers */
663 vertexIndices.clearLocalModified();
664 }
665
666 void SubdivMesh::printStatistics()
667 {

Callers

nothing calls this directly

Calls 10

getSecondsFunction · 0.85
parallel_prefix_sumFunction · 0.85
isLocalModifiedMethod · 0.80
clearLocalModifiedMethod · 0.80
getStrideMethod · 0.80
resizeMethod · 0.45
numEdgesMethod · 0.45
initMethod · 0.45
sizeMethod · 0.45
verbosityMethod · 0.45

Tested by

no test coverage detected