edge_collapse_is_valid.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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_EDGE_COLLAPSE_IS_VALID_H
  9. #define IGL_EDGE_COLLAPSE_IS_VALID_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // Assumes (V,F) is a closed manifold mesh (except for previouslly collapsed
  15. // faces which should be set to:
  16. // [IGL_COLLAPSE_EDGE_NULL IGL_COLLAPSE_EDGE_NULL IGL_COLLAPSE_EDGE_NULL].
  17. // Tests whether collapsing exactly two faces and exactly 3 edges from E (e
  18. // and one side of each face gets collapsed to the other) will result in a
  19. // mesh with the same topology.
  20. //
  21. // Inputs:
  22. // e index into E of edge to try to collapse. E(e,:) = [s d] or [d s] so
  23. // that s<d, then d is collapsed to s.
  24. // F #F by 3 list of face indices into V.
  25. // E #E by 2 list of edge indices into V.
  26. // EMAP #F*3 list of indices into E, mapping each directed edge to unique
  27. // unique edge in E
  28. // EF #E by 2 list of edge flaps, EF(e,0)=f means e=(i-->j) is the edge of
  29. // F(f,:) opposite the vth corner, where EI(e,0)=v. Similarly EF(e,1) "
  30. // e=(j->i)
  31. // EI #E by 2 list of edge flap corners (see above).
  32. // Returns true if edge collapse is valid
  33. IGL_INLINE bool edge_collapse_is_valid(
  34. const int e,
  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. }
  41. #ifndef IGL_STATIC_LIBRARY
  42. # include "edge_collapse_is_valid.cpp"
  43. #endif
  44. #endif