Browse Source

Merge pull request #1 from libigl/master

update from libigl repo

Former-commit-id: 3994e48c7a6d1ca2993ad8385e561a2681dc27bb
stefanbrugger 10 years ago
parent
commit
d1cf6ed347
3 changed files with 25 additions and 15 deletions
  1. 2 2
      include/igl/boundary_loop.h
  2. 18 8
      include/igl/outline_ordered.cpp
  3. 5 5
      include/igl/outline_ordered.h

+ 2 - 2
include/igl/boundary_loop.h

@@ -5,8 +5,8 @@
 // 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/.
-#ifndef IGL_BOUNDARY_VERTICES_SORTED_H
-#define IGL_BOUNDARY_VERTICES_SORTED_H
+#ifndef IGL_BOUNDARY_LOOP_H
+#define IGL_BOUNDARY_LOOP_H
 #include <igl/igl_inline.h>
 
 #include <Eigen/Dense>

+ 18 - 8
include/igl/outline_ordered.cpp

@@ -1,21 +1,31 @@
+// This file is part of libigl, a simple c++ geometry processing library.
+// 
+// Copyright (C) 2014 Stefan Brugger <stefanbrugger@gmail.com>
+// 
+// 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 "outline_ordered.h"
-
-#include "igl/exterior_edges.h"
+#include "exterior_edges.h"
 #include <set>
 
-using namespace std;
-using namespace Eigen;
-
-template <typename Index>
+template <typename DerivedF, typename Index>
 IGL_INLINE void igl::outline_ordered(
-    const Eigen::MatrixXi& F, 
+    const Eigen::PlainObjectBase<DerivedF> & F, 
     std::vector<std::vector<Index> >& L)
 {
+  using namespace std;
+  using namespace Eigen;
+  // Exterior edges include some non-manifold edges (poor function name). I
+  // suppose `outline_ordered` is not well defined for non-manifold meshes, but
+  // perhaps this should just call `boundary_facets`
   MatrixXi E = exterior_edges(F);
 
   set<int> unseen;
   for (int i = 0; i < E.rows(); ++i)
-      unseen.insert(unseen.end(),i);
+  {
+    unseen.insert(unseen.end(),i);
+  }
 
   while (!unseen.empty())
   {

+ 5 - 5
include/igl/outline_ordered.h

@@ -5,9 +5,9 @@
 // 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/.
-#ifndef IGL_OUTLINE_H
-#define IGL_OUTLINE_H
-#include <igl/igl_inline.h>
+#ifndef IGL_OUTLINE_ORDERED_H
+#define IGL_OUTLINE_ORDERED_H
+#include "igl_inline.h"
 
 #include <Eigen/Dense>
 #include <vector>
@@ -23,9 +23,9 @@ namespace igl
   // Outputs:
   //   L  list of loops where L[i] = ordered list of boundary vertices in loop i
   //
-  template <typename Index>
+  template <typename DerivedF, typename Index>
   IGL_INLINE void outline_ordered(
-    const Eigen::MatrixXi& F, 
+    const Eigen::PlainObjectBase<DerivedF> & F, 
     std::vector<std::vector<Index> >& L);
 }