delaunay_triangulation.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 Qingan Zhou <qnzhou@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_DELAUNAY_TRIANGULATION_H
  9. #define IGL_DELAUNAY_TRIANGULATION_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // Given a set of points in 2D, return a Delaunay triangulation of these
  15. // points.
  16. //
  17. // Inputs:
  18. // V #V by 2 list of vertex positions
  19. // orient2D A functor such that orient2D(pa, pb, pc) returns
  20. // 1 if pa,pb,pc forms a conterclockwise triangle.
  21. // -1 if pa,pb,pc forms a clockwise triangle.
  22. // 0 if pa,pb,pc are collinear.
  23. // where the argument pa,pb,pc are of type Scalar[2].
  24. // incircle A functor such that incircle(pa, pb, pc, pd) returns
  25. // 1 if pd is on the positive size of circumcirle of (pa,pb,pc)
  26. // -1 if pd is on the positive size of circumcirle of (pa,pb,pc)
  27. // 0 if pd is cocircular with pa, pb, pc.
  28. // Outputs:
  29. // F #F by 3 of faces in Delaunay triangulation.
  30. template<
  31. typename DerivedV,
  32. typename Orient2D,
  33. typename InCircle,
  34. typename DerivedF
  35. >
  36. IGL_INLINE void delaunay_triangulation(
  37. const Eigen::MatrixBase<DerivedV>& V,
  38. Orient2D orient2D,
  39. InCircle incircle,
  40. Eigen::PlainObjectBase<DerivedF>& F);
  41. }
  42. #ifndef IGL_STATIC_LIBRARY
  43. # include "delaunay_triangulation.cpp"
  44. #endif
  45. #endif