max_faces_stopping_condition.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 Alec Jacobson <[email protected]>
  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_MAX_FACES_STOPPING_CONDITION_H
  9. #define IGL_MAX_FACES_STOPPING_CONDITION_H
  10. #include "igl_inline.h"
  11. #include "decimate_callback_types.h"
  12. #include <Eigen/Core>
  13. #include <vector>
  14. #include <set>
  15. #include <functional>
  16. namespace igl
  17. {
  18. /// Stopping condition function compatible with igl::decimate. The outpute
  19. /// function handle will return true if number of faces is less than max_m
  20. ///
  21. /// @param[in] m reference to working variable initially should be set to current
  22. /// number of faces.
  23. /// @param[in] orig_m number (size) of original face list _**not**_ including any
  24. /// faces added to handle phony boundary faces connecting to point at
  25. /// infinity. For closed meshes it's safe to set this to F.rows()
  26. /// @param[in] max_m maximum number of faces
  27. /// @param[out] stopping_condition
  28. ///
  29. /// See decimate.h for more details
  30. IGL_INLINE void max_faces_stopping_condition(
  31. int & m,
  32. const int orig_m,
  33. const int max_m,
  34. decimate_stopping_condition_callback & stopping_condition);
  35. /// \overload
  36. IGL_INLINE decimate_stopping_condition_callback
  37. max_faces_stopping_condition(
  38. int & m,
  39. const int orign_m,
  40. const int max_m);
  41. }
  42. #ifndef IGL_STATIC_LIBRARY
  43. # include "max_faces_stopping_condition.cpp"
  44. #endif
  45. #endif