unique_edge_map.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 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_UNIQUE_EDGE_MAP_H
  9. #define IGL_UNIQUE_EDGE_MAP_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Dense>
  12. #include <vector>
  13. namespace igl
  14. {
  15. // Construct relationships between facet "half"-(or rather "viewed")-edges E
  16. // to unique edges of the mesh seen as a graph.
  17. //
  18. // Inputs:
  19. // F #F by 3 list of simplices
  20. // Outputs:
  21. // E #F*3 by 2 list of all directed edges, such that E.row(f+#F*c) is the
  22. // edge opposite F(f,c)
  23. // uE #uE by 2 list of unique undirected edges
  24. // EMAP #F*3 list of indices into uE, mapping each directed edge to unique
  25. // undirected edge
  26. // uE2E #uE list of lists of indices into E of coexisting edges
  27. template <
  28. typename DerivedF,
  29. typename DerivedE,
  30. typename DeriveduE,
  31. typename DerivedEMAP,
  32. typename uE2EType>
  33. IGL_INLINE void unique_edge_map(
  34. const Eigen::MatrixBase<DerivedF> & F,
  35. Eigen::PlainObjectBase<DerivedE> & E,
  36. Eigen::PlainObjectBase<DeriveduE> & uE,
  37. Eigen::PlainObjectBase<DerivedEMAP> & EMAP,
  38. std::vector<std::vector<uE2EType> > & uE2E);
  39. }
  40. #ifndef IGL_STATIC_LIBRARY
  41. # include "unique_edge_map.cpp"
  42. #endif
  43. #endif