flip_edge.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 Qingan Zhou <[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_FLIP_EDGE_H
  9. #define IGL_FLIP_EDGE_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. #include <vector>
  13. namespace igl
  14. {
  15. /// Flip an edge in a triangle mesh. The edge specified by uei must have
  16. /// exactly **two** adjacent faces. Violation will result in exception.
  17. /// Another warning: edge flipping could convert manifold mesh into
  18. /// non-manifold.
  19. ///
  20. /// @param[in,out] F #F by 3 list of triangles.
  21. /// @param[in,out] E #F*3 by 2 list of all of directed edges
  22. /// @param[in,out] uE #uE by 2 list of unique undirected edges
  23. /// @param[in,out] EMAP #F*3 list of indices into uE, mapping each directed edge to unique
  24. /// undirected edge
  25. /// @param[in,out] uE2E #uE list of lists of indices into E of coexisting edges
  26. /// @param[in] ue index into uE the edge to be flipped.
  27. template <
  28. typename DerivedF,
  29. typename DerivedE,
  30. typename DeriveduE,
  31. typename DerivedEMAP,
  32. typename uE2EType>
  33. IGL_INLINE void flip_edge(
  34. Eigen::PlainObjectBase<DerivedF> & F,
  35. Eigen::PlainObjectBase<DerivedE> & E,
  36. Eigen::PlainObjectBase<DeriveduE> & uE,
  37. Eigen::PlainObjectBase<DerivedEMAP> & EMAP,
  38. std::vector<std::vector<uE2EType> > & uE2E,
  39. const size_t uei);
  40. }
  41. #ifndef IGL_STATIC_LIBRARY
  42. # include "flip_edge.cpp"
  43. #endif
  44. #endif