tet_tet_adjacency.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2018 Oded Stein <oded.stein@columbia.edu>
  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_TET_TET_ADJACENCY_H
  9. #define IGL_TET_TET_ADJACENCY_H
  10. #include <Eigen/Core>
  11. #include <igl/igl_inline.h>
  12. namespace igl
  13. {
  14. // Constructs the tet_tet adjacency matrix for a given tet mesh with tets T
  15. //
  16. // Inputs:
  17. // T #T by 4 list of tets
  18. // Outputs:
  19. // TT #T by #4 adjacency matrix, the element i,j is the id of the tet
  20. // adjacent to the j face of tet i
  21. // TTi #T by #4 adjacency matrix, the element i,j is the id of face of
  22. // the tet TT(i,j) that is adjacent to tet i
  23. //
  24. // NOTE: the first face of a tet is [0,1,2], the second [0,1,3], the third
  25. // [1,2,3], and the fourth [2,0,3].
  26. template <typename DerivedT, typename DerivedTT, typename DerivedTTi>
  27. IGL_INLINE void tet_tet_adjacency(
  28. const Eigen::MatrixBase<DerivedT>& T,
  29. Eigen::PlainObjectBase<DerivedTT>& TT,
  30. Eigen::PlainObjectBase<DerivedTTi>& TTi);
  31. template <typename DerivedT, typename DerivedTT>
  32. IGL_INLINE void tet_tet_adjacency(
  33. const Eigen::MatrixBase<DerivedT>& T,
  34. Eigen::PlainObjectBase<DerivedTT>& TT);
  35. }
  36. #ifndef IGL_STATIC_LIBRARY
  37. # include "tet_tet_adjacency.cpp"
  38. #endif
  39. #endif