directed_edge_orientations.cpp 961 B

12345678910111213141516171819202122
  1. #include "directed_edge_orientations.h"
  2. template <typename DerivedC, typename DerivedE>
  3. IGL_INLINE void igl::directed_edge_orientations(
  4. const Eigen::PlainObjectBase<DerivedC> & C,
  5. const Eigen::PlainObjectBase<DerivedE> & E,
  6. std::vector<
  7. Eigen::Quaterniond,Eigen::aligned_allocator<Eigen::Quaterniond> > & Q)
  8. {
  9. using namespace Eigen;
  10. Q.resize(E.rows());
  11. for(int e = 0;e<E.rows();e++)
  12. {
  13. const auto & b = C.row(E(e,1)) - C.row(E(e,0));
  14. Q[e].setFromTwoVectors( RowVector3d(1,0,0),b);
  15. }
  16. }
  17. #ifdef IGL_STATIC_LIBRARY
  18. // Explicit template instanciation
  19. template void igl::directed_edge_orientations<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, std::vector<Eigen::Quaternion<double, 0>, Eigen::aligned_allocator<Eigen::Quaternion<double, 0> > >&);
  20. #endif