complex_to_mesh.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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_CGAL_COMPLEX_TO_MESH_H
  9. #define IGL_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 cgal
  16. {
  17. // Templates:
  18. // Tr CGAL triangulation type, e.g.
  19. // CGAL::Surface_mesh_default_triangulation_3
  20. // Inputs
  21. // c2t3 2-complex (surface) living in a 3d triangulation (e.g. result of
  22. // CGAL::make_surface_mesh)
  23. // Outputs:
  24. // V #V by 3 list of vertex positions
  25. // F #F by 3 list of triangle indices
  26. // Returns true iff conversion was successful, failure can ok if CGAL code
  27. // can't figure out ordering.
  28. //
  29. template <typename Tr, typename DerivedV, typename DerivedF>
  30. IGL_INLINE bool complex_to_mesh(
  31. const CGAL::Complex_2_in_triangulation_3<Tr> & c2t3,
  32. Eigen::PlainObjectBase<DerivedV> & V,
  33. Eigen::PlainObjectBase<DerivedF> & F);
  34. }
  35. }
  36. #ifndef IGL_STATIC_LIBRARY
  37. # include "complex_to_mesh.cpp"
  38. #endif
  39. #endif