is_intrinsic_delaunay.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2018 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_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. // IS_INTRINSIC_DELAUNAY Determine if each edge in the mesh (V,F) is Delaunay.
  16. //
  17. // Inputs:
  18. // l #l by dim list of edge lengths
  19. // F #F by 3 list of triangles indices
  20. // Outputs:
  21. // D #F by 3 list of bools revealing whether edges corresponding 23 31 12
  22. // are locally Delaunay. Boundary edges are by definition Delaunay.
  23. // Non-Manifold edges are by definition not Delaunay.
  24. template <
  25. typename Derivedl,
  26. typename DerivedF,
  27. typename DerivedD>
  28. IGL_INLINE void is_intrinsic_delaunay(
  29. const Eigen::MatrixBase<Derivedl> & l,
  30. const Eigen::MatrixBase<DerivedF> & F,
  31. Eigen::PlainObjectBase<DerivedD> & D);
  32. // Inputs:
  33. // uE2E #uE list of lists mapping unique edges to (half-)edges
  34. template <
  35. typename Derivedl,
  36. typename DerivedF,
  37. typename uE2EType,
  38. typename DerivedD>
  39. IGL_INLINE void is_intrinsic_delaunay(
  40. const Eigen::MatrixBase<Derivedl> & l,
  41. const Eigen::MatrixBase<DerivedF> & F,
  42. const std::vector<std::vector<uE2EType> > & uE2E,
  43. Eigen::PlainObjectBase<DerivedD> & D);
  44. // Determine whether a single edge is Delaunay using a provided (extrinsic) incirle
  45. // test.
  46. //
  47. // Inputs:
  48. // l #l by dim list of edge lengths
  49. // uE2E #uE list of lists of indices into E of coexisting edges (see
  50. // unique_edge_map)
  51. // num_faces number of faces (==#F)
  52. // uei index into uE2E of edge to check
  53. // Returns true iff edge is Delaunay
  54. template <
  55. typename Derivedl,
  56. typename uE2EType,
  57. typename Index>
  58. IGL_INLINE bool is_intrinsic_delaunay(
  59. const Eigen::MatrixBase<Derivedl> & l,
  60. const std::vector<std::vector<uE2EType> > & uE2E,
  61. const Index num_faces,
  62. const Index uei);
  63. }
  64. #ifndef IGL_STATIC_LIBRARY
  65. #include "is_intrinsic_delaunay.cpp"
  66. #endif
  67. #endif