qslim_optimal_collapse_edge_callbacks.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 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_QSLIM_OPTIMAL_COLLAPSE_EDGE_CALLBACKS_H
  9. #define IGL_QSLIM_OPTIMAL_COLLAPSE_EDGE_CALLBACKS_H
  10. #include "igl_inline.h"
  11. #include "decimate_callback_types.h"
  12. #include <Eigen/Core>
  13. #include <functional>
  14. #include <vector>
  15. #include <tuple>
  16. #include <set>
  17. namespace igl
  18. {
  19. /// @private
  20. ///
  21. /// Prepare callbacks for decimating edges using the qslim optimal placement
  22. /// metric.
  23. ///
  24. /// @param[in] E #E by 2 list of working edges
  25. /// @param[in] quadrics reference to list of working per vertex quadrics
  26. /// @param[in] v1 working variable to maintain end point of collapsed edge
  27. /// @param[in] v2 working variable to maintain end point of collapsed edge
  28. /// @param[out] cost_and_placement callback for evaluating cost of edge collapse and
  29. /// determining placement of vertex (see collapse_edge)
  30. /// @param[out] pre_collapse callback before edge collapse (see collapse_edge)
  31. /// @param[out] post_collapse callback after edge collapse (see collapse_edge)
  32. ///
  33. /// See decimate.h for more details.
  34. ///
  35. /// \see collapse_edge
  36. IGL_INLINE void qslim_optimal_collapse_edge_callbacks(
  37. Eigen::MatrixXi & E,
  38. std::vector<
  39. std::tuple<
  40. Eigen::MatrixXd,
  41. Eigen::RowVectorXd,
  42. double> > &
  43. quadrics,
  44. int & v1,
  45. int & v2,
  46. decimate_cost_and_placement_callback & cost_and_placement,
  47. decimate_pre_collapse_callback & pre_collapse,
  48. decimate_post_collapse_callback & post_collapse);
  49. }
  50. #ifndef IGL_STATIC_LIBRARY
  51. # include "qslim_optimal_collapse_edge_callbacks.cpp"
  52. #endif
  53. #endif