Browse Source

Fixed explicit template specialization.

Former-commit-id: e5e17719d1044303da5c07ee647b6e9c3db25d2c
Qingnan Zhou 9 năm trước cách đây
mục cha
commit
491c37217c

+ 14 - 18
include/igl/cgal/component_inside_component.cpp

@@ -19,6 +19,7 @@
 
 
 #include "order_facets_around_edge.h"
 #include "order_facets_around_edge.h"
 #include "assign_scalar.h"
 #include "assign_scalar.h"
+#include "points_inside_component.h"
 
 
 template <typename DerivedV, typename DerivedF, typename DerivedI>
 template <typename DerivedV, typename DerivedF, typename DerivedI>
 IGL_INLINE bool igl::cgal::component_inside_component(
 IGL_INLINE bool igl::cgal::component_inside_component(
@@ -63,25 +64,20 @@ IGL_INLINE bool igl::cgal::component_inside_component(
 // Explicit template specialization
 // Explicit template specialization
 template bool igl::cgal::component_inside_component<
 template bool igl::cgal::component_inside_component<
 Eigen::Matrix<double, -1, -1, 0, -1, -1>,
 Eigen::Matrix<double, -1, -1, 0, -1, -1>,
-Eigen::Matrix<int, -1, -1, 0, -1, -1>,
-Eigen::Matrix<int, -1, -1, 0, -1, -1>,
-Eigen::Matrix<double, -1, -1, 0, -1, -1>,
-Eigen::Matrix<int, -1, -1, 0, -1, -1>,
-Eigen::Matrix<int, -1, -1, 0, -1, -1> >(
-Eigen::Matrix<double, -1, -1, 0, -1, -1>& const,
-Eigen::Matrix<int, -1, -1, 0, -1, -1>& const,
-Eigen::Matrix<int, -1, -1, 0, -1, -1>& const,
-Eigen::Matrix<double, -1, -1, 0, -1, -1>& const,
-Eigen::Matrix<int, -1, -1, 0, -1, -1>& const,
-Eigen::Matrix<int, -1, -1, 0, -1, -1>& const);
+Eigen::Matrix<   int, -1, -1, 0, -1, -1>,
+Eigen::Matrix<   int, -1, -1, 0, -1, -1> > (
+Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&,
+Eigen::PlainObjectBase<Eigen::Matrix<   int, -1, -1, 0, -1, -1> > const&,
+Eigen::PlainObjectBase<Eigen::Matrix<   int, -1, -1, 0, -1, -1> > const&,
+Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&,
+Eigen::PlainObjectBase<Eigen::Matrix<   int, -1, -1, 0, -1, -1> > const&,
+Eigen::PlainObjectBase<Eigen::Matrix<   int, -1, -1, 0, -1, -1> > const&);
 
 
 template bool igl::cgal::component_inside_component<
 template bool igl::cgal::component_inside_component<
 Eigen::Matrix<double, -1, -1, 0, -1, -1>,
 Eigen::Matrix<double, -1, -1, 0, -1, -1>,
-Eigen::Matrix<int, -1, -1, 0, -1, -1>,
-Eigen::Matrix<double, -1, -1, 0, -1, -1>,
-Eigen::Matrix<int, -1, -1, 0, -1, -1> >(
-Eigen::Matrix<double, -1, -1, 0, -1, -1>& const,
-Eigen::Matrix<int, -1, -1, 0, -1, -1>& const,
-Eigen::Matrix<double, -1, -1, 0, -1, -1>& const,
-Eigen::Matrix<int, -1, -1, 0, -1, -1>& const);
+Eigen::Matrix<   int, -1, -1, 0, -1, -1> > (
+Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&,
+Eigen::PlainObjectBase<Eigen::Matrix<   int, -1, -1, 0, -1, -1> > const&,
+Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&,
+Eigen::PlainObjectBase<Eigen::Matrix<   int, -1, -1, 0, -1, -1> > const&);
 #endif
 #endif

+ 17 - 17
include/igl/cgal/points_inside_component.cpp

@@ -311,7 +311,7 @@ IGL_INLINE void igl::cgal::points_inside_component(
             case VERTEX:
             case VERTEX:
                 {
                 {
                     const size_t s = F(I(fid, 0), element_index);
                     const size_t s = F(I(fid, 0), element_index);
-                    inside[i] = determine_point_vertex_orientation(
+                    inside(i,0) = determine_point_vertex_orientation(
                             V, F, I, query, s);
                             V, F, I, query, s);
                 }
                 }
                 break;
                 break;
@@ -319,12 +319,12 @@ IGL_INLINE void igl::cgal::points_inside_component(
                 {
                 {
                     const size_t s = F(I(fid, 0), (element_index+1)%3);
                     const size_t s = F(I(fid, 0), (element_index+1)%3);
                     const size_t d = F(I(fid, 0), (element_index+2)%3);
                     const size_t d = F(I(fid, 0), (element_index+2)%3);
-                    inside[i] = determine_point_edge_orientation(
+                    inside(i,0) = determine_point_edge_orientation(
                             V, F, I, query, s, d);
                             V, F, I, query, s, d);
                 }
                 }
                 break;
                 break;
             case FACE:
             case FACE:
-                inside[i] = determine_point_face_orientation(V, F, I, query, fid);
+                inside(i,0) = determine_point_face_orientation(V, F, I, query, fid);
                 break;
                 break;
             default:
             default:
                 throw "Unknow closest element type!";
                 throw "Unknow closest element type!";
@@ -348,23 +348,23 @@ IGL_INLINE void igl::cgal::points_inside_component(
 // Explicit template specialization
 // Explicit template specialization
 template void igl::cgal::points_inside_component<
 template void igl::cgal::points_inside_component<
 Eigen::Matrix<double, -1, -1, 0, -1, -1>,
 Eigen::Matrix<double, -1, -1, 0, -1, -1>,
-Eigen::Matrix<int, -1, -1, 0, -1, -1>,
-Eigen::Matrix<int, -1, -1, 0, -1, -1>,
+Eigen::Matrix<   int, -1, -1, 0, -1, -1>,
+Eigen::Matrix<   int, -1, -1, 0, -1, -1>,
 Eigen::Matrix<double, -1, -1, 0, -1, -1>,
 Eigen::Matrix<double, -1, -1, 0, -1, -1>,
-Eigen::Matrix<int, -1, -1, 0, -1, -1> > (
-Eigen::Matrix<double, -1, -1, 0, -1, -1> const&,
-Eigen::Matrix<int, -1, -1, 0, -1, -1> const&,
-Eigen::Matrix<int, -1, -1, 0, -1, -1> const&,
-Eigen::Matrix<double, -1, -1, 0, -1, -1> const&,
-Eigen::Matrix<int, -1, -1, 0, -1, -1>&);
+Eigen::Matrix<   int, -1, -1, 0, -1, -1> > (
+Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&,
+Eigen::PlainObjectBase<Eigen::Matrix<   int, -1, -1, 0, -1, -1> > const&,
+Eigen::PlainObjectBase<Eigen::Matrix<   int, -1, -1, 0, -1, -1> > const&,
+Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&,
+Eigen::PlainObjectBase<Eigen::Matrix<   int, -1, -1, 0, -1, -1> >&);
 
 
 template void igl::cgal::points_inside_component<
 template void igl::cgal::points_inside_component<
 Eigen::Matrix<double, -1, -1, 0, -1, -1>,
 Eigen::Matrix<double, -1, -1, 0, -1, -1>,
-Eigen::Matrix<int, -1, -1, 0, -1, -1>,
+Eigen::Matrix<   int, -1, -1, 0, -1, -1>,
 Eigen::Matrix<double, -1, -1, 0, -1, -1>,
 Eigen::Matrix<double, -1, -1, 0, -1, -1>,
-Eigen::Matrix<int, -1, -1, 0, -1, -1> > (
-Eigen::Matrix<double, -1, -1, 0, -1, -1> const&,
-Eigen::Matrix<int, -1, -1, 0, -1, -1> const&,
-Eigen::Matrix<double, -1, -1, 0, -1, -1> const&,
-Eigen::Matrix<int, -1, -1, 0, -1, -1>&);
+Eigen::Matrix<   int, -1, -1, 0, -1, -1> > (
+Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&,
+Eigen::PlainObjectBase<Eigen::Matrix<   int, -1, -1, 0, -1, -1> > const&,
+Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&,
+Eigen::PlainObjectBase<Eigen::Matrix<   int, -1, -1, 0, -1, -1> >&);
 #endif
 #endif