2 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 // + This file is part of enGrid. +
6 // + Copyright 2008,2009 Oliver Gloth +
8 // + enGrid is free software: you can redistribute it and/or modify +
9 // + it under the terms of the GNU General Public License as published by +
10 // + the Free Software Foundation, either version 3 of the License, or +
11 // + (at your option) any later version. +
13 // + enGrid is distributed in the hope that it will be useful, +
14 // + but WITHOUT ANY WARRANTY; without even the implied warranty of +
15 // + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
16 // + GNU General Public License for more details. +
18 // + You should have received a copy of the GNU General Public License +
19 // + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
21 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
24 #include "reducesurfacetriangulation.h"
26 ReduceSurfaceTriangulation::ReduceSurfaceTriangulation()
29 m_PerformGeometricTests
= true;
30 m_UseProjectionForSmoothing
= false;
31 m_UseNormalCorrectionForSmoothing
= true;
32 m_AllowFeatureEdgeSwapping
= true;
33 m_RespectFeatureEdgesForDeleteNodes
= false;
34 m_FeatureAngleForDeleteNodes
= m_FeatureAngle
;
37 void ReduceSurfaceTriangulation::pass1()
39 cout
<< "\nFirst pass of surface reduction:\n(This is the expensive part...)" << endl
;
42 m_UseNormalCorrectionForSmoothing
= true;
43 int num_initial_nodes
= m_Grid
->GetNumberOfPoints();
47 cout
<< "\npass-1 iteration-" << iter
<< ":" << endl
;
49 int num_deleted
= deleteNodes();
50 num_del_max
= max(num_del_max
, num_deleted
);
51 cout
<< "deleted nodes : " << num_deleted
<< endl
;
54 done
= num_deleted
<= num_del_max
/100;
55 cout
<< "total nodes : " << m_Grid
->GetNumberOfPoints() << endl
;
56 cout
<< "total cells : " << m_Grid
->GetNumberOfCells() << endl
;
60 void ReduceSurfaceTriangulation::pass2()
62 cout
<< "\n\nSecond pass of surface reduction:\n(This should be quick...)" << endl
;
63 m_UseNormalCorrectionForSmoothing
= false;
67 void ReduceSurfaceTriangulation::operate()
70 //writeGrid(m_Grid, "take1");
72 //writeGrid(m_Grid, "take2");
75 createIndices(m_Grid
);
76 updateNodeInfo(false);