Source

Mesh Simplification / MeshSimplification / decimation.h

#pragma once

#include "HEdge.h"

#define NORMAL_DOT_PRODUCT 0
#define AVERAGE_POINT 1

void save_last_boundary(vector<HE_vert*>& boundary);
void save_last_decimation(vector<HE_vert*>& boundary);

int decimate(HE_vert* vert, map<int, HE_vert*>& del_verts, bool save_boundary = false);
int delete_vertex(HE_vert* vert, map<int, HE_vert*>& del_verts);
int construct_boundary(HE_vert* vert, vector<HE_vert*>& boundary);
int retriangulate_boundary(HE_vert* vert, vector<HE_vert*>& boundary, 
	vector<HE_face*>* new_faces = NULL, vector<pair<pair<int, int>, int> >* new_faces_points = NULL);

double local_curvature(HE_vert* vert, int type = NORMAL_DOT_PRODUCT);
double normal_dot_product(HE_vert* vert);
double dist_to_avg_pt(HE_vert* vert);

void clean_decimation_structures();
int decimate(map<int, HE_vert*>::iterator& i, double threshold, int test_type = AVERAGE_POINT, bool save_boundary = false);
int decimation_test(map<int, HE_vert*>::iterator& i, double threshold, int test_type = AVERAGE_POINT);
void decimate(double threshold, int test_type, bool save_boundary = false);