// 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 "all_edges.h" template IGL_INLINE void igl::all_edges( const Eigen::PlainObjectBase & F, Eigen::PlainObjectBase & E) { E.resize(F.rows()*F.cols(),F.cols()-1); switch(F.cols()) { case 4: E.block(0*F.rows(),0,F.rows(),1) = F.col(1); E.block(0*F.rows(),1,F.rows(),1) = F.col(3); E.block(0*F.rows(),2,F.rows(),1) = F.col(2); E.block(1*F.rows(),0,F.rows(),1) = F.col(0); E.block(1*F.rows(),1,F.rows(),1) = F.col(2); E.block(1*F.rows(),2,F.rows(),1) = F.col(3); E.block(2*F.rows(),0,F.rows(),1) = F.col(0); E.block(2*F.rows(),1,F.rows(),1) = F.col(3); E.block(2*F.rows(),2,F.rows(),1) = F.col(1); E.block(3*F.rows(),0,F.rows(),1) = F.col(0); E.block(3*F.rows(),1,F.rows(),1) = F.col(1); E.block(3*F.rows(),2,F.rows(),1) = F.col(2); return; case 3: E.block(0*F.rows(),0,F.rows(),1) = F.col(1); E.block(0*F.rows(),1,F.rows(),1) = F.col(2); E.block(1*F.rows(),0,F.rows(),1) = F.col(2); E.block(1*F.rows(),1,F.rows(),1) = F.col(0); E.block(2*F.rows(),0,F.rows(),1) = F.col(0); E.block(2*F.rows(),1,F.rows(),1) = F.col(1); return; } } #ifdef IGL_STATIC_LIBRARY // Explicit template specialization template void igl::all_edges, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); template void igl::all_edges, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); template void igl::all_edges, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); template void igl::all_edges, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); template void igl::all_edges, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase >&); #endif