https://github.com/HTDerekLiu/surface_multigrid_code
Revision 2a5ce10bcc87d1ae648b298a39eec2f368b24b24 authored by HTDerekLiu on 24 May 2021, 13:03:36 UTC, committed by HTDerekLiu on 24 May 2021, 13:03:36 UTC
1 parent 5d998ed
Raw File
Tip revision: 2a5ce10bcc87d1ae648b298a39eec2f368b24b24 authored by HTDerekLiu on 24 May 2021, 13:03:36 UTC
add balloon
Tip revision: 2a5ce10
SSP_decimate.cpp
#include "SSP_decimate.h"

bool SSP_decimate(
    const Eigen::MatrixXd & VO,
    const Eigen::MatrixXi & FO,
    const size_t & tarF,
    const int & dec_type,
    Eigen::MatrixXd & V,
    Eigen::MatrixXi & F,
    Eigen::VectorXi & IMF,
    Eigen::VectorXi & IM,
    std::vector<single_collapse_data> & decInfo,
    std::vector<std::vector<int>> & decIM,
    Eigen::VectorXi & FIM)
{
  using namespace std;
  bool returnVal = true;

  Eigen::VectorXi BI;
  if (!igl::is_vertex_manifold(FO, BI) || !igl::is_edge_manifold(FO)) {
    cout << "input mesh is not manifold\n";
    return false;
  }

  switch (dec_type)
  {
    case 1: // mid point 
      cout << "uniform decimation \n";
      returnVal = SSP_midpoint(VO,FO,tarF, V,F,IMF, IM, decInfo, decIM, FIM);
      break;
    case 2: // vertex removal
      cout << "vertex removal \n";
      returnVal = SSP_vertexRemoval(VO,FO,tarF, V,F,IMF, IM, decInfo, decIM, FIM);
      break;
    default:
      cout << "qslim \n";
      returnVal = SSP_qslim(VO,FO,tarF, V,F,IMF, IM, decInfo, decIM, FIM);
  }
  return returnVal;
}
back to top