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 myExtractionMode = theExtractionMode; Modified();
48 EExtraction GetModeOfExtraction(){ return myExtractionMode;}
50 enum EChanging{ ePassAll, eAdding, eRemoving};
51 void SetModeOfChanging(EChanging theChangeMode){
52 myChangeMode = theChangeMode;
55 EChanging GetModeOfChanging(){ return myChangeMode;}
57 // Remove the cell from the output
58 void RegisterCell(vtkIdType theCellId);
59 int IsCellsRegistered() { return !myCellIds.empty();}
60 void ClearRegisteredCells() {
65 // Remove every cells with the type from the output
66 void RegisterCellsWithType(vtkIdType theCellType);
67 int IsCellsWithTypeRegistered() { return !myCellTypes.empty();}
68 void ClearRegisteredCellsWithType() {
73 // Do the filter do some real work
74 int IsChanging() { return IsCellsRegistered() || IsCellsWithTypeRegistered();}
76 // Do it keep the mapping between input's and output's UnstructuredGrid
77 void SetStoreMapping(int theStoreMapping);
78 int GetStoreMapping(){ return myStoreMapping;}
80 vtkIdType GetInputId(int theOutId) const;
81 vtkIdType GetOutputId(int theInId) const;
83 typedef std::vector<vtkIdType> TVectorId;
84 typedef std::map<vtkIdType,vtkIdType> TMapId;
87 SALOME_ExtractUnstructuredGrid();
88 ~SALOME_ExtractUnstructuredGrid();
92 EExtraction myExtractionMode;
94 EChanging myChangeMode;
95 typedef std::set<vtkIdType> TSetId;
100 TVectorId myOut2InId;
104 SALOME_ExtractUnstructuredGrid(const SALOME_ExtractUnstructuredGrid&); // Not implemented.
105 void operator=(const SALOME_ExtractUnstructuredGrid&); // Not implemented.