on_boundary.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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_ON_BOUNDARY_H
  9. #define IGL_ON_BOUNDARY_H
  10. #include "igl_inline.h"
  11. #ifndef IGL_NO_EIGEN
  12. # include <Eigen/Dense>
  13. #endif
  14. #include <vector>
  15. namespace igl
  16. {
  17. // BOUNDARY_FACES Determine boundary faces of tetrahedra stored in T
  18. //
  19. // Templates:
  20. // IntegerT integer-value: i.e. int
  21. // IntegerF integer-value: i.e. int
  22. // Input:
  23. // T tetrahedron index list, m by 4, where m is the number of tetrahedra
  24. // Output:
  25. // I m long list of bools whether tet is on boundary
  26. // C m by 4 list of bools whether opposite face is on boundary
  27. //
  28. template <typename IntegerT>
  29. IGL_INLINE void on_boundary(
  30. const std::vector<std::vector<IntegerT> > & T,
  31. std::vector<bool> & I,
  32. std::vector<std::vector<bool> > & C);
  33. #ifndef IGL_NO_EIGEN
  34. // Templates:
  35. // DerivedT integer-value: i.e. from MatrixXi
  36. // DerivedI bool-value: i.e. from MatrixXi
  37. // DerivedC bool-value: i.e. from MatrixXi
  38. template <typename DerivedT, typename DerivedI, typename DerivedC>
  39. IGL_INLINE void on_boundary(
  40. const Eigen::PlainObjectBase<DerivedT>& T,
  41. Eigen::PlainObjectBase<DerivedI>& I,
  42. Eigen::PlainObjectBase<DerivedC>& C);
  43. #endif
  44. }
  45. #ifdef IGL_HEADER_ONLY
  46. # include "on_boundary.cpp"
  47. #endif
  48. #endif