edge_exists_near.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2018 Alec Jacobson <alecjacobson@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_EDGE_EXISTS_NEAR_H
  9. #define IGL_EDGE_EXISTS_NEAR_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. #include <vector>
  13. namespace igl
  14. {
  15. // Does edge (a,b) exist in the edges of all faces incident on
  16. // existing unique edge uei.
  17. //
  18. // Inputs:
  19. // uE #uE by 2 list of unique undirected edges
  20. // EMAP #F*3 list of indices into uE, mapping each directed edge to unique
  21. // undirected edge
  22. // uE2E #uE list of lists of indices into E of coexisting edges
  23. // E #F*3 by 2 list of half-edges
  24. // a 1st end-point of query edge
  25. // b 2nd end-point of query edge
  26. // uei index into uE/uE2E of unique edge
  27. // Returns true if edge exists near uei.
  28. //
  29. // See also: unique_edge_map
  30. template <
  31. typename DeriveduE,
  32. typename DerivedEMAP,
  33. typename uE2EType,
  34. typename Index>
  35. IGL_INLINE bool edge_exists_near(
  36. const Eigen::MatrixBase<DeriveduE> & uE,
  37. const Eigen::MatrixBase<DerivedEMAP> & EMAP,
  38. const std::vector<std::vector< uE2EType> > & uE2E,
  39. const Index & a,
  40. const Index & b,
  41. const Index & uei);
  42. }
  43. #ifndef IGL_STATIC_LIBRARY
  44. # include "edge_exists_near.cpp"
  45. #endif
  46. #endif