-
Notifications
You must be signed in to change notification settings - Fork 2
/
ca_smoothing.h
57 lines (51 loc) · 1.95 KB
/
ca_smoothing.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//--------------------------------------------------------------------------
// Software: Context Aware Smoothing
// Copyright: (C) 2012 Centro de Pesquisas Renato Archer
// Homepage: https://github.com/tfmoraes/context_aware_smoothing
// Contact: tfmoraes@cti.gov.br
// License: GNU - GPL 2 (LICENSE.txt/LICENCA.txt)
//--------------------------------------------------------------------------
// Este programa e software livre; voce pode redistribui-lo e/ou
// modifica-lo sob os termos da Licenca Publica Geral GNU, conforme
// publicada pela Free Software Foundation; de acordo com a versao 2
// da Licenca.
//
// Este programa eh distribuido na expectativa de ser util, mas SEM
// QUALQUER GARANTIA; sem mesmo a garantia implicita de
// COMERCIALIZACAO ou de ADEQUACAO A QUALQUER PROPOSITO EM
// PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais
// detalhes.
//--------------------------------------------------------------------------
#include <math.h>
#ifdef HAVE_CXX0X
#include<unordered_map>
#define MAP std::unordered_map
#elif HAVE_TR1
#include <tr1/unordered_map>
#define MAP std::tr1::unordered_map
#else
#include <map>
#define MAP std::map
#endif
#include <queue>
#include <set>
#include <vector>
#include <stdlib.h>
#include <vtkIdList.h>
#include <vtkPolyData.h>
#include <vtkCellData.h>
#include <vtkDoubleArray.h>
#include <vtkCell.h>
typedef struct _Point
{
double x;
double y;
double z;
} Point;
vtkPolyData* ca_smoothing (vtkPolyData*, double, double, double, int);
vtkIdList* find_staircase_artifacts(vtkPolyData*, const double[3], double);
vtkIdList* get_near_vertices_to_v(vtkPolyData*, int, double);
vtkDoubleArray* calc_artifacts_weight(vtkPolyData*, vtkIdList*, double, double);
Point calc_d(vtkPolyData*, int);
vtkPolyData* taubin_smooth(vtkPolyData*, vtkDoubleArray*, double, double, int);
MAP<int, std::vector<int> > get_flat_areas(vtkPolyData*, double[3], double);