boundary_loop.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Stefan Brugger <stefanbrugger@gmail.com>
  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. // Templates:
  18. // Index index type
  19. // Inputs:
  20. // F #V by dim list of mesh faces
  21. // Outputs:
  22. // L list of loops where L[i] = ordered list of boundary vertices in loop i
  23. //
  24. template <typename DerivedF, typename Index>
  25. IGL_INLINE void boundary_loop(
  26. const Eigen::PlainObjectBase<DerivedF>& F,
  27. std::vector<std::vector<Index> >& L);
  28. // Compute ordered boundary loops for a manifold mesh and return the
  29. // longest loop in terms of vertices.
  30. //
  31. // Templates:
  32. // Index index type
  33. // Inputs:
  34. // F #V by dim list of mesh faces
  35. // Outputs:
  36. // L ordered list of boundary vertices of longest boundary loop
  37. //
  38. template <typename DerivedF, typename Index>
  39. IGL_INLINE void boundary_loop(
  40. const Eigen::PlainObjectBase<DerivedF>& F,
  41. std::vector<Index>& L);
  42. // Compute ordered boundary loops for a manifold mesh and return the
  43. // longest loop in terms of vertices.
  44. //
  45. // Templates:
  46. // Index index type
  47. // Inputs:
  48. // F #V by dim list of mesh faces
  49. // Outputs:
  50. // L ordered list of boundary vertices of longest boundary loop
  51. //
  52. template <typename DerivedF, typename DerivedL>
  53. IGL_INLINE void boundary_loop(
  54. const Eigen::PlainObjectBase<DerivedF>& F,
  55. Eigen::PlainObjectBase<DerivedL>& L);
  56. }
  57. #ifndef IGL_STATIC_LIBRARY
  58. # include "boundary_loop.cpp"
  59. #endif
  60. #endif