// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2016 Alec Jacobson // // This Source Code Form is subject to the terms of the Mozilla Public License // v. 2.0. If a copy of the MPL was not distributed with this file, You can // obtain one at http://mozilla.org/MPL/2.0/. #include "projected_cdt.h" #include "insert_into_cdt.h" #include "assign_scalar.h" #include "../../list_to_matrix.h" template IGL_INLINE void igl::copyleft::cgal::projected_cdt( const std::vector & objects, const CGAL::Plane_3 & P, std::vector >& vertices, std::vector >& faces) { typedef CGAL::Triangulation_vertex_base_2 TVB_2; typedef CGAL::Constrained_triangulation_face_base_2 CTFB_2; typedef CGAL::Triangulation_data_structure_2 TDS_2; typedef CGAL::Exact_intersections_tag Itag; typedef CGAL::Constrained_Delaunay_triangulation_2 CDT_2; typedef CGAL::Constrained_triangulation_plus_2 CDT_plus_2; CDT_plus_2 cdt; for(const auto & obj : objects) insert_into_cdt(obj,P,cdt); // Read off vertices of the cdt, remembering index std::map v2i; size_t count=0; for ( auto itr = cdt.finite_vertices_begin(); itr != cdt.finite_vertices_end(); itr++) { vertices.push_back(P.to_3d(itr->point())); v2i[itr] = count; count++; } // Read off faces and store index triples for ( auto itr = cdt.finite_faces_begin(); itr != cdt.finite_faces_end(); itr++) { faces.push_back( { v2i[itr->vertex(0)], v2i[itr->vertex(1)], v2i[itr->vertex(2)] }); } } template < typename Kernel, typename DerivedV, typename DerivedF> IGL_INLINE void igl::copyleft::cgal::projected_cdt( const std::vector & objects, const CGAL::Plane_3 & P, Eigen::PlainObjectBase & V, Eigen::PlainObjectBase & F) { std::vector > vertices; std::vector > faces; projected_cdt(objects,P,vertices,faces); V.resize(vertices.size(),3); for(int v = 0;v(std::vector > const&, CGAL::Plane_3 const&, std::vector, std::allocator > >&, std::vector >, std::allocator > > >&); // generated by autoexplicit.sh template void igl::copyleft::cgal::projected_cdt(std::vector > const&, CGAL::Plane_3 const&, std::vector, std::allocator > >&, std::vector >, std::allocator > > >&); #include #ifdef WIN32 template void igl::copyleft::cgal::projected_cdt(class std::vector> const &, class CGAL::Plane_3 const &, class std::vector, class std::allocator>> &, class std::vector>, class std::allocator>>> &); template void igl::copyleft::cgal::projected_cdt(class std::vector> const &, class CGAL::Plane_3 const &, class std::vector, class std::allocator>> &, class std::vector>, class std::allocator>>> &); #endif #endif