in_element.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef IGL_IN_ELEMENT_H
  2. #define IGL_IN_ELEMENT_H
  3. #include <igl/igl_inline.h>
  4. #include "InElementAABB.h"
  5. #include <Eigen/Core>
  6. namespace igl
  7. {
  8. // Determine whether each point in a list of points is in the elements of a
  9. // mesh.
  10. //
  11. // Inputs:
  12. // V #V by dim list of mesh vertex positions.
  13. // Ele #Ele by dim+1 list of mesh indices into #V.
  14. // Q #Q by dim list of query point positions
  15. // aabb axis-aligned bounding box tree object (see InElementAABB.h)
  16. // Outputs:
  17. // I #Q list of indices into Ele of first containing element (-1 means no
  18. // containing element)
  19. IGL_INLINE void in_element(
  20. const Eigen::MatrixXd & V,
  21. const Eigen::MatrixXi & Ele,
  22. const Eigen::MatrixXd & Q,
  23. const InElementAABB & aabb,
  24. Eigen::VectorXi & I);
  25. // Outputs:
  26. // I #Q by #Ele sparse matrix revealing whether each element contains each
  27. // point: I(q,e) means point q is in element e
  28. IGL_INLINE void in_element(
  29. const Eigen::MatrixXd & V,
  30. const Eigen::MatrixXi & Ele,
  31. const Eigen::MatrixXd & Q,
  32. const InElementAABB & aabb,
  33. Eigen::SparseMatrix<double> & I);
  34. //
  35. // Example:
  36. // InElementAABB aabb;
  37. // aabb.init(V,Ele);
  38. };
  39. #ifndef IGL_STATIC_LIBRARY
  40. #include "in_element.cpp"
  41. #endif
  42. #endif