facet_components.h 1.3 KB

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