tet_tet_adjacency.h 1.5 KB

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