is_intrinsic_delaunay.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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_INTRINSIC_DELAUNAY_H
  9. #define IGL_IS_INTRINSIC_DELAUNAY_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. #include <vector>
  13. namespace igl
  14. {
  15. /// Determine if each edge in the mesh (V,F) is Delaunay.
  16. ///
  17. /// @param[in] l #l by dim list of edge lengths
  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 Derivedl,
  24. typename DerivedF,
  25. typename DerivedD>
  26. IGL_INLINE void is_intrinsic_delaunay(
  27. const Eigen::MatrixBase<Derivedl> & l,
  28. const Eigen::MatrixBase<DerivedF> & F,
  29. Eigen::PlainObjectBase<DerivedD> & D);
  30. /// \overload
  31. /// @param[in] uE2E #uE list of lists mapping unique edges to (half-)edges
  32. template <
  33. typename Derivedl,
  34. typename DerivedF,
  35. typename uE2EType,
  36. typename DerivedD>
  37. IGL_INLINE void is_intrinsic_delaunay(
  38. const Eigen::MatrixBase<Derivedl> & l,
  39. const Eigen::MatrixBase<DerivedF> & F,
  40. const std::vector<std::vector<uE2EType> > & uE2E,
  41. Eigen::PlainObjectBase<DerivedD> & D);
  42. /// Determine whether a single edge is Delaunay using a provided (extrinsic) incirle
  43. /// test.
  44. ///
  45. /// @param[in] l #l by dim list of edge lengths
  46. /// @param[in] uE2E #uE list of lists of indices into E of coexisting edges (see
  47. /// unique_edge_map)
  48. /// @param[in] num_faces number of faces (==#F)
  49. /// @param[in] uei index into uE2E of edge to check
  50. /// @return true iff edge is Delaunay
  51. template <
  52. typename Derivedl,
  53. typename uE2EType,
  54. typename Index>
  55. IGL_INLINE bool is_intrinsic_delaunay(
  56. const Eigen::MatrixBase<Derivedl> & l,
  57. const std::vector<std::vector<uE2EType> > & uE2E,
  58. const Index num_faces,
  59. const Index uei);
  60. }
  61. #ifndef IGL_STATIC_LIBRARY
  62. #include "is_intrinsic_delaunay.cpp"
  63. #endif
  64. #endif