circulation.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 Alec Jacobson <alecjacobson@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_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. // Inputs:
  19. // e index into E of edge to circulate
  20. // ccw whether to _continue_ in ccw direction of edge (circulate around
  21. // E(e,1))
  22. // F #F by 3 list of face indices
  23. // E #E by 2 list of edge indices
  24. // EMAP #F*3 list of indices into E, mapping each directed edge to unique
  25. // unique edge in E
  26. // EF #E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of
  27. // F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) "
  28. // e=(j->i)
  29. // EI #E by 2 list of edge flap corners (see above).
  30. // Returns list of faces touched by circulation.
  31. //
  32. IGL_INLINE std::vector<int> circulation(
  33. const int e,
  34. const bool ccw,
  35. const Eigen::MatrixXi & F,
  36. const Eigen::MatrixXi & E,
  37. const Eigen::VectorXi & EMAP,
  38. const Eigen::MatrixXi & EF,
  39. const Eigen::MatrixXi & EI);
  40. // Wrapper with VectorXi output.
  41. IGL_INLINE void circulation(
  42. const int e,
  43. const bool ccw,
  44. const Eigen::MatrixXi & F,
  45. const Eigen::MatrixXi & E,
  46. const Eigen::VectorXi & EMAP,
  47. const Eigen::MatrixXi & EF,
  48. const Eigen::MatrixXi & EI,
  49. Eigen::VectorXi & vN);
  50. }
  51. #ifndef IGL_STATIC_LIBRARY
  52. # include "circulation.cpp"
  53. #endif
  54. #endif