Merge branch 'master' of ssh://swordfish/srv/www/htdocs/git/engrid
[engrid.git] / src / vtkEgGridFilter.h
blobe5009ca3aefdc80e32be87b955108ff6ac74ca90
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 __vtkEgGridFilter_h
24 #define __vtkEgGridFilter_h
26 class vtkEgGridFilter;
28 #include <vtkUnstructuredGridAlgorithm.h>
29 #include <vtkUnstructuredGrid.h>
30 #include <vtkIntArray.h>
31 #include <vtkLongArray.h>
32 #include <vtkDoubleArray.h>
33 #include <vtkCellData.h>
34 #include <vtkCellType.h>
35 #include <vtkCellLinks.h>
36 #include <vtkObjectFactory.h>
38 #include <QSet>
39 #include <QVector>
41 #include "engrid.h"
42 #include "egvtkobject.h"
44 class vtkEgGridFilter : public vtkUnstructuredGridAlgorithm, public EgVtkObject
47 protected: // attributes
49 QSet<int> m_BoundaryCodes;
50 vtkUnstructuredGrid *m_Input;
51 vtkUnstructuredGrid *m_Output;
52 vtkUnstructuredGrid *m_LastOutput;
53 unsigned long m_LastRun;
55 protected: // methods
57 vtkEgGridFilter();
58 ~vtkEgGridFilter();
60 virtual int FillInputPortInformation(int, vtkInformation* info);
61 virtual int FillOutputPortInformation(int, vtkInformation* info);
62 virtual int RequestData(vtkInformation*, vtkInformationVector** inputVector, vtkInformationVector* outputVector);
64 virtual void ExecuteEg() = 0;
66 /**
67 * Extract boundary elements and nodes with a given set of boundary conditions
68 * @param cells On return, this will contain the indexes of the extracted boundary elements.
69 * @param modes On return, this will contain the indexes of the extracted boundary nodes.
70 * @param grid The grid to operate on.
71 * @param bc A set of the boundary conditions to extract.
73 void ExtractBoundary(QVector<vtkIdType> &cells, QVector<vtkIdType> &nodes, QSet<int> &bc, vtkUnstructuredGrid *grid);
75 public: // methods
77 void SetBoundaryCodes(const QSet<int>& bc);
81 #endif