Skip to content

Commit

Permalink
[fast-csg] Ditch ExactLazyNumbersVisitor (superseded by CorefinementV…
Browse files Browse the repository at this point in the history
…isitor)
  • Loading branch information
ochafik authored and kintel committed Mar 22, 2023
1 parent 7cb016c commit f0c1cad
Showing 1 changed file with 0 additions and 49 deletions.
49 changes: 0 additions & 49 deletions src/geometry/cgal/cgalutils-corefine.cc
Expand Up @@ -5,55 +5,6 @@

namespace CGALUtils {

#if FAST_CSG_KERNEL_IS_LAZY

/*! Visitor that forces exact numbers for the vertices of all the faces created during corefinement.
*/
template <typename TriangleMesh>
struct ExactLazyNumbersVisitor
: public PMP::Corefinement::Default_visitor<TriangleMesh> {
using GT = boost::graph_traits<TriangleMesh>;
using face_descriptor = typename GT::face_descriptor;
using halfedge_descriptor = typename GT::halfedge_descriptor;
using vertex_descriptor = typename GT::vertex_descriptor;

#if CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(5, 4, 0)
void new_vertex_added(std::size_t /*i_id*/, vertex_descriptor v, const TriangleMesh& tm) {
auto& pt = tm.point(v);
CGAL::exact(pt.x());
CGAL::exact(pt.y());
CGAL::exact(pt.z());
}
#else
face_descriptor split_face;
std::vector<face_descriptor> created_faces;

void before_subface_creations(face_descriptor f_split, TriangleMesh& tm)
{
split_face = f_split;
created_faces.clear();
}

void after_subface_creations(TriangleMesh& mesh)
{
for (auto& fi : created_faces) {
CGAL::Vertex_around_face_iterator<TriangleMesh> vbegin, vend;
for (boost::tie(vbegin, vend) = vertices_around_face(mesh.halfedge(fi), mesh); vbegin != vend;
++vbegin) {
auto& v = mesh.point(*vbegin);
CGAL::exact(v.x());
CGAL::exact(v.y());
CGAL::exact(v.z());
}
}
created_faces.clear();
}
void after_subface_created(face_descriptor fi, TriangleMesh& tm) { created_faces.push_back(fi); }
#endif // if CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(5, 4, 0)
};

#endif// FAST_CSG_KERNEL_IS_LAZY

#define COREFINEMENT_FUNCTION(functionName, cgalFunctionName) \
template <class TriangleMesh> \
bool functionName(TriangleMesh &lhs, TriangleMesh &rhs, TriangleMesh &out) \
Expand Down

0 comments on commit f0c1cad

Please sign in to comment.