3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
23 // File : SALOME_ExtractUnstructuredGrid.hxx
24 // Author : Alexey PETROV
27 #ifndef SALOME_ExtractUnstructuredGrid_HeaderFile
28 #define SALOME_ExtractUnstructuredGrid_HeaderFile
30 #include <vtkUnstructuredGridToUnstructuredGridFilter.h>
36 class SALOME_ExtractUnstructuredGrid : public vtkUnstructuredGridToUnstructuredGridFilter{
38 vtkTypeMacro(SALOME_ExtractUnstructuredGrid,vtkUnstructuredGridToUnstructuredGridFilter);
41 // Construct with all types of clipping turned off.
42 static SALOME_ExtractUnstructuredGrid *New();
44 enum EExtraction{ eCells, ePoints};
45 void SetModeOfExtraction(EExtraction theExtractionMode);
46 EExtraction GetModeOfExtraction(){ return myExtractionMode;}
48 enum EChanging{ ePassAll, eAdding, eRemoving};
49 void SetModeOfChanging(EChanging theChangeMode);
50 EChanging GetModeOfChanging(){ return myChangeMode;}
52 // Remove the cell from the output
53 void RegisterCell(vtkIdType theCellId);
54 int IsCellsRegistered() { return !myCellIds.empty();}
55 void ClearRegisteredCells() {
60 // Remove every cells with the type from the output
61 void RegisterCellsWithType(vtkIdType theCellType);
62 int IsCellsWithTypeRegistered() { return !myCellTypes.empty();}
63 void ClearRegisteredCellsWithType();
65 // Do the filter do some real work
66 int IsChanging() { return IsCellsRegistered() || IsCellsWithTypeRegistered();}
68 // Do it keep the mapping between input's and output's UnstructuredGrid
69 void SetStoreMapping(int theStoreMapping);
70 int GetStoreMapping(){ return myStoreMapping;}
72 vtkIdType GetInputId(int theOutId) const;
73 vtkIdType GetOutputId(int theInId) const;
75 typedef std::vector<vtkIdType> TVectorId;
76 typedef std::map<vtkIdType,vtkIdType> TMapId;
79 SALOME_ExtractUnstructuredGrid();
80 ~SALOME_ExtractUnstructuredGrid();
84 EExtraction myExtractionMode;
86 EChanging myChangeMode;
87 typedef std::set<vtkIdType> TSetId;
96 SALOME_ExtractUnstructuredGrid(const SALOME_ExtractUnstructuredGrid&); // Not implemented.
97 void operator=(const SALOME_ExtractUnstructuredGrid&); // Not implemented.