is_edge_manifold.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Alec Jacobson <[email protected]>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_IS_EDGE_MANIFOLD_H
  9. #define IGL_IS_EDGE_MANIFOLD_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. /// Check if the mesh is edge-manifold (every edge is incident one one face
  15. /// (boundary) or two oppositely oriented faces).
  16. ///
  17. /// @param[in] F #F by 3 list of triangle indices
  18. /// @return true iff all edges are manifold
  19. ///
  20. /// \see is_vertex_manifold
  21. template <typename DerivedF>
  22. IGL_INLINE bool is_edge_manifold(
  23. const Eigen::MatrixBase<DerivedF>& F);
  24. /// Checks if mesh is edge-manifold and outputs per-edge info.
  25. ///
  26. /// @param[in] F #F by 3 list of triangle indices
  27. /// @param[out] BF #F by 3 list of flags revealing if edge opposite
  28. /// corresponding vertex is non-manifold.
  29. /// @param[out] E #E by 2 list of unique edges
  30. /// @param[out] EMAP 3*#F list of indices of opposite edges in "E"
  31. /// @param[out] BE #E list of flags whether edge is non-manifold
  32. template <
  33. typename DerivedF,
  34. typename DerivedBF,
  35. typename DerivedE,
  36. typename DerivedEMAP,
  37. typename DerivedBE>
  38. IGL_INLINE bool is_edge_manifold(
  39. const Eigen::MatrixBase<DerivedF>& F,
  40. Eigen::PlainObjectBase<DerivedBF>& BF,
  41. Eigen::PlainObjectBase<DerivedE>& E,
  42. Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
  43. Eigen::PlainObjectBase<DerivedBE>& BE);
  44. /// \overload
  45. template <
  46. typename DerivedF,
  47. typename DerivedEMAP,
  48. typename DerivedBF,
  49. typename DerivedBE>
  50. IGL_INLINE bool is_edge_manifold(
  51. const Eigen::MatrixBase<DerivedF>& F,
  52. const typename DerivedF::Index ne,
  53. const Eigen::MatrixBase<DerivedEMAP>& EMAP,
  54. Eigen::PlainObjectBase<DerivedBF>& BF,
  55. Eigen::PlainObjectBase<DerivedBE>& BE);
  56. }
  57. #ifndef IGL_STATIC_LIBRARY
  58. # include "is_edge_manifold.cpp"
  59. #endif
  60. #endif