#include "upsample.h" #include "tt.h" #include "adjacency_list.h" #include template IGL_INLINE void igl::upsample( const MatV & V, const MatF & F, MatV & NV, MatF & NF) { // Use "in place" wrapper instead assert(&V != &NV); assert(&F != &NF); using namespace igl; using namespace std; using namespace Eigen; MatF FF, FFi; tt(V,F,FF,FFi); // TODO: Cache optimization missing from here, it is a mess // Compute the number and positions of the vertices to insert (on edges) MatF NI = MatF::Constant(FF.rows(),FF.cols(),-1); int counter = 0; for(int i=0;i SUBD(V.rows()+n_even,V.rows()); SUBD.reserve(15 * (V.rows()+n_even)); // Preallocate NV and NF NV = MatV(V.rows()+n_even,V.cols()); NF = MatF(F.rows()*4,3); // Fill the odd vertices position NV.block(0,0,V.rows(),V.cols()) = V; // Fill the even vertices position for(int i=0;i IGL_INLINE void igl::upsample( MatV & V,MatF & F) { const MatV V_copy = V; const MatF F_copy = F; return upsample(V_copy,F_copy,V,F); } #ifndef IGL_HEADER_ONLY // Explicit template specialization template void igl::upsample, Eigen::Matrix >(Eigen::Matrix&, Eigen::Matrix&); #endif