cell_adjacency.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 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_CELL_ADJACENCY_H
  10. #define IGL_COPYLEFT_CGAL_CELL_ADJACENCY_H
  11. #include "../../igl_inline.h"
  12. #include <Eigen/Core>
  13. #include <set>
  14. #include <tuple>
  15. #include <vector>
  16. namespace igl
  17. {
  18. namespace copyleft
  19. {
  20. namespace cgal
  21. {
  22. /// Determine adjacency of cells
  23. ///
  24. /// @param[in] per_patch_cells #P by 2 list of cell labels on each side
  25. /// of each patch. Cell labels are assumed to be continuous from 0 to #C.
  26. /// @param[in] num_cells number of cells.
  27. /// @param[out] adjacency_list #C array of list of adjcent cell
  28. /// information. If cell i and cell j are adjacent via patch x, where i
  29. /// is on the positive side of x, and j is on the negative side. Then,
  30. /// adjacency_list[i] will contain the entry {j, false, x} and
  31. /// adjacency_list[j] will contain the entry {i, true, x}
  32. template < typename DerivedC >
  33. IGL_INLINE void cell_adjacency(
  34. const Eigen::MatrixBase<DerivedC>& per_patch_cells,
  35. const size_t num_cells,
  36. std::vector<std::set<std::tuple<typename DerivedC::Scalar, bool, size_t> > >&
  37. adjacency_list);
  38. }
  39. }
  40. }
  41. #ifndef IGL_STATIC_LIBRARY
  42. # include "cell_adjacency.cpp"
  43. #endif
  44. #endif