bfs_orient.h 1007 B

123456789101112131415161718192021222324252627282930313233343536
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 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_BFS_ORIENT_H
  9. #define IGL_BFS_ORIENT_H
  10. #include <Eigen/Core>
  11. #include <igl/igl_inline.h>
  12. namespace igl
  13. {
  14. // Consistently orient faces in orientable patches using BFS
  15. //
  16. // F = bfs_orient(F,V);
  17. //
  18. // Inputs:
  19. // F #F by 3 list of faces
  20. // Outputs:
  21. // FF #F by 3 list of faces (OK if same as F)
  22. // C #F list of component ids
  23. //
  24. //
  25. template <typename DerivedF, typename DerivedFF, typename DerivedC>
  26. void bfs_orient(
  27. const Eigen::PlainObjectBase<DerivedF> & F,
  28. Eigen::PlainObjectBase<DerivedFF> & FF,
  29. Eigen::PlainObjectBase<DerivedC> & C);
  30. };
  31. #ifdef IGL_HEADER_ONLY
  32. # include "bfs_orient.cpp"
  33. #endif
  34. #endif