fixed edge display for volume cells
[engrid-github.git] / src / libengrid / tetgenoperation.h
blobbce8655ae46479fc522d688129c0009f369255af
1 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 // + +
3 // + This file is part of enGrid. +
4 // + +
5 // + Copyright 2008-2014 enGits GmbH +
6 // + +
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. +
11 // + +
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. +
16 // + +
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/>. +
19 // + +
20 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21 //
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"
32 #include "tetgen.h"
33 #include "edgelengthsourcemanager.h"
35 class TetGenOperation;
37 class TetGenOperation : public Operation
40 protected: // data types
42 struct segment_t
44 int node1, node2;
47 typedef CGAL::Simple_cartesian<double> K;
49 typedef K::FT FT;
50 typedef K::Ray_3 Ray;
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;
71 int m_OrgDir;
72 int m_CurDir;
73 int m_VolDir;
75 EdgeLengthSourceManager m_ELSManager;
77 QString m_TetGenPath;
80 protected: // methods
82 void copyToTetGen(tetgenio &tgio, vtkUnstructuredGrid *alt_grid = NULL);
83 void copyFromTetGen(tetgenio &tgio);
85 void tetgen(QString flags, vtkUnstructuredGrid *background_grid = NULL);
86 void readSettings();
88 QString qualityText();
91 public:
93 TetGenOperation();
97 #endif // TETGENOPERATION_H