1 #ifndef VTKVIEWER_EXTRACTUNSTRUCTUREDGRID_H
2 #define VTKVIEWER_EXTRACTUNSTRUCTUREDGRID_H
6 #include <vtkUnstructuredGridToUnstructuredGridFilter.h>
11 /*! \class vtkUnstructuredGridToUnstructuredGridFilter
12 * \brief For more information see <a href="http://www.vtk.org/">VTK documentation</a>
14 /*! \class vtkUnstructuredGridToUnstructuredGridFilter
15 * \brief For more information see VTK documentation.
17 class VTKVIEWER_EXPORT VTKViewer_ExtractUnstructuredGrid : public vtkUnstructuredGridToUnstructuredGridFilter
21 vtkTypeMacro( VTKViewer_ExtractUnstructuredGrid, vtkUnstructuredGridToUnstructuredGridFilter );
23 //! \brief Construct with all types of clipping turned off.
24 static VTKViewer_ExtractUnstructuredGrid *New();
26 enum EExtraction{ eCells, ePoints};
27 //! Sets mode of extraction to \a theExtractionMode
28 void SetModeOfExtraction(EExtraction theExtractionMode){
29 myExtractionMode = theExtractionMode; Modified();
31 //! Get Extraction mode (Return: \a myExtractionMode field)
32 EExtraction GetModeOfExtraction(){ return myExtractionMode;}
34 enum EChanging{ ePassAll, eAdding, eRemoving};
35 //! Sets mode of changing to \a theChangeMode
36 void SetModeOfChanging(EChanging theChangeMode){
37 myChangeMode = theChangeMode;
40 //! Return \a myChangeMode field
41 EChanging GetModeOfChanging(){ return myChangeMode;}
43 //! Add cell id to \a myCellIds std::set
44 void RegisterCell(vtkIdType theCellId);
45 //! Check if myCellIds is empty.
46 int IsCellsRegistered() { return !myCellIds.empty();}
47 //! Remove the cell from the output
48 void ClearRegisteredCells() {
53 //! Add cell type to \a myCellTypes std::set
54 void RegisterCellsWithType(vtkIdType theCellType);
55 //! Check if myCellTypes is empty.
56 int IsCellsWithTypeRegistered() { return !myCellTypes.empty();}
57 //! Remove every cells with the type from the output
58 void ClearRegisteredCellsWithType() {
63 //! \brief Do the filter do some real work
64 int IsChanging() { return IsCellsRegistered() || IsCellsWithTypeRegistered();}
66 //! \brief Do it keep the mapping between input's and output's UnstructuredGrid
67 void SetStoreMapping(int theStoreMapping);
68 //! Get \a myStoreMapping
69 int GetStoreMapping(){ return myStoreMapping;}
71 //! Gets the input id by output id.
72 vtkIdType GetInputId(int theOutId) const;
73 //! Gets the output id by input id.
74 vtkIdType GetOutputId(int theInId) const;
76 typedef std::vector<vtkIdType> TVectorId;
77 typedef std::map<vtkIdType,vtkIdType> TMapId;
80 VTKViewer_ExtractUnstructuredGrid();
81 ~VTKViewer_ExtractUnstructuredGrid();
83 //! Main method, which calculate output
86 EExtraction myExtractionMode;
88 EChanging myChangeMode;
89 typedef std::set<vtkIdType> TSetId;
99 VTKViewer_ExtractUnstructuredGrid(const VTKViewer_ExtractUnstructuredGrid&);
101 void operator=(const VTKViewer_ExtractUnstructuredGrid&);