-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmain.cpp
89 lines (56 loc) · 1.75 KB
/
main.cpp
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include "types.h"
#include "vtkReader.h"
#include "vtkWriter.h"
#include "meshref.h"
#include "geodesicMeshing/geodesicMeshing.h"
#include "floater/floaterpar.hpp"
#include "bezier/tbezier.h"
#include "tools.h"
#include "debug.h"
#include <sstream>
int main( int argc, char* argv[] ) {
if( argc != 4 ) {
return 3;
}
std::string filename = argv[1];
int error_size = atoi(argv[2]);
int function = atoi(argv[3]);
vtkReader reader;
reader.loadMesh( filename );
TMesh* tm;
tm = reader.getMeshTri();
QMesh* qm;
qm = reader.getMeshQuad();
adgFDCel adg(tm);
geodesicMeshing* geoMeshing = new geodesicMeshing(tm);
QOperators qop(qm);
QMesh::QEdgeIterator it = qm->edges_begin();
QEdge* e = *it;
tools T(error_size);
T.initialDivision( tm, qm, geoMeshing );
debug::iteration = 0;
// Subdividing
bool continua = T.templateMarkFaces(qm);
while ( continua ){
std::stringstream number;
number << debug::iteration;
vtkWriter::saveVTKQuad( filename + std::string("-quad-pre-") + number.str(), qm);
switch(function) {
case 1: T.correctList(qm);
break;
case 2: T.correctList2(qm);
break;
case 3: T.correctList3(qm);
break;
}
vtkWriter::saveVTKQuad( filename + std::string("-quad-pos-") + number.str(), qm);
T.subdivide( tm, qm, geoMeshing);
vtkWriter::saveVTKTri(filename + std::string("-tri-")+ number.str(), tm, qm);
debug::iteration++;
continua = T.templateMarkFaces(qm);
}
std::stringstream number;
number << debug::iteration;
vtkWriter::saveVTKQuad( filename + std::string("-final-") + number.str(), qm);
return 1;
}