1 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 // + This file is part of enGrid. +
5 // + Copyright 2008-2014 enGits GmbH +
7 // + enGrid is free software: you can redistribute it and/or modify +
8 // + it under the terms of the GNU General Public License as published by +
9 // + the Free Software Foundation, either version 3 of the License, or +
10 // + (at your option) any later version. +
12 // + enGrid is distributed in the hope that it will be useful, +
13 // + but WITHOUT ANY WARRANTY; without even the implied warranty of +
14 // + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
15 // + GNU General Public License for more details. +
17 // + You should have received a copy of the GNU General Public License +
18 // + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
20 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
22 #ifndef TETGENOPERATION_H
23 #define TETGENOPERATION_H
25 #include <CGAL/Simple_cartesian.h>
26 #include <CGAL/AABB_tree.h>
27 #include <CGAL/AABB_traits.h>
28 #include <CGAL/AABB_triangle_primitive.h>
29 #include <CGAL/AABB_segment_primitive.h>
31 #include "operation.h"
33 #include "edgelengthsourcemanager.h"
35 class TetGenOperation
;
37 class TetGenOperation
: public Operation
40 protected: // data types
47 typedef CGAL::Simple_cartesian
<double> K
;
51 typedef K::Line_3 Line
;
52 typedef K::Point_3 Point
;
53 typedef K::Segment_3 Segment
;
54 typedef K::Triangle_3 Triangle
;
56 typedef QVector
<Triangle
>::iterator TriangleIterator
;
57 typedef CGAL::AABB_triangle_primitive
<K
,TriangleIterator
> TrianglePrimitive
;
58 typedef CGAL::AABB_traits
<K
, TrianglePrimitive
> TriangleTraits
;
59 typedef CGAL::AABB_tree
<TriangleTraits
> TriangleTree
;
62 protected: // attributes
64 double m_MinimalEdgeLength
;
65 double m_MaximalEdgeLength
;
66 double m_GrowthFactor
;
67 double m_NodesPerQuarterCircle
;
68 double m_2dFeatureResolution
;
69 double m_3dFeatureResolution
;
70 double m_FeatureAngle
;
75 EdgeLengthSourceManager m_ELSManager
;
82 void copyToTetGen(tetgenio
&tgio
, vtkUnstructuredGrid
*alt_grid
= NULL
);
83 void copyFromTetGen(tetgenio
&tgio
);
85 void tetgen(QString flags
, vtkUnstructuredGrid
*background_grid
= NULL
);
88 QString
qualityText();
97 #endif // TETGENOPERATION_H