facet_components.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. // For connected components on vertices see igl::vertex_components
  18. //
  19. // Inputs:
  20. // F #F by 3 list of triangle indices
  21. // Outputs:
  22. // C #F list of connected component ids
  23. template <typename DerivedF, typename DerivedC>
  24. IGL_INLINE void facet_components(
  25. const Eigen::PlainObjectBase<DerivedF> & F,
  26. Eigen::PlainObjectBase<DerivedC> & C);
  27. // Compute connected components of facets based on edge-edge adjacency.
  28. //
  29. // For connected components on vertices see igl::vertex_components
  30. //
  31. // Inputs:
  32. // TT #TT by 3 list of list of adjacency triangles (see
  33. // triangle_triangle_adjacency.h)
  34. // Outputs:
  35. // C #F list of connected component ids
  36. // counts #C list of number of facets in each components
  37. template <
  38. typename TTIndex,
  39. typename DerivedC,
  40. typename Derivedcounts>
  41. IGL_INLINE void facet_components(
  42. const std::vector<std::vector<std::vector<TTIndex > > > & TT,
  43. Eigen::PlainObjectBase<DerivedC> & C,
  44. Eigen::PlainObjectBase<Derivedcounts> & counts);
  45. }
  46. #ifndef IGL_STATIC_LIBRARY
  47. # include "facet_components.cpp"
  48. #endif
  49. #endif