fit_rotations.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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_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. // single_precision whether to use single precision (faster)
  20. // Outputs:
  21. // R dim by dim * nr list of rotations
  22. //
  23. template <typename DerivedS, typename DerivedD>
  24. IGL_INLINE void fit_rotations(
  25. const Eigen::PlainObjectBase<DerivedS> & S,
  26. const bool single_precision,
  27. Eigen::PlainObjectBase<DerivedD> & R);
  28. // FIT_ROTATIONS Given an input mesh and new positions find 2D rotations for
  29. // every vertex that best maps its one ring to the new one ring
  30. //
  31. // Inputs:
  32. // S nr*dim by dim stack of covariance matrices, third column and every
  33. // third row will be ignored
  34. // Outputs:
  35. // R dim by dim * nr list of rotations, third row and third column of each
  36. // rotation will just be identity
  37. //
  38. template <typename DerivedS, typename DerivedD>
  39. IGL_INLINE void fit_rotations_planar(
  40. const Eigen::PlainObjectBase<DerivedS> & S,
  41. Eigen::PlainObjectBase<DerivedD> & R);
  42. #ifdef __SSE__
  43. IGL_INLINE void fit_rotations_SSE( const Eigen::MatrixXf & S, Eigen::MatrixXf & R);
  44. IGL_INLINE void fit_rotations_SSE( const Eigen::MatrixXd & S, Eigen::MatrixXd & R);
  45. #endif
  46. #ifdef __AVX__
  47. IGL_INLINE void fit_rotations_AVX( const Eigen::MatrixXf & S, Eigen::MatrixXf & R);
  48. #endif
  49. }
  50. #ifndef IGL_STATIC_LIBRARY
  51. # include "fit_rotations.cpp"
  52. #endif
  53. #endif