qslim_optimal_collapse_edge_callbacks.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef IGL_QSLIM_OPTIMAL_COLLAPSE_EDGE_CALLBACKS_H
  2. #define IGL_QSLIM_OPTIMAL_COLLAPSE_EDGE_CALLBACKS_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. #include <functional>
  6. #include <vector>
  7. #include <tuple>
  8. namespace igl
  9. {
  10. // Prepare callbacks for decimating edges using the qslim optimal placement
  11. // metric.
  12. //
  13. // Inputs:
  14. // E #E by 2 list of working edges
  15. // quadrics reference to list of working per vertex quadrics
  16. // v1 working variable to maintain end point of collapsed edge
  17. // v2 working variable to maintain end point of collapsed edge
  18. // Outputs
  19. // cost_and_placement callback for evaluating cost of edge collapse and
  20. // determining placement of vertex (see collapse_edge)
  21. // pre_collapse callback before edge collapse (see collapse_edge)
  22. // post_collapse callback after edge collapse (see collapse_edge)
  23. IGL_INLINE void qslim_optimal_collapse_edge_callbacks(
  24. Eigen::MatrixXi & E,
  25. std::vector<std::tuple<Eigen::MatrixXd,Eigen::RowVectorXd,double> > &
  26. quadrics,
  27. int & v1,
  28. int & v2,
  29. std::function<void(
  30. const int e,
  31. const Eigen::MatrixXd &,
  32. const Eigen::MatrixXi &,
  33. const Eigen::MatrixXi &,
  34. const Eigen::VectorXi &,
  35. const Eigen::MatrixXi &,
  36. const Eigen::MatrixXi &,
  37. double &,
  38. Eigen::RowVectorXd &)> & cost_and_placement,
  39. std::function<bool(const int)> & pre_collapse,
  40. std::function<void(const int,const bool)> & post_collapse);
  41. }
  42. #ifndef IGL_STATIC_LIBRARY
  43. # include "qslim_optimal_collapse_edge_callbacks.cpp"
  44. #endif
  45. #endif