delaunay_triangulation.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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_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. /// @param[in] V #V by 2 list of vertex positions
  18. /// @param[in] orient2D A functor such that orient2D(pa, pb, pc) returns
  19. /// 1 if pa,pb,pc forms a conterclockwise triangle.
  20. /// -1 if pa,pb,pc forms a clockwise triangle.
  21. /// 0 if pa,pb,pc are collinear.
  22. /// where the argument pa,pb,pc are of type Scalar[2].
  23. /// @param[in] incircle A functor such that incircle(pa, pb, pc, pd) returns
  24. /// 1 if pd is on the positive size of circumcirle of (pa,pb,pc)
  25. /// -1 if pd is on the positive size of circumcirle of (pa,pb,pc)
  26. /// 0 if pd is cocircular with pa, pb, pc.
  27. /// @param[out] F #F by 3 of faces in Delaunay triangulation.
  28. template<
  29. typename DerivedV,
  30. typename Orient2D,
  31. typename InCircle,
  32. typename DerivedF
  33. >
  34. IGL_INLINE void delaunay_triangulation(
  35. const Eigen::MatrixBase<DerivedV>& V,
  36. Orient2D orient2D,
  37. InCircle incircle,
  38. Eigen::PlainObjectBase<DerivedF>& F);
  39. }
  40. #ifndef IGL_STATIC_LIBRARY
  41. # include "delaunay_triangulation.cpp"
  42. #endif
  43. #endif