projected_delaunay.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 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_COPYLEFT_CGAL_PROJECTED_DELAUNAY_H
  9. #define IGL_COPYLEFT_CGAL_PROJECTED_DELAUNAY_H
  10. #include "../../igl_inline.h"
  11. #include "CGAL_includes.hpp"
  12. namespace igl
  13. {
  14. namespace copyleft
  15. {
  16. namespace cgal
  17. {
  18. // Compute 2D delaunay triangulation of a given 3d triangle and a list of
  19. // intersection objects (points,segments,triangles). CGAL uses an affine
  20. // projection rather than an isometric projection, so we're not guaranteed
  21. // that the 2D delaunay triangulation here will be a delaunay triangulation
  22. // in 3D.
  23. //
  24. // Inputs:
  25. // A triangle in 3D
  26. // A_objects_3 updated list of intersection objects for A
  27. // Outputs:
  28. // cdt Contrained delaunay triangulation in projected 2D plane
  29. template <typename Kernel>
  30. IGL_INLINE void projected_delaunay(
  31. const CGAL::Triangle_3<Kernel> & A,
  32. const std::vector<CGAL::Object> & A_objects_3,
  33. CGAL::Constrained_triangulation_plus_2<
  34. CGAL::Constrained_Delaunay_triangulation_2<
  35. Kernel,
  36. CGAL::Triangulation_data_structure_2<
  37. CGAL::Triangulation_vertex_base_2<Kernel>,
  38. CGAL::Constrained_triangulation_face_base_2<Kernel> >,
  39. CGAL::Exact_intersections_tag> > & cdt);
  40. }
  41. }
  42. }
  43. #ifndef IGL_STATIC_LIBRARY
  44. # include "projected_delaunay.cpp"
  45. #endif
  46. #endif