cell_adjacency.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 Qingnan Zhou <qnzhou@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. //
  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. // Inputs:
  23. // per_patch_cells #P by 2 list of cell labels on each side of each
  24. // patch. Cell labels are assumed to be continuous
  25. // from 0 to #C.
  26. // num_cells number of cells.
  27. //
  28. // Outputs:
  29. // adjacency_list #C array of list of adjcent cell informations. If
  30. // cell i and cell j are adjacent via patch x, where i
  31. // is on the positive side of x, and j is on the
  32. // negative side. Then,
  33. // adjacency_list[i] will contain the entry {j, false, x}
  34. // and
  35. // adjacency_list[j] will contain the entry {i, true, x}
  36. template < typename DerivedC >
  37. IGL_INLINE void cell_adjacency(
  38. const Eigen::PlainObjectBase<DerivedC>& per_patch_cells,
  39. const size_t num_cells,
  40. std::vector<std::set<std::tuple<typename DerivedC::Scalar, bool, size_t> > >&
  41. adjacency_list);
  42. }
  43. }
  44. }
  45. #ifndef IGL_STATIC_LIBRARY
  46. # include "cell_adjacency.cpp"
  47. #endif
  48. #endif