closest_facet.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 Qingnan Zhou <qnzhou@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. //
  9. #ifndef IGL_COPYLET_CGAL_CLOSEST_FACET_H
  10. #define IGL_COPYLET_CGAL_CLOSEST_FACET_H
  11. #include "../../igl_inline.h"
  12. #include <Eigen/Core>
  13. #include <vector>
  14. namespace igl
  15. {
  16. namespace copyleft
  17. {
  18. namespace cgal
  19. {
  20. // Determine the closest facet for each of the input points.
  21. //
  22. // Inputs:
  23. // V #V by 3 array of vertices.
  24. // F #F by 3 array of faces.
  25. // I #I list of triangle indices to consider.
  26. // P #P by 3 array of query points.
  27. //
  28. // Outputs:
  29. // R #P list of closest facet indices.
  30. // S #P list of bools indicating on which side of the closest facet
  31. // each query point lies.
  32. template<
  33. typename DerivedV,
  34. typename DerivedF,
  35. typename DerivedI,
  36. typename DerivedP,
  37. typename uE2EType,
  38. typename DerivedEMAP,
  39. typename DerivedR,
  40. typename DerivedS >
  41. IGL_INLINE void closest_facet(
  42. const Eigen::PlainObjectBase<DerivedV>& V,
  43. const Eigen::PlainObjectBase<DerivedF>& F,
  44. const Eigen::PlainObjectBase<DerivedI>& I,
  45. const Eigen::PlainObjectBase<DerivedP>& P,
  46. const std::vector<std::vector<uE2EType> >& uE2E,
  47. const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
  48. Eigen::PlainObjectBase<DerivedR>& R,
  49. Eigen::PlainObjectBase<DerivedS>& S);
  50. template<
  51. typename DerivedV,
  52. typename DerivedF,
  53. typename DerivedP,
  54. typename uE2EType,
  55. typename DerivedEMAP,
  56. typename DerivedR,
  57. typename DerivedS >
  58. IGL_INLINE void closest_facet(
  59. const Eigen::PlainObjectBase<DerivedV>& V,
  60. const Eigen::PlainObjectBase<DerivedF>& F,
  61. const Eigen::PlainObjectBase<DerivedP>& P,
  62. const std::vector<std::vector<uE2EType> >& uE2E,
  63. const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
  64. Eigen::PlainObjectBase<DerivedR>& R,
  65. Eigen::PlainObjectBase<DerivedS>& S);
  66. }
  67. }
  68. }
  69. #ifndef IGL_STATIC_LIBRARY
  70. #include "closest_facet.cpp"
  71. #endif
  72. #endif