isolines.cpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2023 Alec Jacobson <[email protected]>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #include "isolines.h"
  9. #include "isolines_intrinsic.h"
  10. template <
  11. typename DerivedV,
  12. typename DerivedF,
  13. typename DerivedS,
  14. typename Derivedvals,
  15. typename DerivediV,
  16. typename DerivediE,
  17. typename DerivedI>
  18. void igl::isolines(
  19. const Eigen::MatrixBase<DerivedV> & V,
  20. const Eigen::MatrixBase<DerivedF> & F,
  21. const Eigen::MatrixBase<DerivedS> & S,
  22. const Eigen::MatrixBase<Derivedvals> & vals,
  23. Eigen::PlainObjectBase<DerivediV> & iV,
  24. Eigen::PlainObjectBase<DerivediE> & iE,
  25. Eigen::PlainObjectBase<DerivedI> & I)
  26. {
  27. using Scalar = typename DerivedS::Scalar;
  28. using Index = typename DerivedF::Scalar;
  29. using MatrixXS = Eigen::Matrix<Scalar,Eigen::Dynamic,Eigen::Dynamic>;
  30. MatrixXS iB;
  31. Eigen::Vector<Index,Eigen::Dynamic> iFI;
  32. isolines_intrinsic(F,S,vals,iB,iFI,iE,I);
  33. iV.resize(iB.rows(),V.cols());
  34. for(int i = 0;i<iB.rows();i++)
  35. {
  36. iV.row(i) =
  37. iB(i,0)*V.row(F(iFI(i),0))+
  38. iB(i,1)*V.row(F(iFI(i),1))+
  39. iB(i,2)*V.row(F(iFI(i),2));
  40. }
  41. }
  42. #ifdef IGL_STATIC_LIBRARY
  43. // Explicit template instantiation
  44. // generated by autoexplicit.sh
  45. template void igl::isolines<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
  46. #endif