conjugate_frame_fields.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Olga Diamanti <olga.diam@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_CONJUGATE_FRAME_FIELDS_H
  9. #define IGL_CONJUGATE_FRAME_FIELDS_H
  10. #include "igl_inline.h"
  11. #include "ConjugateFFSolverData.h"
  12. #include <Eigen/Core>
  13. #include <vector>
  14. namespace igl {
  15. //todo
  16. // TODO: isConstrained should become a list of indices for consistency with
  17. // n_polyvector
  18. /// Given 2 vectors centered on origin calculate the rotation matrix from first to the second
  19. // Inputs:
  20. // v0, v1 the two #3 by 1 vectors
  21. // normalized boolean, if false, then the vectors are normalized prior to the calculation
  22. // Output:
  23. // 3 by 3 rotation matrix that takes v0 to v1
  24. //
  25. template <typename DerivedV, typename DerivedF>
  26. class ConjugateFFSolverData;
  27. template <typename DerivedV, typename DerivedF, typename DerivedO>
  28. IGL_INLINE void conjugate_frame_fields(const Eigen::PlainObjectBase<DerivedV> &V,
  29. const Eigen::PlainObjectBase<DerivedF> &F,
  30. const Eigen::VectorXi &isConstrained,
  31. const Eigen::PlainObjectBase<DerivedO> &initialSolution,
  32. Eigen::PlainObjectBase<DerivedO> &output,
  33. int _maxIter = 50,
  34. const typename DerivedV::Scalar &_lambdaOrtho = .1,
  35. const typename DerivedV::Scalar &_lambdaInit = 100,
  36. const typename DerivedV::Scalar &_lambdaMultFactor = 1.01,
  37. bool _doHardConstraints = true);
  38. template <typename DerivedV, typename DerivedF, typename DerivedO>
  39. IGL_INLINE void conjugate_frame_fields(const ConjugateFFSolverData<DerivedV, DerivedF> &csdata,
  40. const Eigen::VectorXi &isConstrained,
  41. const Eigen::PlainObjectBase<DerivedO> &initialSolution,
  42. Eigen::PlainObjectBase<DerivedO> &output,
  43. int _maxIter = 50,
  44. const typename DerivedV::Scalar &_lambdaOrtho = .1,
  45. const typename DerivedV::Scalar &_lambdaInit = 100,
  46. const typename DerivedV::Scalar &_lambdaMultFactor = 1.01,
  47. bool _doHardConstraints = true,
  48. typename DerivedV::Scalar *lambdaOut = NULL);
  49. };
  50. #ifndef IGL_STATIC_LIBRARY
  51. #include "conjugate_frame_fields.cpp"
  52. #endif
  53. #endif