on_boundary.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. // ON_BOUNDARY Determine boundary facets of mesh elements stored in T
  18. //
  19. // Templates:
  20. // IntegerT integer-value: i.e. int
  21. // IntegerF integer-value: i.e. int
  22. // Input:
  23. // T triangle|tetrahedron index list, m by 3|4, where m is the number of
  24. // elements
  25. // Output:
  26. // I m long list of bools whether tet is on boundary
  27. // C m by 3|4 list of bools whether opposite facet is on boundary
  28. //
  29. template <typename IntegerT>
  30. IGL_INLINE void on_boundary(
  31. const std::vector<std::vector<IntegerT> > & T,
  32. std::vector<bool> & I,
  33. std::vector<std::vector<bool> > & C);
  34. #ifndef IGL_NO_EIGEN
  35. // Templates:
  36. // DerivedT integer-value: i.e. from MatrixXi
  37. // DerivedI bool-value: i.e. from MatrixXi
  38. // DerivedC bool-value: i.e. from MatrixXi
  39. template <typename DerivedT, typename DerivedI, typename DerivedC>
  40. IGL_INLINE void on_boundary(
  41. const Eigen::PlainObjectBase<DerivedT>& T,
  42. Eigen::PlainObjectBase<DerivedI>& I,
  43. Eigen::PlainObjectBase<DerivedC>& C);
  44. #endif
  45. }
  46. #ifndef IGL_STATIC_LIBRARY
  47. # include "on_boundary.cpp"
  48. #endif
  49. #endif