fit_rotations.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  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. #ifndef IGL_FIT_ROTATIONS_H
  9. #define IGL_FIT_ROTATIONS_H
  10. #include <igl/igl_inline.h>
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // FIT_ROTATIONS Given an input mesh and new positions find rotations for
  15. // every covariance matrix in a stack of covariance matrices
  16. //
  17. // Inputs:
  18. // S nr*dim by dim stack of covariance matrices
  19. // Outputs:
  20. // R dim by dim * nr list of rotations
  21. //
  22. template <typename DerivedS, typename DerivedD>
  23. IGL_INLINE void fit_rotations(
  24. const Eigen::PlainObjectBase<DerivedS> & S,
  25. Eigen::PlainObjectBase<DerivedD> & R);
  26. // FIT_ROTATIONS Given an input mesh and new positions find 2D rotations for
  27. // every vertex that best maps its one ring to the new one ring
  28. //
  29. // Inputs:
  30. // S nr*dim by dim stack of covariance matrices, third column and every
  31. // third row will be ignored
  32. // Outputs:
  33. // R dim by dim * nr list of rotations, third row and third column of each
  34. // rotation will just be identity
  35. //
  36. template <typename DerivedS, typename DerivedD>
  37. IGL_INLINE void fit_rotations_planar(
  38. const Eigen::PlainObjectBase<DerivedS> & S,
  39. Eigen::PlainObjectBase<DerivedD> & R);
  40. #ifdef __SSE__
  41. IGL_INLINE void fit_rotations_SSE( const Eigen::MatrixXf & S, Eigen::MatrixXf & R);
  42. IGL_INLINE void fit_rotations_SSE( const Eigen::MatrixXd & S, Eigen::MatrixXd & R);
  43. #endif
  44. #ifdef __AVX__
  45. IGL_INLINE void fit_rotations_AVX( const Eigen::MatrixXf & S, Eigen::MatrixXf & R);
  46. #endif
  47. }
  48. #ifdef IGL_HEADER_ONLY
  49. # include "fit_rotations.cpp"
  50. #endif
  51. #endif