boundary_loop.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Stefan Brugger <[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_BOUNDARY_LOOP_H
  9. #define IGL_BOUNDARY_LOOP_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Dense>
  12. #include <vector>
  13. namespace igl
  14. {
  15. /// Compute list of ordered boundary loops for a manifold mesh.
  16. ///
  17. /// @tparam Index index type
  18. /// @param[in] F #F by dim list of mesh faces
  19. /// @param[out] L list of loops where L[i] = ordered list of boundary vertices in loop i
  20. ///
  21. template <typename DerivedF, typename Index>
  22. IGL_INLINE void boundary_loop(
  23. const Eigen::MatrixBase<DerivedF>& F,
  24. std::vector<std::vector<Index> >& L);
  25. /// Compute ordered boundary loops for a manifold mesh and return the
  26. /// longest loop in terms of vertices.
  27. ///
  28. /// @tparam Index index type
  29. /// @param[in] F #F by dim list of mesh faces
  30. /// @param[out] L ordered list of boundary vertices of longest boundary loop
  31. ///
  32. template <typename DerivedF, typename Index>
  33. IGL_INLINE void boundary_loop(
  34. const Eigen::MatrixBase<DerivedF>& F,
  35. std::vector<Index>& L);
  36. /// Compute ordered boundary loops for a manifold mesh and return the
  37. /// longest loop in terms of vertices.
  38. ///
  39. /// @tparam Index index type
  40. /// @param[in] F #F by dim list of mesh faces
  41. /// @param[out] L ordered list of boundary vertices of longest boundary loop
  42. ///
  43. template <typename DerivedF, typename DerivedL>
  44. IGL_INLINE void boundary_loop(
  45. const Eigen::MatrixBase<DerivedF>& F,
  46. Eigen::PlainObjectBase<DerivedL>& L);
  47. }
  48. #ifndef IGL_STATIC_LIBRARY
  49. # include "boundary_loop.cpp"
  50. #endif
  51. #endif