on_boundary.h 1.5 KB

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