Browse Source

Avoid deducing lambda return type to make icpc happy.

Former-commit-id: 8d93cc7d2ad0bad93585cde4ca2664fc0deb193e
Qingnan Zhou 9 years ago
parent
commit
70212b76c6

+ 1 - 1
include/igl/copyleft/boolean/CSGTree.h

@@ -98,7 +98,7 @@ namespace igl
             mesh_boolean(A.V(),A.F(),B.V(),B.F(),type,m_V,m_F,m_J);
             // reindex m_J
             std::for_each(m_J.data(),m_J.data()+m_J.size(),
-              [&](typename VectorJ::Scalar & j)
+              [&](typename VectorJ::Scalar & j) -> void
               {
                 if(j < A.F().rows())
                 {

+ 2 - 2
include/igl/copyleft/boolean/mesh_boolean.cpp

@@ -46,14 +46,14 @@ IGL_INLINE void igl::copyleft::boolean::mesh_boolean(
     Eigen::PlainObjectBase<DerivedJ > & J) {
 
 #ifdef MESH_BOOLEAN_TIMING
-  const auto & tictoc = []()
+  const auto & tictoc = []() -> double
   {
     static double t_start = igl::get_seconds();
     double diff = igl::get_seconds()-t_start;
     t_start += diff;
     return diff;
   };
-  const auto log_time = [&](const std::string& label) {
+  const auto log_time = [&](const std::string& label) -> void {
     std::cout << "mesh_boolean." << label << ": "
       << tictoc() << std::endl;
   };

+ 2 - 2
include/igl/copyleft/cgal/SelfIntersectMesh.h

@@ -333,14 +333,14 @@ inline igl::copyleft::cgal::SelfIntersectMesh<
   using namespace Eigen;
 
 #ifdef IGL_SELFINTERSECTMESH_DEBUG
-  const auto & tictoc = []()
+  const auto & tictoc = []() -> double
   {
     static double t_start = igl::get_seconds();
     double diff = igl::get_seconds()-t_start;
     t_start += diff;
     return diff;
   };
-  const auto log_time = [&](const std::string& label) {
+  const auto log_time = [&](const std::string& label) -> void{
     std::cout << "SelfIntersectMesh." << label << ": "
       << tictoc() << std::endl;
   };

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

@@ -77,7 +77,7 @@ IGL_INLINE void igl::copyleft::cgal::closest_facet(
   Tree tree(triangles.begin(), triangles.end());
   tree.accelerate_distance_queries();
 
-  auto on_the_positive_side = [&](size_t fid, const Point_3& p) {
+  auto on_the_positive_side = [&](size_t fid, const Point_3& p) -> bool{
     const auto& f = F.row(fid).eval();
     Point_3 v0(V(f[0], 0), V(f[0], 1), V(f[0], 2));
     Point_3 v1(V(f[1], 0), V(f[1], 1), V(f[1], 2));
@@ -122,7 +122,7 @@ IGL_INLINE void igl::copyleft::cgal::closest_facet(
 
   enum ElementType { VERTEX, EDGE, FACE };
   auto determine_element_type = [&](const Point_3& p, const size_t fid,
-      size_t& element_index) {
+      size_t& element_index) -> ElementType {
     const auto& tri = triangles[fid];
     const Point_3 p0 = tri[0];
     const Point_3 p1 = tri[1];
@@ -143,7 +143,7 @@ IGL_INLINE void igl::copyleft::cgal::closest_facet(
       size_t query_idx,
       const size_t s, const size_t d,
       size_t preferred_facet,
-      bool& orientation) {
+      bool& orientation) -> size_t {
     Point_3 query_point(
         P(query_idx, 0),
         P(query_idx, 1),
@@ -221,7 +221,7 @@ IGL_INLINE void igl::copyleft::cgal::closest_facet(
 
   auto process_face_case = [&](
       const size_t query_idx, const Point_3& closest_point,
-      const size_t fid, bool& orientation) {
+      const size_t fid, bool& orientation) -> size_t {
     const auto& f = F.row(I(fid, 0));
     return process_edge_case(query_idx, f[0], f[1], I(fid, 0), orientation);
   };
@@ -244,7 +244,7 @@ IGL_INLINE void igl::copyleft::cgal::closest_facet(
     const size_t query_idx, 
     size_t s,
     size_t preferred_facet, 
-    bool& orientation) 
+    bool& orientation) -> size_t
   {
     const Point_3 query_point(
         P(query_idx, 0), P(query_idx, 1), P(query_idx, 2));
@@ -296,7 +296,7 @@ IGL_INLINE void igl::copyleft::cgal::closest_facet(
 
     // A plane is on the exterior if all adj_points lies on or to
     // one side of the plane.
-    auto is_on_exterior = [&](const Plane_3& separator) {
+    auto is_on_exterior = [&](const Plane_3& separator) -> bool{
       size_t positive=0;
       size_t negative=0;
       size_t coplanar=0;

+ 6 - 5
include/igl/copyleft/cgal/extract_cells.cpp

@@ -19,7 +19,7 @@
 #include <vector>
 #include <queue>
 
-#define EXTRACT_CELLS_DEBUG
+//#define EXTRACT_CELLS_DEBUG
 
 template<
 typename DerivedV,
@@ -42,7 +42,8 @@ IGL_INLINE size_t igl::copyleft::cgal::extract_cells_single_component(
     auto edge_index_to_face_index = [&](size_t index) {
         return index % num_faces;
     };
-    auto is_consistent = [&](const size_t fid, const size_t s, const size_t d) {
+    auto is_consistent = [&](const size_t fid, const size_t s, const size_t d)
+    -> bool{
         if ((size_t)F(fid, 0) == s && (size_t)F(fid, 1) == d) return false;
         if ((size_t)F(fid, 1) == s && (size_t)F(fid, 2) == d) return false;
         if ((size_t)F(fid, 2) == s && (size_t)F(fid, 0) == d) return false;
@@ -96,7 +97,7 @@ IGL_INLINE size_t igl::copyleft::cgal::extract_cells_single_component(
     auto peel_cell_bd = [&](
             size_t seed_patch_id,
             short seed_patch_side,
-            size_t cell_idx) {
+            size_t cell_idx) -> void {
         typedef std::pair<size_t, short> PatchSide;
         std::queue<PatchSide> Q;
         Q.emplace(seed_patch_id, seed_patch_side);
@@ -177,14 +178,14 @@ IGL_INLINE size_t igl::copyleft::cgal::extract_cells(
         const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
         Eigen::PlainObjectBase<DerivedC>& cells) {
 #ifdef EXTRACT_CELLS_DEBUG
-  const auto & tictoc = []()
+  const auto & tictoc = []() -> double
   {
     static double t_start = igl::get_seconds();
     double diff = igl::get_seconds()-t_start;
     t_start += diff;
     return diff;
   };
-  const auto log_time = [&](const std::string& label) {
+  const auto log_time = [&](const std::string& label) -> void {
     std::cout << "extract_cells." << label << ": "
       << tictoc() << std::endl;
   };

+ 1 - 1
include/igl/copyleft/cgal/intersect_other.cpp

@@ -142,7 +142,7 @@ namespace igl
         EdgeMap edge2facesA,edge2facesB;
 
         std::list<int> lIF;
-        const auto cb = [&](const Box &a, const Box &b)
+        const auto cb = [&](const Box &a, const Box &b) -> void
         {
           using namespace std;
           // index in F and T

+ 1 - 1
include/igl/copyleft/cgal/order_facets_around_edge.cpp

@@ -295,7 +295,7 @@ void igl::copyleft::cgal::order_facets_around_edge(
     {
         return abs(signed_idx) -1;
     };
-    auto get_opposite_vertex_index = [&](size_t fid)
+    auto get_opposite_vertex_index = [&](size_t fid) -> typename DerivedF::Scalar
     {
         typedef typename DerivedF::Scalar Index;
         if (F(fid, 0) != (Index)s && F(fid, 0) != (Index)d) return F(fid, 0);

+ 1 - 1
include/igl/copyleft/cgal/outer_element.cpp

@@ -131,7 +131,7 @@ IGL_INLINE void igl::copyleft::cgal::outer_edge(
     Index outer_opp_vid = INVALID;
     bool infinite_slope_detected = false;
     std::vector<Index> incident_faces;
-    auto check_and_update_outer_edge = [&](Index opp_vid, Index fid) {
+    auto check_and_update_outer_edge = [&](Index opp_vid, Index fid) -> void {
         if (opp_vid == outer_opp_vid)
         {
             incident_faces.push_back(fid);

+ 1 - 1
include/igl/copyleft/cgal/points_inside_component.cpp

@@ -169,7 +169,7 @@ namespace igl {
 
                 // A plane is on the exterior if all adj_points lies on or to
                 // one side of the plane.
-                auto is_on_exterior = [&](const Plane_3& separator) {
+                auto is_on_exterior = [&](const Plane_3& separator) -> bool{
                     size_t positive=0;
                     size_t negative=0;
                     size_t coplanar=0;

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

@@ -26,7 +26,7 @@
 #include <tuple>
 #include <queue>
 
-#define PROPAGATE_WINDING_NUMBER_TIMING
+//#define PROPAGATE_WINDING_NUMBER_TIMING
 
 namespace propagate_winding_numbers_helper {
   template<
@@ -42,7 +42,7 @@ namespace propagate_winding_numbers_helper {
     auto edge_index_to_face_index = [&](size_t ei) {
       return ei % num_faces;
     };
-    auto is_consistent = [&](size_t fid, size_t s, size_t d) {
+    auto is_consistent = [&](size_t fid, size_t s, size_t d) -> bool {
       if ((size_t)F(fid, 0) == s && (size_t)F(fid, 1) == d) return true;
       if ((size_t)F(fid, 1) == s && (size_t)F(fid, 2) == d) return true;
       if ((size_t)F(fid, 2) == s && (size_t)F(fid, 0) == d) return true;
@@ -80,14 +80,14 @@ IGL_INLINE void igl::copyleft::cgal::propagate_winding_numbers(
     const Eigen::PlainObjectBase<DerivedL>& labels,
     Eigen::PlainObjectBase<DerivedW>& W) {
 #ifdef PROPAGATE_WINDING_NUMBER_TIMING
-  const auto & tictoc = []()
+  const auto & tictoc = []() -> double
   {
     static double t_start = igl::get_seconds();
     double diff = igl::get_seconds()-t_start;
     t_start += diff;
     return diff;
   };
-  const auto log_time = [&](const std::string& label) {
+  const auto log_time = [&](const std::string& label) -> void {
     std::cout << "propagate_winding_num." << label << ": "
       << tictoc() << std::endl;
   };
@@ -130,7 +130,7 @@ IGL_INLINE void igl::copyleft::cgal::propagate_winding_numbers(
   log_time("cell_connectivity");
 #endif
 
-  auto save_cell = [&](const std::string& filename, size_t cell_id) {
+  auto save_cell = [&](const std::string& filename, size_t cell_id) -> void{
     std::vector<size_t> faces;
     for (size_t i=0; i<num_patches; i++) {
       if ((per_patch_cells.row(i).array() == cell_id).any()) {
@@ -161,7 +161,7 @@ IGL_INLINE void igl::copyleft::cgal::propagate_winding_numbers(
     cell_labels.setZero();
     Eigen::VectorXi parents(num_cells);
     parents.setConstant(-1);
-    auto trace_parents = [&](size_t idx) {
+    auto trace_parents = [&](size_t idx) -> std::list<size_t> {
       std::list<size_t> path;
       path.push_back(idx);
       while ((size_t)parents[path.back()] != path.back()) {

+ 3 - 3
include/igl/copyleft/cgal/remesh_intersections.cpp

@@ -78,7 +78,7 @@ IGL_INLINE void igl::copyleft::cgal::remesh_intersections(
         return coeffs;
     };
 
-    auto plane_comp = [&](const Plane_3& p1, const Plane_3& p2) {
+    auto plane_comp = [&](const Plane_3& p1, const Plane_3& p2) -> bool{
         const auto p1_coeffs = normalize_plane_coeff(p1);
         const auto p2_coeffs = normalize_plane_coeff(p2);
         if (p1_coeffs[0] != p2_coeffs[0])
@@ -132,7 +132,7 @@ IGL_INLINE void igl::copyleft::cgal::remesh_intersections(
     auto run_delaunay_triangulation = [&](const Plane_3& P,
             const std::vector<Index>& involved_faces,
             std::vector<Point_3>& vertices,
-            std::vector<std::vector<Index> >& faces) {
+            std::vector<std::vector<Index> >& faces) -> void {
         CDT_plus_2 cdt;
         for (const auto& fid : involved_faces) {
             const auto itr = offending.find(fid);
@@ -250,7 +250,7 @@ IGL_INLINE void igl::copyleft::cgal::remesh_intersections(
     auto post_triangulation_process = [&](
             const std::vector<Point_3>& vertices,
             const std::vector<std::vector<Index> >& faces,
-            const std::vector<Index>& involved_faces) {
+            const std::vector<Index>& involved_faces) -> void {
         for (const auto& f : faces) {
             const Point_3& v0 = vertices[f[0]];
             const Point_3& v1 = vertices[f[1]];