// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2013 Alec Jacobson // // This Source Code Form is subject to the terms of the Mozilla Public License // v. 2.0. If a copy of the MPL was not distributed with this file, You can // obtain one at http://mozilla.org/MPL/2.0/. #include "upsample.h" #include "triangle_triangle_adjacency.h" template < typename DerivedV, typename DerivedF, typename DerivedNV, typename DerivedNF> IGL_INLINE void igl::upsample( const Eigen::PlainObjectBase& V, const Eigen::PlainObjectBase& F, Eigen::PlainObjectBase& NV, Eigen::PlainObjectBase& NF) { // Use "in place" wrapper instead assert(&V != &NV); assert(&F != &NF); using namespace std; using namespace Eigen; Eigen::Matrix< typename DerivedF::Scalar,Eigen::Dynamic,Eigen::Dynamic> FF,FFi; triangle_triangle_adjacency(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) Eigen::MatrixXi NI = Eigen::MatrixXi::Constant(FF.rows(),FF.cols(),-1); int counter = 0; 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); } #ifdef IGL_STATIC_LIBRARY // Explicit template specialization // generated by autoexplicit.sh template void igl::upsample, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); template void igl::upsample, Eigen::Matrix >(Eigen::Matrix&, Eigen::Matrix&); #endif