1 #ifndef VTKVIEWER_EXTRACTUNSTRUCTUREDGRID_H
2 #define VTKVIEWER_EXTRACTUNSTRUCTUREDGRID_H
6 #include <vtkUnstructuredGridToUnstructuredGridFilter.h>
12 class VTKVIEWER_EXPORT VTKViewer_ExtractUnstructuredGrid : public vtkUnstructuredGridToUnstructuredGridFilter
15 vtkTypeMacro( VTKViewer_ExtractUnstructuredGrid, vtkUnstructuredGridToUnstructuredGridFilter );
18 // Construct with all types of clipping turned off.
19 static VTKViewer_ExtractUnstructuredGrid *New();
21 enum EExtraction{ eCells, ePoints};
22 void SetModeOfExtraction(EExtraction theExtractionMode){
23 myExtractionMode = theExtractionMode; Modified();
25 EExtraction GetModeOfExtraction(){ return myExtractionMode;}
27 enum EChanging{ ePassAll, eAdding, eRemoving};
28 void SetModeOfChanging(EChanging theChangeMode){
29 myChangeMode = theChangeMode;
32 EChanging GetModeOfChanging(){ return myChangeMode;}
34 // Remove the cell from the output
35 void RegisterCell(vtkIdType theCellId);
36 int IsCellsRegistered() { return !myCellIds.empty();}
37 void ClearRegisteredCells() {
42 // Remove every cells with the type from the output
43 void RegisterCellsWithType(vtkIdType theCellType);
44 int IsCellsWithTypeRegistered() { return !myCellTypes.empty();}
45 void ClearRegisteredCellsWithType() {
50 // Do the filter do some real work
51 int IsChanging() { return IsCellsRegistered() || IsCellsWithTypeRegistered();}
53 // Do it keep the mapping between input's and output's UnstructuredGrid
54 void SetStoreMapping(int theStoreMapping);
55 int GetStoreMapping(){ return myStoreMapping;}
57 vtkIdType GetInputId(int theOutId) const;
58 vtkIdType GetOutputId(int theInId) const;
60 typedef std::vector<vtkIdType> TVectorId;
61 typedef std::map<vtkIdType,vtkIdType> TMapId;
64 VTKViewer_ExtractUnstructuredGrid();
65 ~VTKViewer_ExtractUnstructuredGrid();
69 EExtraction myExtractionMode;
71 EChanging myChangeMode;
72 typedef std::set<vtkIdType> TSetId;
81 VTKViewer_ExtractUnstructuredGrid(const VTKViewer_ExtractUnstructuredGrid&); // Not implemented.
82 void operator=(const VTKViewer_ExtractUnstructuredGrid&); // Not implemented.