lexicographic_triangulation.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 Alec Jacobson <alecjacobson@gmail.com>
  4. // Qingan Zhou <qnzhou@gmail.com>
  5. //
  6. // This Source Code Form is subject to the terms of the Mozilla Public License
  7. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  8. // obtain one at http://mozilla.org/MPL/2.0/.
  9. #ifndef IGL_LEXICOGRAPHIC_TRIANGULATION_H
  10. #define IGL_LEXICOGRAPHIC_TRIANGULATION_H
  11. #include "igl_inline.h"
  12. #include <Eigen/Core>
  13. namespace igl
  14. {
  15. // Given a set of points in 2D, return a lexicographic triangulation of these
  16. // points.
  17. //
  18. // Inputs:
  19. // P #P by 2 list of vertex positions
  20. // orient2D A functor such that orient2D(pa, pb, pc) returns
  21. // 1 if pa,pb,pc forms a conterclockwise triangle.
  22. // -1 if pa,pb,pc forms a clockwise triangle.
  23. // 0 if pa,pb,pc are collinear.
  24. // where the argument pa,pb,pc are of type Scalar[2].
  25. //
  26. // Outputs:
  27. // F #F by 3 of faces in lexicographic triangulation.
  28. template<
  29. typename DerivedP,
  30. typename Orient2D,
  31. typename DerivedF
  32. >
  33. IGL_INLINE void lexicographic_triangulation(
  34. const Eigen::PlainObjectBase<DerivedP>& P,
  35. Orient2D orient2D,
  36. Eigen::PlainObjectBase<DerivedF>& F);
  37. }
  38. #ifndef IGL_STATIC_LIBRARY
  39. # include "lexicographic_triangulation.cpp"
  40. #endif
  41. #endif