collapse_edge_would_create_intersections.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef IGL_COLLAPSE_EDGE_WOULD_CREATE_INTERSECTIONS_H
  2. #define IGL_COLLAPSE_EDGE_WOULD_CREATE_INTERSECTIONS_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. namespace igl
  6. {
  7. /// Determine if collapse the edge `e` would create new intersections.
  8. ///
  9. /// @param[in] e index into E of edge to try to collapse. E(e,:) = [s d] or [d s] so
  10. /// that s<d, then d is collapsed to s.
  11. /// @param[in] p dim list of vertex position where to place merged vertex
  12. /// [mesh inputs]
  13. /// @param[in,out] V #V by dim list of vertex positions, lesser index of E(e,:) will be set
  14. /// to midpoint of edge.
  15. /// @param[in,out] F #F by 3 list of face indices into V.
  16. /// @param[in,out] E #E by 2 list of edge indices into V.
  17. /// @param[in,out] EMAP #F*3 list of indices into E, mapping each directed edge to unique
  18. /// unique edge in E
  19. /// @param[in,out] EF #E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of
  20. /// F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) "
  21. /// e=(j->i)
  22. /// @param[in,out] EI #E by 2 list of edge flap corners (see above).
  23. /// [mesh inputs]
  24. /// @param[in] tree AABB tree whose leaves correspond to the current
  25. /// (non-null) faces in (V,F)
  26. ///
  27. /// \see collapse_edge
  28. template <typename DerivedV, int DIM> class AABB;
  29. template <
  30. typename Derivedp,
  31. typename DerivedV,
  32. typename DerivedF,
  33. typename DerivedE,
  34. typename DerivedEMAP,
  35. typename DerivedEF,
  36. typename DerivedEI>
  37. IGL_INLINE bool collapse_edge_would_create_intersections(
  38. const int e,
  39. const Eigen::MatrixBase<Derivedp> & p,
  40. const Eigen::MatrixBase<DerivedV> & V,
  41. const Eigen::MatrixBase<DerivedF> & F,
  42. const Eigen::MatrixBase<DerivedE> & E,
  43. const Eigen::MatrixBase<DerivedEMAP> & EMAP,
  44. const Eigen::MatrixBase<DerivedEF> & EF,
  45. const Eigen::MatrixBase<DerivedEI> & EI,
  46. const igl::AABB<DerivedV,3> & tree,
  47. const int inf_face_id = -1);
  48. }
  49. #ifndef IGL_STATIC_LIBRARY
  50. # include "collapse_edge_would_create_intersections.cpp"
  51. #endif
  52. #endif