| 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 | { |
nothing calls this directly
no test coverage detected