removeUnreferenced.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. //
  9. // removeUnreferenced.h
  10. // Preview3D
  11. //
  12. // Created by Daniele Panozzo on 17/11/11.
  13. #ifndef IGL_REMOVEUNREFERENCED_H
  14. #define IGL_REMOVEUNREFERENCED_H
  15. #include "igl_inline.h"
  16. #include <Eigen/Core>
  17. namespace igl
  18. {
  19. // [ NV, NF ] = removeUnreferenced( V,F)
  20. // Remove unreferenced vertices from V, updating F accordingly
  21. //
  22. // Input:
  23. // V,F: mesh description
  24. //
  25. // Output:
  26. // NV, NF: new mesh without unreferenced vertices
  27. //
  28. template <typename Scalar, typename Index>
  29. IGL_INLINE void removeUnreferenced(
  30. const Eigen::PlainObjectBase<Scalar> &V,
  31. const Eigen::PlainObjectBase<Index> &F,
  32. Eigen::PlainObjectBase<Scalar> &NV,
  33. Eigen::PlainObjectBase<Index> &NF,
  34. Eigen::PlainObjectBase<Index> &I);
  35. }
  36. #ifdef IGL_HEADER_ONLY
  37. # include "removeUnreferenced.cpp"
  38. #endif
  39. #endif