isolines_intrinsic.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. #ifndef IGL_ISOLINES_INTRINSIC_H
  9. #define IGL_ISOLINES_INTRINSIC_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. /// Compute isolines of a scalar field on a triangle mesh intrinsically.
  15. ///
  16. /// See isolines.h for details.
  17. ///
  18. /// @param[in] F #F by 3 list of mesh triangle indices into some V
  19. /// @param[in] S #S by 1 list of per-vertex scalar values
  20. /// @param[in] vals #vals by 1 list of values to compute isolines for
  21. /// @param[out] iB #iB by 3 list of barycentric coordinates so that
  22. /// iV.row(i) = iB(i,0)*V.row(F(iFI(i,0)) +
  23. /// iB(i,1)*V.row(F(iFI(i,1)) +
  24. /// iB(i,2)*V.row(F(iFI(i,2))
  25. /// @param[out] iF #iB list of triangle indices for each row of iB (all
  26. /// points will either lie on an edge or vertex: an arbitrary incident face
  27. /// will be given).
  28. /// @param[out] iE #iE by 2 list of edge indices into iB
  29. /// @param[out] I #iE by 1 list of indices into vals indicating which value
  30. /// each segment belongs to
  31. ///
  32. /// \see isolines, edge_crossings
  33. template <
  34. typename DerivedF,
  35. typename DerivedS,
  36. typename Derivedvals,
  37. typename DerivediB,
  38. typename DerivediFI,
  39. typename DerivediE,
  40. typename DerivedI>
  41. void isolines_intrinsic(
  42. const Eigen::MatrixBase<DerivedF> & F,
  43. const Eigen::MatrixBase<DerivedS> & S,
  44. const Eigen::MatrixBase<Derivedvals> & vals,
  45. Eigen::PlainObjectBase<DerivediB> & iB,
  46. Eigen::PlainObjectBase<DerivediFI> & iFI,
  47. Eigen::PlainObjectBase<DerivediE> & iE,
  48. Eigen::PlainObjectBase<DerivedI> & I);
  49. /// \overload
  50. ///
  51. /// @param[in] val scalar value to compute isoline at
  52. /// @param[in] uE #uE by 2 list of unique undirected edges
  53. /// @param[in] EMAP #F*3 list of indices into uE, mapping each directed edge to unique
  54. /// undirected edge so that uE(EMAP(f+#F*c)) is the unique edge
  55. /// corresponding to E.row(f+#F*c)
  56. /// @param[in] uEC #uE+1 list of cumulative counts of directed edges sharing each
  57. /// unique edge so the uEC(i+1)-uEC(i) is the number of directed edges
  58. /// sharing the ith unique edge.
  59. /// @param[in] uEE #E list of indices into E, so that the consecutive segment of
  60. /// indices uEE.segment(uEC(i),uEC(i+1)-uEC(i)) lists all directed edges
  61. /// sharing the ith unique edge.
  62. ///
  63. /// \see unique_edge_map
  64. template <
  65. typename DerivedF,
  66. typename DerivedS,
  67. typename DeriveduE,
  68. typename DerivedEMAP,
  69. typename DeriveduEC,
  70. typename DeriveduEE,
  71. typename DerivediB,
  72. typename DerivediFI,
  73. typename DerivediE>
  74. void isolines_intrinsic(
  75. const Eigen::MatrixBase<DerivedF> & F,
  76. const Eigen::MatrixBase<DerivedS> & S,
  77. const Eigen::MatrixBase<DeriveduE> & uE,
  78. const Eigen::MatrixBase<DerivedEMAP> & EMAP,
  79. const Eigen::MatrixBase<DeriveduEC> & uEC,
  80. const Eigen::MatrixBase<DeriveduEE> & uEE,
  81. const typename DerivedS::Scalar val,
  82. Eigen::PlainObjectBase<DerivediB> & iB,
  83. Eigen::PlainObjectBase<DerivediFI> & iFI,
  84. Eigen::PlainObjectBase<DerivediE> & iE);
  85. }
  86. #ifndef IGL_STATIC_LIBRARY
  87. # include "isolines_intrinsic.cpp"
  88. #endif
  89. #endif