extract_cells.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 Qingnan 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. //
  9. #ifndef IGL_COPYLEFT_CGAL_EXTRACT_CELLS_H
  10. #define IGL_COPYLEFT_CGAL_EXTRACT_CELLS_H
  11. #include "../../igl_inline.h"
  12. #include <Eigen/Core>
  13. #include <vector>
  14. namespace igl {
  15. namespace copyleft
  16. {
  17. namespace cgal
  18. {
  19. /// Extract connected 3D space partitioned by mesh (V, F).
  20. ///
  21. /// @param[in] V #V by 3 array of vertices.
  22. /// @param[in] F #F by 3 array of faces.
  23. /// @param[in] P #F list of patch indices.
  24. /// @param[in] uE #uE by 2 list of vertex_indices, represents undirected edges.
  25. /// @param[in] EMAP #F*3 list of indices into uE.
  26. /// @param[in] uEC #uE+1 list of cumsums of directed edges sharing each unique edge
  27. /// @param[in] uEE #E list of indices into E (see `igl::unique_edge_map`)
  28. /// @param[out] cells #F by 2 array of cell indices. cells(i,0) represents the
  29. /// cell index on the positive side of face i, and cells(i,1)
  30. /// represents cell index of the negqtive side.
  31. /// By convension cell with index 0 is the infinite cell.
  32. /// @return the number of cells
  33. template<
  34. typename DerivedV,
  35. typename DerivedF,
  36. typename DerivedP,
  37. typename DeriveduE,
  38. typename DerivedEMAP,
  39. typename DeriveduEC,
  40. typename DeriveduEE,
  41. typename DerivedC >
  42. IGL_INLINE size_t extract_cells(
  43. const Eigen::MatrixBase<DerivedV>& V,
  44. const Eigen::MatrixBase<DerivedF>& F,
  45. const Eigen::MatrixBase<DerivedP>& P,
  46. const Eigen::MatrixBase<DeriveduE>& uE,
  47. const Eigen::MatrixBase<DerivedEMAP>& EMAP,
  48. const Eigen::MatrixBase<DeriveduEC>& uEC,
  49. const Eigen::MatrixBase<DeriveduEE>& uEE,
  50. Eigen::PlainObjectBase<DerivedC>& cells);
  51. /// \overload
  52. template<
  53. typename DerivedV,
  54. typename DerivedF,
  55. typename DerivedC >
  56. IGL_INLINE size_t extract_cells(
  57. const Eigen::MatrixBase<DerivedV>& V,
  58. const Eigen::MatrixBase<DerivedF>& F,
  59. Eigen::PlainObjectBase<DerivedC>& cells);
  60. }
  61. }
  62. }
  63. #ifndef IGL_STATIC_LIBRARY
  64. # include "extract_cells.cpp"
  65. #endif
  66. #endif