circulation.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 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_CIRCULATION_H
  9. #define IGL_CIRCULATION_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. #include <vector>
  13. namespace igl
  14. {
  15. /// Return list of faces around the end point of an edge. Assumes
  16. /// data-structures are built from an edge-manifold **closed** mesh.
  17. ///
  18. /// @param[in] e index into E of edge to circulate
  19. /// @param[in] ccw whether to _continue_ in ccw direction of edge (circulate around
  20. /// E(e,1))
  21. /// @param[in] EMAP #F*3 list of indices into E, mapping each directed edge to unique
  22. /// unique edge in E
  23. /// @param[in] EF #E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of
  24. /// F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) "
  25. /// e=(j->i)
  26. /// @param[in] EI #E by 2 list of edge flap corners (see above).
  27. /// @return list of faces touched by circulation (in cyclically order).
  28. ///
  29. /// \see edge_flaps
  30. template <typename DerivedEMAP, typename DerivedEF, typename DerivedEI>
  31. IGL_INLINE std::vector<int> circulation(
  32. const int e,
  33. const bool ccw,
  34. const Eigen::MatrixBase<DerivedEMAP> & EMAP,
  35. const Eigen::MatrixBase<DerivedEF> & EF,
  36. const Eigen::MatrixBase<DerivedEI> & EI);
  37. /// Return list of faces around the end point of an edge. Assumes
  38. /// data-structures are built from an edge-manifold **closed** mesh.
  39. ///
  40. /// @param[in] e index into E of edge to circulate
  41. /// @param[in] ccw whether to _continue_ in ccw direction of edge (circulate around
  42. /// E(e,1))
  43. /// @param[in] EMAP #F*3 list of indices into E, mapping each directed edge to unique
  44. /// unique edge in E
  45. /// @param[in] EF #E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of
  46. /// F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) "
  47. /// e=(j->i)
  48. /// @param[in] EI #E by 2 list of edge flap corners (see above).
  49. /// @param[out] #vN list of of faces touched by circulation (in cyclically order).
  50. ///
  51. /// \see edge_flaps
  52. template <typename DerivedEMAP, typename DerivedEF, typename DerivedEI, typename DerivedvN>
  53. IGL_INLINE void circulation(
  54. const int e,
  55. const bool ccw,
  56. const Eigen::MatrixBase<DerivedEMAP> & EMAP,
  57. const Eigen::MatrixBase<DerivedEF> & EF,
  58. const Eigen::MatrixBase<DerivedEI> & EI,
  59. Eigen::PlainObjectBase<DerivedvN> & vN);
  60. /// Return list of faces around the end point of an edge. Assumes
  61. /// data-structures are built from an edge-manifold **closed** mesh.
  62. ///
  63. /// @param[in] e index into E of edge to circulate
  64. /// @param[in] ccw whether to _continue_ in ccw direction of edge (circulate around
  65. /// E(e,1))
  66. /// @param[in] EMAP #F*3 list of indices into E, mapping each directed edge to unique
  67. /// unique edge in E
  68. /// @param[in] EF #E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of
  69. /// F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) "
  70. /// e=(j->i)
  71. /// @param[in] EI #E by 2 list of edge flap corners (see above).
  72. /// @param[out] Nv #Nv list of "next" vertex indices
  73. /// @param[out] Nf #Nf list of face indices
  74. ///
  75. /// \see edge_flaps
  76. template <typename DerivedF, typename DerivedEMAP, typename DerivedEF, typename DerivedEI, typename Nv_type>
  77. IGL_INLINE void circulation(
  78. const int e,
  79. const bool ccw,
  80. const Eigen::MatrixBase<DerivedF> & F,
  81. const Eigen::MatrixBase<DerivedEMAP> & EMAP,
  82. const Eigen::MatrixBase<DerivedEF> & EF,
  83. const Eigen::MatrixBase<DerivedEI> & EI,
  84. /*std::vector<int> & Ne,*/
  85. std::vector<Nv_type> & Nv,
  86. std::vector<Nv_type> & Nf);
  87. }
  88. #ifndef IGL_STATIC_LIBRARY
  89. # include "circulation.cpp"
  90. #endif
  91. #endif