Ver Fonte

Templatize parameter F of function mesh_to_polyhedron.

As suggested by @jdumas.
Wesley Ranger há 6 anos atrás
pai
commit
e8d993dd73

+ 6 - 6
include/igl/copyleft/cgal/mesh_to_polyhedron.cpp

@@ -9,13 +9,13 @@
 #include <CGAL/Polyhedron_3.h>
 #include <CGAL/Polyhedron_incremental_builder_3.h>
 
-
-template <typename Polyhedron, typename DerivedV>
+template <
+	typename Polyhedron,
+	typename DerivedV,
+	typename DerivedF>
 IGL_INLINE bool igl::copyleft::cgal::mesh_to_polyhedron(
-  const Eigen::MatrixBase<DerivedV> & V,
-  const Eigen::MatrixXi & F,
-  Polyhedron & poly)
-{
+    const Eigen::MatrixBase<DerivedV>& V, const Eigen::MatrixBase<DerivedF>& F,
+    Polyhedron& poly) {
   typedef typename Polyhedron::HalfedgeDS HalfedgeDS;
   // Postcondition: hds is a valid polyhedral surface.
   CGAL::Polyhedron_incremental_builder_3<HalfedgeDS> B(poly.hds());

+ 5 - 2
include/igl/copyleft/cgal/mesh_to_polyhedron.h

@@ -27,10 +27,13 @@ namespace igl
       //   poly  cgal polyhedron
       // Returns true only if (V,F) can be converted to a valid polyhedron (i.e. if
       // (V,F) is vertex and edge manifold).
-      template <typename Polyhedron, typename DerivedV>
+      template <
+		  typename Polyhedron,
+		  typename DerivedV,
+		  typename DerivedF>
       IGL_INLINE bool mesh_to_polyhedron(
         const Eigen::MatrixBase<DerivedV> & V,
-        const Eigen::MatrixXi & F,
+        const Eigen::MatrixBase<DerivedF> & F,
         Polyhedron & poly);
     }
   }