Przeglądaj źródła

warnings

Former-commit-id: 6498a6e482efce30dd12a8fdf99796b6198c5f33
Alec Jacobson 9 lat temu
rodzic
commit
f4a1fa8551

+ 4 - 4
include/igl/copyleft/boolean/BinaryWindingNumberOperations.h

@@ -25,7 +25,7 @@ namespace igl
             public:
                 template<typename DerivedW>
                     typename DerivedW::Scalar operator()(
-                            const Eigen::PlainObjectBase<DerivedW>& win_nums) const {
+                            const Eigen::PlainObjectBase<DerivedW>& /*win_nums*/) const {
                         throw (std::runtime_error("not implemented!"));
                     }
         };
@@ -76,7 +76,7 @@ namespace igl
             public:
                 template<typename DerivedW>
                     typename DerivedW::Scalar operator()(
-                            const Eigen::PlainObjectBase<DerivedW>& win_nums) const {
+                            const Eigen::PlainObjectBase<DerivedW>& /*win_nums*/) const {
                         return true;
                     }
         };
@@ -97,7 +97,7 @@ namespace igl
             public:
                 template<typename DerivedW>
                     short operator()(
-                            const Eigen::PlainObjectBase<DerivedW>& win_nums) const {
+                            const Eigen::PlainObjectBase<DerivedW>& /*win_nums*/) const {
                         throw std::runtime_error("Not implemented");
                     }
         };
@@ -117,7 +117,7 @@ namespace igl
         class WindingNumberFilter<KEEP_ALL> {
             public:
                 template<typename T>
-                    short operator()(T out_w, T in_w) const {
+                    short operator()(T /*out_w*/, T /*in_w*/) const {
                         return 1;
                     }
         };

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

@@ -93,14 +93,14 @@ namespace igl {
                     const Eigen::PlainObjectBase<DerivedJ1>& J1,
                     Eigen::PlainObjectBase<DerivedF2>& F2,
                     Eigen::PlainObjectBase<DerivedJ2>& J2) {
-                typedef typename DerivedF1::Scalar Index;
+                //typedef typename DerivedF1::Scalar Index;
                 Eigen::VectorXi IA,IC;
                 DerivedF1 uF;
                 igl::unique_simplices(F1,uF,IA,IC);
 
                 const size_t num_faces = F1.rows();
                 const size_t num_unique_faces = uF.rows();
-                assert(IA.rows() == num_unique_faces);
+                assert((size_t) IA.rows() == num_unique_faces);
                 // faces ontop of each unique face
                 std::vector<std::vector<int> > uF2F(num_unique_faces);
                 // signed counts
@@ -194,9 +194,9 @@ IGL_INLINE void igl::copyleft::boolean::mesh_boolean(
   using namespace igl::copyleft::boolean::mesh_boolean_helper;
 
   typedef typename DerivedVC::Scalar Scalar;
-  typedef typename DerivedFC::Scalar Index;
+  //typedef typename DerivedFC::Scalar Index;
   typedef Eigen::Matrix<Scalar,Eigen::Dynamic,3> MatrixX3S;
-  typedef Eigen::Matrix<Index,Eigen::Dynamic,Eigen::Dynamic> MatrixXI;
+  //typedef Eigen::Matrix<Index,Eigen::Dynamic,Eigen::Dynamic> MatrixXI;
   typedef Eigen::Matrix<typename DerivedJ::Scalar,Eigen::Dynamic,1> VectorXJ;
 
   // Generate combined mesh.
@@ -217,7 +217,7 @@ IGL_INLINE void igl::copyleft::boolean::mesh_boolean(
   std::transform(CJ.data(), CJ.data()+CJ.size(), labels.data(),
           [&](int i) { return i<FA.rows() ? 0:1; });
   igl::copyleft::cgal::propagate_winding_numbers(V, F, labels, W);
-  assert(W.rows() == num_faces);
+  assert((size_t)W.rows() == num_faces);
   if (W.cols() == 2) {
       assert(FB.rows() == 0);
       Eigen::MatrixXi W_tmp(num_faces, 4);
@@ -241,9 +241,9 @@ IGL_INLINE void igl::copyleft::boolean::mesh_boolean(
   auto index_to_signed_index = [&](size_t i, bool ori) -> int{
       return (i+1)*(ori?1:-1);
   };
-  auto signed_index_to_index = [&](int i) -> size_t {
-      return abs(i) - 1;
-  };
+  //auto signed_index_to_index = [&](int i) -> size_t {
+  //    return abs(i) - 1;
+  //};
   std::vector<int> selected;
   for(size_t i=0; i<num_faces; i++) {
       auto should_keep = keep(Wr(i,0), Wr(i,1));
@@ -276,8 +276,8 @@ IGL_INLINE void igl::copyleft::boolean::mesh_boolean(
       resolve_duplicated_faces(kept_faces, kept_face_indices, G, J);
 
       MatrixX3S Vs(V.rows(), V.cols());
-      for (size_t i=0; i<V.rows(); i++) {
-          for (size_t j=0; j<V.cols(); j++) {
+      for (size_t i=0; i<(size_t)V.rows(); i++) {
+          for (size_t j=0; j<(size_t)V.cols(); j++) {
               igl::copyleft::cgal::assign_scalar(V(i,j), Vs(i,j));
           }
       }

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

@@ -86,12 +86,12 @@ IGL_INLINE void igl::copyleft::cgal::closest_facet(
 
     auto get_orientation = [&](size_t fid, size_t s, size_t d) -> bool {
         const auto& f = F.row(fid);
-        if (f[0] == s && f[1] == d) return false;
-        else if (f[1] == s && f[2] == d) return false;
-        else if (f[2] == s && f[0] == d) return false;
-        else if (f[0] == d && f[1] == s) return true;
-        else if (f[1] == d && f[2] == s) return true;
-        else if (f[2] == d && f[0] == s) return true;
+        if      ((size_t)f[0] == s && (size_t)f[1] == d) return false;
+        else if ((size_t)f[1] == s && (size_t)f[2] == d) return false;
+        else if ((size_t)f[2] == s && (size_t)f[0] == d) return false;
+        else if ((size_t)f[0] == d && (size_t)f[1] == s) return true;
+        else if ((size_t)f[1] == d && (size_t)f[2] == s) return true;
+        else if ((size_t)f[2] == d && (size_t)f[0] == s) return true;
         else {
             throw std::runtime_error(
                     "Cannot compute orientation due to incorrect connectivity");
@@ -101,9 +101,9 @@ IGL_INLINE void igl::copyleft::cgal::closest_facet(
     auto index_to_signed_index = [&](size_t index, bool ori) -> int{
         return (index+1) * (ori? 1:-1);
     };
-    auto signed_index_to_index = [&](int signed_index) -> size_t {
-        return abs(signed_index) - 1;
-    };
+    //auto signed_index_to_index = [&](int signed_index) -> size_t {
+    //    return abs(signed_index) - 1;
+    //};
 
     enum ElementType { VERTEX, EDGE, FACE };
     auto determine_element_type = [&](const Point_3& p, const size_t fid,
@@ -218,9 +218,9 @@ IGL_INLINE void igl::copyleft::cgal::closest_facet(
         std::set<size_t> adj_vertices_set;
         for (auto fid : intersected_face_indices) {
             const auto& f = F.row(fid);
-            if (f[0] != s) adj_vertices_set.insert(f[0]);
-            if (f[1] != s) adj_vertices_set.insert(f[1]);
-            if (f[2] != s) adj_vertices_set.insert(f[2]);
+            if ((size_t)f[0] != s) adj_vertices_set.insert(f[0]);
+            if ((size_t)f[1] != s) adj_vertices_set.insert(f[1]);
+            if ((size_t)f[2] != s) adj_vertices_set.insert(f[2]);
         }
         const size_t num_adj_vertices = adj_vertices_set.size();
         std::vector<size_t> adj_vertices(num_adj_vertices);

+ 15 - 12
include/igl/copyleft/cgal/extract_cells.cpp

@@ -34,19 +34,19 @@ IGL_INLINE size_t igl::copyleft::cgal::extract_cells_single_component(
         const std::vector<std::vector<uE2EType> >& uE2E,
         const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
         Eigen::PlainObjectBase<DerivedC>& cells) {
-    typedef typename DerivedF::Scalar Index;
+    //typedef typename DerivedF::Scalar Index;
     const size_t num_faces = F.rows();
     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) {
-        if (F(fid, 0) == s && F(fid, 1) == d) return false;
-        if (F(fid, 1) == s && F(fid, 2) == d) return false;
-        if (F(fid, 2) == s && F(fid, 0) == d) return false;
+        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;
 
-        if (F(fid, 0) == d && F(fid, 1) == s) return true;
-        if (F(fid, 1) == d && F(fid, 2) == s) return true;
-        if (F(fid, 2) == d && F(fid, 0) == s) return true;
+        if ((size_t)F(fid, 0) == d && (size_t)F(fid, 1) == s) return true;
+        if ((size_t)F(fid, 1) == d && (size_t)F(fid, 2) == s) return true;
+        if ((size_t)F(fid, 2) == d && (size_t)F(fid, 0) == s) return true;
         throw "Invalid face!";
         return false;
     };
@@ -111,7 +111,7 @@ IGL_INLINE size_t igl::copyleft::cgal::extract_cells_single_component(
                 const size_t edge_valance = order.size();
                 size_t curr_i = 0;
                 for (curr_i=0; curr_i < edge_valance; curr_i++) {
-                    if (order[curr_i] == ei) break;
+                    if ((size_t)order[curr_i] == ei) break;
                 }
                 assert(curr_i < edge_valance);
 
@@ -133,7 +133,9 @@ IGL_INLINE size_t igl::copyleft::cgal::extract_cells_single_component(
                     Q.emplace(next_patch_id, next_patch_side);
                     cells(next_patch_id, next_patch_side) = cell_idx;
                 } else {
-                    assert(cells(next_patch_id, next_patch_side) == cell_idx);
+                    assert(
+                      (size_t)cells(next_patch_id, next_patch_side) == 
+                      cell_idx);
                 }
             }
         }
@@ -237,7 +239,7 @@ IGL_INLINE size_t igl::copyleft::cgal::extract_cells(
                     ? 0:1;
                 const size_t ambient_cell = raw_cells(closest_patch,
                         closest_patch_side);
-                if (ambient_cell != outer_cells[i]) {
+                if (ambient_cell != (size_t)outer_cells[i]) {
                     nested_cells[ambient_cell].push_back(outer_cells[j]);
                     ambient_cells[outer_cells[j]].push_back(ambient_cell);
                     ambient_comps[j].push_back(i);
@@ -318,7 +320,7 @@ IGL_INLINE size_t igl::copyleft::cgal::extract_cells(
         const Eigen::PlainObjectBase<DerivedF>& F,
         Eigen::PlainObjectBase<DerivedC>& cells) {
     const size_t num_faces = F.rows();
-    typedef typename DerivedF::Scalar Index;
+    //typedef typename DerivedF::Scalar Index;
 
     Eigen::MatrixXi E, uE;
     Eigen::VectorXi EMAP;
@@ -326,7 +328,8 @@ IGL_INLINE size_t igl::copyleft::cgal::extract_cells(
     igl::unique_edge_map(F, E, uE, EMAP, uE2E);
 
     Eigen::VectorXi P;
-    const size_t num_patches = igl::extract_manifold_patches(F, EMAP, uE2E, P);
+    //const size_t num_patches = 
+      igl::extract_manifold_patches(F, EMAP, uE2E, P);
 
     DerivedC per_patch_cells;
     const size_t num_cells =

+ 14 - 12
include/igl/copyleft/cgal/propagate_winding_numbers.cpp

@@ -40,13 +40,13 @@ namespace propagate_winding_numbers_helper {
             return ei % num_faces;
         };
         auto is_consistent = [&](size_t fid, size_t s, size_t d) {
-            if (F(fid, 0) == s && F(fid, 1) == d) return true;
-            if (F(fid, 1) == s && F(fid, 2) == d) return true;
-            if (F(fid, 2) == s && F(fid, 0) == d) return true;
+            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;
 
-            if (F(fid, 0) == d && F(fid, 1) == s) return false;
-            if (F(fid, 1) == d && F(fid, 2) == s) return false;
-            if (F(fid, 2) == d && F(fid, 0) == s) return false;
+            if ((size_t)F(fid, 0) == d && (size_t)F(fid, 1) == s) return false;
+            if ((size_t)F(fid, 1) == d && (size_t)F(fid, 2) == s) return false;
+            if ((size_t)F(fid, 2) == d && (size_t)F(fid, 0) == s) return false;
             throw "Invalid face!!";
         };
         for (size_t i=0; i<num_edges; i++) {
@@ -77,7 +77,7 @@ IGL_INLINE void igl::copyleft::cgal::propagate_winding_numbers(
         const Eigen::PlainObjectBase<DerivedL>& labels,
         Eigen::PlainObjectBase<DerivedW>& W) {
     const size_t num_faces = F.rows();
-    typedef typename DerivedF::Scalar Index;
+    //typedef typename DerivedF::Scalar Index;
 
     Eigen::MatrixXi E, uE;
     Eigen::VectorXi EMAP;
@@ -106,7 +106,7 @@ IGL_INLINE void igl::copyleft::cgal::propagate_winding_numbers(
         for (size_t i=0; i<num_patches; i++) {
             if ((per_patch_cells.row(i).array() == cell_id).any()) {
                 for (size_t j=0; j<num_faces; j++) {
-                    if (P[j] == i) {
+                    if ((size_t)P[j] == i) {
                         faces.push_back(j);
                     }
                 }
@@ -117,7 +117,7 @@ IGL_INLINE void igl::copyleft::cgal::propagate_winding_numbers(
             cell_faces.row(i) = F.row(faces[i]);
         }
         Eigen::MatrixXd vertices(V.rows(), 3);
-        for (size_t i=0; i<V.rows(); i++) {
+        for (size_t i=0; i<(size_t)V.rows(); i++) {
             assign_scalar(V(i,0), vertices(i,0));
             assign_scalar(V(i,1), vertices(i,1));
             assign_scalar(V(i,2), vertices(i,2));
@@ -134,7 +134,7 @@ IGL_INLINE void igl::copyleft::cgal::propagate_winding_numbers(
         auto trace_parents = [&](size_t idx) {
             std::list<size_t> path;
             path.push_back(idx);
-            while (parents[path.back()] != path.back()) {
+            while ((size_t)parents[path.back()] != path.back()) {
                 path.push_back(parents[path.back()]);
             }
             return path;
@@ -216,7 +216,7 @@ IGL_INLINE void igl::copyleft::cgal::propagate_winding_numbers(
             if ((per_cell_W.row(neighbor_cell).array() == INVALID).any()) {
                 per_cell_W.row(neighbor_cell) = per_cell_W.row(curr_cell);
                 for (size_t i=0; i<num_labels; i++) {
-                    int inc = (patch_labels[patch_idx] == i) ?
+                    int inc = (patch_labels[patch_idx] == (int)i) ?
                         (direction ? -1:1) :0;
                     per_cell_W(neighbor_cell, i) =
                         per_cell_W(curr_cell, i) + inc;
@@ -224,10 +224,12 @@ IGL_INLINE void igl::copyleft::cgal::propagate_winding_numbers(
                 Q.push(neighbor_cell);
             } else {
                 for (size_t i=0; i<num_labels; i++) {
-                    if (i == patch_labels[patch_idx]) {
+                    if ((int)i == patch_labels[patch_idx]) {
+#ifndef NDEBUG
                         int inc = direction ? -1:1;
                         assert(per_cell_W(neighbor_cell, i) ==
                                 per_cell_W(curr_cell, i) + inc);
+#endif
                     } else {
                         assert(per_cell_W(neighbor_cell, i) ==
                                 per_cell_W(curr_cell, i));

+ 4 - 7
include/igl/copyleft/cgal/remesh_intersections.cpp

@@ -32,7 +32,7 @@ IGL_INLINE void igl::copyleft::cgal::remesh_intersections(
         std::vector<CGAL::Object> > > & offending,
         const std::map<
         std::pair<typename DerivedF::Index,typename DerivedF::Index>,
-        std::vector<typename DerivedF::Index> > & edge2faces,
+        std::vector<typename DerivedF::Index> > & /*edge2faces*/,
         Eigen::PlainObjectBase<DerivedVV> & VV,
         Eigen::PlainObjectBase<DerivedFF> & FF,
         Eigen::PlainObjectBase<DerivedJ> & J,
@@ -42,9 +42,9 @@ IGL_INLINE void igl::copyleft::cgal::remesh_intersections(
     typedef CGAL::Segment_3<Kernel>  Segment_3; 
     typedef CGAL::Triangle_3<Kernel> Triangle_3; 
     typedef CGAL::Plane_3<Kernel>    Plane_3;
-    typedef CGAL::Point_2<Kernel>    Point_2;
-    typedef CGAL::Segment_2<Kernel>  Segment_2; 
-    typedef CGAL::Triangle_2<Kernel> Triangle_2; 
+    //typedef CGAL::Point_2<Kernel>    Point_2;
+    //typedef CGAL::Segment_2<Kernel>  Segment_2; 
+    //typedef CGAL::Triangle_2<Kernel> Triangle_2; 
     typedef CGAL::Triangulation_vertex_base_2<Kernel>  TVB_2;
     typedef CGAL::Constrained_triangulation_face_base_2<Kernel> CTFB_2;
     typedef CGAL::Triangulation_data_structure_2<TVB_2,CTFB_2> TDS_2;
@@ -114,7 +114,6 @@ IGL_INLINE void igl::copyleft::cgal::remesh_intersections(
         }
     }
 
-    const size_t INVALID = std::numeric_limits<size_t>::max();
     std::vector<std::vector<Index> > resolved_faces;
     std::vector<Index> source_faces;
     std::vector<Point_3> new_vertices;
@@ -168,8 +167,6 @@ IGL_INLINE void igl::copyleft::cgal::remesh_intersections(
                 }
             }
         }
-        const size_t num_vertices = cdt.number_of_vertices();
-        const size_t num_faces = cdt.number_of_faces();
         std::map<typename CDT_plus_2::Vertex_handle,Index> v2i;
         size_t count=0;
         for (auto itr = cdt.finite_vertices_begin();

+ 2 - 2
include/igl/extract_non_manifold_edge_curves.cpp

@@ -11,12 +11,12 @@ typename DerivedEMAP,
 typename uE2EType >
 IGL_INLINE void igl::extract_non_manifold_edge_curves(
         const Eigen::PlainObjectBase<DerivedF>& F,
-        const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
+        const Eigen::PlainObjectBase<DerivedEMAP>& /*EMAP*/,
         const std::vector<std::vector<uE2EType> >& uE2E,
         std::vector<std::vector<size_t> >& curves) {
     const size_t num_faces = F.rows();
     assert(F.cols() == 3);
-    typedef std::pair<size_t, size_t> Edge;
+    //typedef std::pair<size_t, size_t> Edge;
     auto edge_index_to_face_index = [&](size_t ei) { return ei % num_faces; };
     auto edge_index_to_corner_index = [&](size_t ei) { return ei / num_faces; };
     auto get_edge_end_points = [&](size_t ei, size_t& s, size_t& d) {