Added getNeighbours functions to class Operation + moved UpdateMeshDensity to class...
[engrid.git] / vtkEgEliminateShortEdges.h
blob4bfdf3282a64ecfdb58b63d20089b145d0f1e91c
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 __vtkEgEliminateShortEdges_h
24 #define __vtkEgEliminateShortEdges_h
26 class vtkEgEliminateShortEdges;
28 #include "vtkEgGridFilter.h"
30 #include <QVector>
32 /**
33 * A VTK filter to remove elements with bad aspect ratios.
34 * Currently this will only work with triangular surface grids.
35 * There is also no error checking done -- yet -- which means
36 * that the resulting grid has to be carefully looked at.
37 * This filter has, however, proven to be useful in certain
38 * cases.
40 class vtkEgEliminateShortEdges : public vtkEgGridFilter
43 private: // attributes
45 QVector<vtkIdType> new_node_idx;
46 QVector<vtkIdType> node_mapping;
47 QVector<bool> delete_cell;
48 double max_ratio;
49 double max_length;
50 int N_eliminated;
51 vtkIdType N_new_points;
52 vtkIdType N_new_cells;
54 public: // static methods
56 static vtkEgEliminateShortEdges* New();
58 public: // methods
60 void SetMaxRatio(double mr) { max_ratio = mr ; Modified(); };
61 void SetMaxLength(double ml) { max_length = ml ; Modified(); };
63 int GetNumEliminated() { return N_eliminated; };
65 protected: // methods
67 vtkEgEliminateShortEdges();
68 ~vtkEgEliminateShortEdges() {};
69 virtual void ExecuteEg();
71 private: // methods
73 vtkEgEliminateShortEdges (const vtkEgEliminateShortEdges&);
74 void operator= (const vtkEgEliminateShortEdges&);
76 void CheckEdges();
77 void CheckCells();
78 void CopyPoints();
79 void CopyCells();
83 #endif