tt.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // IGL Lib - Simple C++ mesh library
  3. //
  4. // Copyright 2011, Daniele Panozzo. All rights reserved.
  5. #ifndef IGL_TT_H
  6. #define IGL_TT_H
  7. #include "igl_inline.h"
  8. #include <Eigen/Core>
  9. #include <vector>
  10. namespace igl
  11. {
  12. // Preprocessing
  13. template <typename DerivedV, typename DerivedF>
  14. IGL_INLINE void tt_preprocess(const Eigen::PlainObjectBase<DerivedV>& V,
  15. const Eigen::PlainObjectBase<DerivedF>& F,
  16. std::vector<std::vector<int> >& TTT);
  17. // Extract the face adjacencies
  18. template <typename DerivedF, typename DerivedTT>
  19. IGL_INLINE void tt_extractTT(const Eigen::PlainObjectBase<DerivedF>& F,
  20. std::vector<std::vector<int> >& TTT,
  21. Eigen::PlainObjectBase<DerivedTT>& TT);
  22. // Extract the face adjacencies indices (needed for fast traversal)
  23. template <typename DerivedF, typename DerivedTT>
  24. IGL_INLINE void tt_extractTTi(const Eigen::PlainObjectBase<DerivedF>& F,
  25. std::vector<std::vector<int> >& TTT,
  26. Eigen::PlainObjectBase<DerivedTT>& TTi);
  27. // Compute triangle-triangle adjacency
  28. template <typename DerivedV, typename DerivedF, typename DerivedTT>
  29. IGL_INLINE void tt(const Eigen::PlainObjectBase<DerivedV>& V,
  30. const Eigen::PlainObjectBase<DerivedF>& F,
  31. Eigen::PlainObjectBase<DerivedTT>& TT);
  32. // Compute triangle-triangle adjacency with indices
  33. template <typename DerivedV, typename DerivedF, typename DerivedTT>
  34. IGL_INLINE void tt(const Eigen::PlainObjectBase<DerivedV>& V,
  35. const Eigen::PlainObjectBase<DerivedF>& F,
  36. Eigen::PlainObjectBase<DerivedTT>& TT,
  37. Eigen::PlainObjectBase<DerivedTT>& TTi);
  38. }
  39. #ifdef IGL_HEADER_ONLY
  40. # include "tt.cpp"
  41. #endif
  42. #endif