circulation.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. IGL_INLINE std::vector<int> circulation(
  31. const int e,
  32. const bool ccw,
  33. const Eigen::VectorXi & EMAP,
  34. const Eigen::MatrixXi & EF,
  35. const Eigen::MatrixXi & EI);
  36. /// Return list of faces around the end point of an edge. Assumes
  37. /// data-structures are built from an edge-manifold **closed** mesh.
  38. ///
  39. /// @param[in] e index into E of edge to circulate
  40. /// @param[in] ccw whether to _continue_ in ccw direction of edge (circulate around
  41. /// E(e,1))
  42. /// @param[in] EMAP #F*3 list of indices into E, mapping each directed edge to unique
  43. /// unique edge in E
  44. /// @param[in] EF #E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of
  45. /// F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) "
  46. /// e=(j->i)
  47. /// @param[in] EI #E by 2 list of edge flap corners (see above).
  48. /// @param[out] #vN list of of faces touched by circulation (in cyclically order).
  49. ///
  50. /// \see edge_flaps
  51. IGL_INLINE void circulation(
  52. const int e,
  53. const bool ccw,
  54. const Eigen::VectorXi & EMAP,
  55. const Eigen::MatrixXi & EF,
  56. const Eigen::MatrixXi & EI,
  57. Eigen::VectorXi & vN);
  58. /// Return list of faces around the end point of an edge. Assumes
  59. /// data-structures are built from an edge-manifold **closed** mesh.
  60. ///
  61. /// @param[in] e index into E of edge to circulate
  62. /// @param[in] ccw whether to _continue_ in ccw direction of edge (circulate around
  63. /// E(e,1))
  64. /// @param[in] EMAP #F*3 list of indices into E, mapping each directed edge to unique
  65. /// unique edge in E
  66. /// @param[in] EF #E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of
  67. /// F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) "
  68. /// e=(j->i)
  69. /// @param[in] EI #E by 2 list of edge flap corners (see above).
  70. /// @param[out] Nv #Nv list of "next" vertex indices
  71. /// @param[out] Nf #Nf list of face indices
  72. ///
  73. /// \see edge_flaps
  74. IGL_INLINE void circulation(
  75. const int e,
  76. const bool ccw,
  77. const Eigen::MatrixXi & F,
  78. const Eigen::VectorXi & EMAP,
  79. const Eigen::MatrixXi & EF,
  80. const Eigen::MatrixXi & EI,
  81. /*std::vector<int> & Ne,*/
  82. std::vector<int> & Nv,
  83. std::vector<int> & Nf);
  84. }
  85. #ifndef IGL_STATIC_LIBRARY
  86. # include "circulation.cpp"
  87. #endif
  88. #endif