is_delaunay.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2018 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_IS_DELAUNAY_H
  9. #define IGL_IS_DELAUNAY_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. #include <vector>
  13. namespace igl
  14. {
  15. /// IDetermine if each edge in the mesh (V,F) is Delaunay.
  16. ///
  17. /// @param[in] V #V by dim list of vertex positions
  18. /// @param[in] F #F by 3 list of triangles indices
  19. /// @param[out] D #F by 3 list of bools revealing whether edges corresponding 23 31 12
  20. /// are locally Delaunay. Boundary edges are by definition Delaunay.
  21. /// Non-Manifold edges are by definition not Delaunay.
  22. template <
  23. typename DerivedV,
  24. typename DerivedF,
  25. typename DerivedD>
  26. IGL_INLINE void is_delaunay(
  27. const Eigen::MatrixBase<DerivedV> & V,
  28. const Eigen::MatrixBase<DerivedF> & F,
  29. Eigen::PlainObjectBase<DerivedD> & D);
  30. /// Determine whether a single edge is Delaunay using a provided (extrinsic) incirle
  31. /// test.
  32. ///
  33. /// @param[in] V #V by dim list of vertex positions
  34. /// @param[in] F #F by 3 list of triangles indices
  35. /// @param[in] uE2E #uE list of lists of indices into E of coexisting edges (see
  36. /// unique_edge_map)
  37. /// @param[in] incircle A functor such that incircle(pa, pb, pc, pd) returns
  38. /// 1 if pd is on the positive size of circumcirle of (pa,pb,pc)
  39. /// -1 if pd is on the positive size of circumcirle of (pa,pb,pc)
  40. /// 0 if pd is cocircular with pa, pb, pc.
  41. /// (see delaunay_triangulation)
  42. /// @param[in] uei index into uE2E of edge to check
  43. /// @return true iff edge is Delaunay
  44. template <
  45. typename DerivedV,
  46. typename DerivedF,
  47. typename uE2EType,
  48. typename InCircle,
  49. typename ueiType>
  50. IGL_INLINE bool is_delaunay(
  51. const Eigen::MatrixBase<DerivedV> & V,
  52. const Eigen::MatrixBase<DerivedF> & F,
  53. const std::vector<std::vector<uE2EType> > & uE2E,
  54. const InCircle incircle,
  55. const ueiType uei);
  56. }
  57. #ifndef IGL_STATIC_LIBRARY
  58. #include "is_delaunay.cpp"
  59. #endif
  60. #endif