unique_edge_map.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 of directed edges
  22. // uE #uE by 2 list of unique undirected edges
  23. // EMAP #F*3 list of indices into uE, mapping each directed edge to unique
  24. // undirected edge
  25. // uE2E #uE list of lists of indices into E of coexisting edges
  26. template <
  27. typename DerivedF,
  28. typename DerivedE,
  29. typename DeriveduE,
  30. typename DerivedEMAP,
  31. typename uE2EType>
  32. IGL_INLINE void unique_edge_map(
  33. const Eigen::MatrixBase<DerivedF> & F,
  34. Eigen::PlainObjectBase<DerivedE> & E,
  35. Eigen::PlainObjectBase<DeriveduE> & uE,
  36. Eigen::PlainObjectBase<DerivedEMAP> & EMAP,
  37. std::vector<std::vector<uE2EType> > & uE2E);
  38. }
  39. #ifndef IGL_STATIC_LIBRARY
  40. # include "unique_edge_map.cpp"
  41. #endif
  42. #endif