#include #include #include #include #include #include template IGL_INLINE void igl::polyvector_field_comb_from_matchings_and_cuts( const Eigen::PlainObjectBase &V, const Eigen::PlainObjectBase &F, const Eigen::PlainObjectBase &TT, const Eigen::MatrixXi &E2F, const Eigen::MatrixXi &F2E, const Eigen::PlainObjectBase &sol3D, const Eigen::PlainObjectBase &match_ab, const Eigen::PlainObjectBase &match_ba, const Eigen::PlainObjectBase &cuts, Eigen::PlainObjectBase &sol3D_combed) { int half_degree = sol3D.cols()/3; int full_degree = 2*half_degree; Eigen::MatrixXi used; used.setConstant(F.rows(),half_degree,-1); // Eigen::VectorXi mark; std::deque d; sol3D_combed.setZero(sol3D.rows(), sol3D.cols()); int start = 0; d.push_back(start); used.row(start) = igl::colon(0, half_degree-1); sol3D_combed.row(start) = sol3D.row(start); while (!d.empty()) { int f0 = d.at(0); d.pop_front(); for (int k=0; k<3; k++) { int f1 = TT(f0,k); if (f1==-1) continue; //do not comb across cuts if ((used.row(f1).array()!=-1).any()||cuts(f0,k)) continue; // look at the edge between the two faces const int ¤t_edge = F2E(f0,k); // check its orientation to determine whether match_ab or match_ba should be used if ((E2F(current_edge,0) == f0) && (E2F(current_edge,1) == f1) ) { //look at match_ab for(int i=0; i=half_degree)*half_degree)%full_degree; } } else { assert((E2F(current_edge,1) == f0) && (E2F(current_edge,0) == f1)); //look at match_ba for(int i=0; i=half_degree)*half_degree)%full_degree; } } for (int i = 0; i=0).all()); } template IGL_INLINE void igl::polyvector_field_comb_from_matchings_and_cuts( const Eigen::PlainObjectBase &V, const Eigen::PlainObjectBase &F, const Eigen::PlainObjectBase &sol3D, const Eigen::PlainObjectBase &match_ab, const Eigen::PlainObjectBase &match_ba, const Eigen::PlainObjectBase &cuts, Eigen::PlainObjectBase &sol3D_combed) { Eigen::MatrixXi TT, TTi; igl::triangle_triangle_adjacency(F,TT,TTi); Eigen::MatrixXi E, E2F, F2E; igl::edge_topology(V,F,E,F2E,E2F); igl::polyvector_field_comb_from_matchings_and_cuts(V, F, TT, E2F, F2E, sol3D, match_ab, match_ba, cuts, sol3D_combed); } #ifdef IGL_STATIC_LIBRARY // Explicit template specialization template void igl::polyvector_field_comb_from_matchings_and_cuts, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::Matrix const&, Eigen::Matrix const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); template void igl::polyvector_field_comb_from_matchings_and_cuts, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); #endif