relabel_small_immersed_cells.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 Qingnan Zhou <qnzhou@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. //
  9. #ifndef IGL_RELABEL_SMALL_IMMERSED_CELLS
  10. #define IGL_RELABEL_SMALL_IMMERSED_CELLS
  11. #include "../../igl_inline.h"
  12. #include <Eigen/Core>
  13. #include <vector>
  14. namespace igl
  15. {
  16. namespace copyleft
  17. {
  18. namespace cgal
  19. {
  20. // Inputs:
  21. // V #V by 3 list of vertex positions.
  22. // F #F by 3 list of triangle indices into V.
  23. // num_patches number of patches
  24. // P #F list of patch ids.
  25. // num_cells number of cells
  26. // C #P by 2 list of cell ids on each side of each patch.
  27. // vol_threshold Volume threshold, cells smaller than this
  28. // and is completely immersed will be relabeled.
  29. //
  30. // In/Output:
  31. // W #F by 2 cell labels. W(i,0) is the label on the positive side of
  32. // face i, W(i,1) is the label on the negative side of face i. W
  33. // will be modified in place by this method.
  34. template<
  35. typename DerivedV,
  36. typename DerivedF,
  37. typename DerivedP,
  38. typename DerivedC,
  39. typename FT,
  40. typename DerivedW>
  41. IGL_INLINE void relabel_small_immersed_cells(
  42. const Eigen::PlainObjectBase<DerivedV>& V,
  43. const Eigen::PlainObjectBase<DerivedF>& F,
  44. const size_t num_patches,
  45. const Eigen::PlainObjectBase<DerivedP>& P,
  46. const size_t num_cells,
  47. const Eigen::PlainObjectBase<DerivedC>& C,
  48. const FT vol_threashold,
  49. Eigen::PlainObjectBase<DerivedW>& W);
  50. }
  51. }
  52. }
  53. #ifndef IGL_STATIC_LIBRARY
  54. # include "relabel_small_immersed_cells.cpp"
  55. #endif
  56. #endif