facet_components.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef FACET_COMPONENTS_H
  2. #define FACET_COMPONENTS_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. #include <vector>
  6. namespace igl
  7. {
  8. // Compute connected components of facets based on edge-edge adjacency.
  9. //
  10. // Inputs:
  11. // F #F by 3 list of triangle indices
  12. // Ouputs:
  13. // C #F list of connected component ids
  14. template <typename DerivedF, typename DerivedC>
  15. IGL_INLINE void facet_components(
  16. const Eigen::PlainObjectBase<DerivedF> & F,
  17. Eigen::PlainObjectBase<DerivedC> & C);
  18. // Inputs:
  19. // TT #TT by 3 list of list of adjacency triangles (see
  20. // triangle_triangle_adjacency.h)
  21. // Ouputs:
  22. // C #F list of connected component ids
  23. template <
  24. typename TTIndex,
  25. typename DerivedC,
  26. typename Derivedcounts>
  27. IGL_INLINE void facet_components(
  28. const std::vector<std::vector<std::vector<TTIndex > > > & TT,
  29. Eigen::PlainObjectBase<DerivedC> & C,
  30. Eigen::PlainObjectBase<Derivedcounts> & counts);
  31. }
  32. #ifndef IGL_STATIC_LIBRARY
  33. # include "facet_components.cpp"
  34. #endif
  35. #endif