remove_unreferenced.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. // remove_unreferenced.h
  10. // Preview3D
  11. //
  12. // Created by Daniele Panozzo on 17/11/11.
  13. #ifndef IGL_REMOVE_UNREFERENCED_H
  14. #define IGL_REMOVE_UNREFERENCED_H
  15. #include "igl_inline.h"
  16. #include <Eigen/Core>
  17. namespace igl
  18. {
  19. // [ NV, NF ] = remove_unreferenced( 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 <
  29. typename DerivedV,
  30. typename DerivedF,
  31. typename DerivedNV,
  32. typename DerivedNF,
  33. typename DerivedI>
  34. IGL_INLINE void remove_unreferenced(
  35. const Eigen::PlainObjectBase<DerivedV> &V,
  36. const Eigen::PlainObjectBase<DerivedF> &F,
  37. Eigen::PlainObjectBase<DerivedNV> &NV,
  38. Eigen::PlainObjectBase<DerivedNF> &NF,
  39. Eigen::PlainObjectBase<DerivedI> &I);
  40. }
  41. #ifndef IGL_STATIC_LIBRARY
  42. # include "remove_unreferenced.cpp"
  43. #endif
  44. #endif