closest_facet.h 2.4 KB

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