#ifndef IGL_TT_H #define IGL_TT_H #include "igl_inline.h" #include #include namespace igl { // Constructs the triangle adjacency matrix for a given // mesh (V,F). // // Templates: // Scalar derived type of eigen matrix for V (e.g. derived from // MatirxXd) // Index derived type of eigen matrix for F (e.g. derived from // MatrixXi) // Inputs: // V #V by dim list of mesh vertex positions // F #F by simplex_size list of mesh faces (must be triangles) // Outputs: // TT #F by #3 adjacent matrix, the element i,j is the id of the triangle adjacent to the j edge of triangle i // TTi #F by #3 adjacent matrix, the element i,j is the id of edge of the triangle TT(i,j) that is adjacent with triangle i // NOTE: the first edge of a triangle is [0,1] the second [1,2] and the third [2,3]. // this convention is DIFFERENT from cotangent.h template IGL_INLINE void tt(const Eigen::PlainObjectBase& V, const Eigen::PlainObjectBase& F, Eigen::PlainObjectBase& TT); // Compute triangle-triangle adjacency with indices template IGL_INLINE void tt(const Eigen::PlainObjectBase& V, const Eigen::PlainObjectBase& F, Eigen::PlainObjectBase& TT, Eigen::PlainObjectBase& TTi); // Preprocessing template IGL_INLINE void tt_preprocess(const Eigen::PlainObjectBase& V, const Eigen::PlainObjectBase& F, std::vector >& TTT); // Extract the face adjacencies template IGL_INLINE void tt_extractTT(const Eigen::PlainObjectBase& F, std::vector >& TTT, Eigen::PlainObjectBase& TT); // Extract the face adjacencies indices (needed for fast traversal) template IGL_INLINE void tt_extractTTi(const Eigen::PlainObjectBase& F, std::vector >& TTT, Eigen::PlainObjectBase& TTi); } #ifdef IGL_HEADER_ONLY # include "tt.cpp" #endif #endif