123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #include "all_edges.h"
- template <typename DerivedF, typename DerivedE>
- IGL_INLINE void igl::all_edges(
- const Eigen::PlainObjectBase<DerivedF> & F,
- Eigen::PlainObjectBase<DerivedE> & E)
- {
- E.resize(F.rows()*F.cols(),F.cols()-1);
- typedef typename DerivedE::Scalar EScalar;
- switch(F.cols())
- {
- case 4:
- E.block(0*F.rows(),0,F.rows(),1) = F.col(1).template cast<EScalar>();
- E.block(0*F.rows(),1,F.rows(),1) = F.col(3).template cast<EScalar>();
- E.block(0*F.rows(),2,F.rows(),1) = F.col(2).template cast<EScalar>();
- E.block(1*F.rows(),0,F.rows(),1) = F.col(0).template cast<EScalar>();
- E.block(1*F.rows(),1,F.rows(),1) = F.col(2).template cast<EScalar>();
- E.block(1*F.rows(),2,F.rows(),1) = F.col(3).template cast<EScalar>();
- E.block(2*F.rows(),0,F.rows(),1) = F.col(0).template cast<EScalar>();
- E.block(2*F.rows(),1,F.rows(),1) = F.col(3).template cast<EScalar>();
- E.block(2*F.rows(),2,F.rows(),1) = F.col(1).template cast<EScalar>();
- E.block(3*F.rows(),0,F.rows(),1) = F.col(0).template cast<EScalar>();
- E.block(3*F.rows(),1,F.rows(),1) = F.col(1).template cast<EScalar>();
- E.block(3*F.rows(),2,F.rows(),1) = F.col(2).template cast<EScalar>();
- return;
- case 3:
- E.block(0*F.rows(),0,F.rows(),1) = F.col(1).template cast<EScalar>();
- E.block(0*F.rows(),1,F.rows(),1) = F.col(2).template cast<EScalar>();
- E.block(1*F.rows(),0,F.rows(),1) = F.col(2).template cast<EScalar>();
- E.block(1*F.rows(),1,F.rows(),1) = F.col(0).template cast<EScalar>();
- E.block(2*F.rows(),0,F.rows(),1) = F.col(0).template cast<EScalar>();
- E.block(2*F.rows(),1,F.rows(),1) = F.col(1).template cast<EScalar>();
- return;
- }
- }
- #ifdef IGL_STATIC_LIBRARY
- template void igl::all_edges<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
- template void igl::all_edges<Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 2, 0, -1, 2> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> >&);
- template void igl::all_edges<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 2, 0, -1, 2> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> >&);
- template void igl::all_edges<Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
- template void igl::all_edges<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 2, 0, -1, 2> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> >&);
- #endif
|