Skip to content

Commit

Permalink
Merge pull request #771 from wildmeshing/mtao/operator_before_ptr_check
Browse files Browse the repository at this point in the history
Mtao/operator before ptr check
  • Loading branch information
mtao committed May 12, 2024
2 parents f78fce5 + 8155d44 commit 3c23b4b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/wmtk/operations/Operation.cpp
Expand Up @@ -109,14 +109,20 @@ bool Operation::before(const simplex::Simplex& simplex) const
// map simplex to the invariant mesh
const Mesh& invariant_mesh = m_invariants.mesh();

// TODO check if this is correct
const std::vector<simplex::Simplex> invariant_simplices =
m_mesh.map(invariant_mesh, simplex_resurrect);

for (const simplex::Simplex& s : invariant_simplices) {
if (!m_invariants.before(s)) {
if (&invariant_mesh == &mesh()) {
if (!m_invariants.before(simplex_resurrect)) {
return false;
}
} else {
// TODO check if this is correct
const std::vector<simplex::Simplex> invariant_simplices =
m_mesh.map(invariant_mesh, simplex_resurrect);

for (const simplex::Simplex& s : invariant_simplices) {
if (!m_invariants.before(s)) {
return false;
}
}
}

return true;
Expand Down

0 comments on commit 3c23b4b

Please sign in to comment.