complex_to_mesh.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 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_COMPLEX_TO_MESH_H
  9. #define IGL_COPYLEFT_CGAL_COMPLEX_TO_MESH_H
  10. #include "../../igl_inline.h"
  11. #include <Eigen/Dense>
  12. #include <CGAL/Complex_2_in_triangulation_3.h>
  13. namespace igl
  14. {
  15. namespace copyleft
  16. {
  17. namespace cgal
  18. {
  19. // Templates:
  20. // Tr CGAL triangulation type, e.g.
  21. // CGAL::Surface_mesh_default_triangulation_3
  22. // Inputs
  23. // c2t3 2-complex (surface) living in a 3d triangulation (e.g. result of
  24. // CGAL::make_surface_mesh)
  25. // Outputs:
  26. // V #V by 3 list of vertex positions
  27. // F #F by 3 list of triangle indices
  28. // Returns true iff conversion was successful, failure can ok if CGAL code
  29. // can't figure out ordering.
  30. //
  31. template <typename Tr, typename DerivedV, typename DerivedF>
  32. IGL_INLINE bool complex_to_mesh(
  33. const CGAL::Complex_2_in_triangulation_3<Tr> & c2t3,
  34. Eigen::PlainObjectBase<DerivedV> & V,
  35. Eigen::PlainObjectBase<DerivedF> & F);
  36. }
  37. }
  38. }
  39. #ifndef IGL_STATIC_LIBRARY
  40. # include "complex_to_mesh.cpp"
  41. #endif
  42. #endif