vtk 5.2 -> 5.4 in setup_paths.sh
[engrid.git] / src / insertpoints.h
blob35451f71783350c1ea8131e7048bf66b0331227b
1 //
2 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 // + +
4 // + This file is part of enGrid. +
5 // + +
6 // + Copyright 2008,2009 Oliver Gloth +
7 // + +
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. +
12 // + +
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. +
17 // + +
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/>. +
20 // + +
21 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
23 #ifndef INSERTPOINTS_H
24 #define INSERTPOINTS_H
26 #include "surfaceoperation.h"
28 #include <vtkUnstructuredGrid.h>
29 #include <vtkPolyData.h>
30 #include <QSet>
31 #include <QVector>
32 #include "egvtkobject.h"
33 #include "vertexmeshdensity.h"
35 #include "geometrytools.h"
36 using namespace GeometryTools;
38 #include <cmath>
39 using namespace std;
41 class InsertPoints : public SurfaceOperation
44 private: // data-types
46 struct edge_t
48 stencil_t S;
49 int i_edge;
50 double L1, L2, L12;
51 double quality() const { return 0.5*min(L1,L2)/L12; }
52 bool operator< (const edge_t& E) const { return quality() < E.quality(); }
55 private: // attributes
57 int m_NumInserted;
58 double m_Threshold;
60 private: // methods
62 char getNewNodeType(stencil_t S); ///< Returns the type of the node inserted on the edge S.p[1],S.p[3] from stencil_t S
64 public:
66 InsertPoints();
67 virtual void operate();
68 int insertPoints();
69 int getNumInserted() { return m_NumInserted; }
73 #endif