Salome HOME
[EDF17832] : Move VoroGauss GaussToCell StaticMesh DevelopedSurface from EDF to parav...
[modules/paravis.git] / src / Plugins / StaticMesh / vtkStaticPlaneCutter.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    vtkStaticPlaneCutter.h
5
6   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7   All rights reserved.
8   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10      This software is distributed WITHOUT ANY WARRANTY; without even
11      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12      PURPOSE.  See the above copyright notice for more information.
13
14 =========================================================================*/
15 /**
16  * @class   vtkStaticPlaneCutter
17  * @brief   StaticMesh aware implementation of vtkPlaneCutter vtk vtkUnstructuredGrid
18  *
19  * This class specialize vtkPlaneCutter for vtkUnstructuredGrid input.
20  * It uses a cache when the associated data chage over time but not the geometry.
21  * In order to be able to update the cache, we keep track of cells ids
22  * when the cache is computed.
23  * Contrary to its parent, this class does not interpolate point data,
24  * only transmit cell data.
25  *
26  *
27  * @sa
28  * vtkPlaneCutter
29 */
30
31 #ifndef vtkStaticPlaneCutter_h
32 #define vtkStaticPlaneCutter_h
33
34 #include <vtkIdList.h>
35 #include <vtkNew.h>
36 #include <vtkPlaneCutter.h>
37 #include <vtkSmartPointer.h>
38
39 #include <vector>
40
41 class vtkMultiPieceDataSet;
42
43 class vtkStaticPlaneCutter : public vtkPlaneCutter
44 {
45 public:
46   static vtkStaticPlaneCutter* New();
47   typedef vtkPlaneCutter Superclass; // vtkTypeMacro can't be used with a factory built object
48   void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
49
50   int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) VTK_OVERRIDE;
51
52 protected:
53   vtkStaticPlaneCutter();
54   ~vtkStaticPlaneCutter() VTK_OVERRIDE;
55
56   /**
57    * Check input for "Ids" cell array, if absent, compute and add them.
58    */
59   static void AddIdsArray(vtkDataSet* input, vtkDataSet* output);
60
61   /**
62    * Update cache point, cell and field data using input
63    */
64   void UpdateCacheData(vtkDataSet* input);
65
66   /**
67    * Compute the cells ids to be used when updating the cache later
68    */
69   void ComputeCellIds();
70
71   /**
72    * Remove all point data array of a multipiece input with polydata leafs
73    */
74   static void RemovePointData(vtkMultiPieceDataSet* dataset);
75
76   vtkNew<vtkMultiPieceDataSet> Cache;
77   std::vector<vtkSmartPointer<vtkIdList> > CellToCopyFrom;
78   std::vector<vtkSmartPointer<vtkIdList> > CellToCopyTo;
79   vtkMTimeType InputMeshTime;
80   vtkMTimeType FilterMTime;
81
82 private:
83   // Hide these from the user and the compiler.
84   vtkStaticPlaneCutter(const vtkStaticPlaneCutter&) VTK_DELETE_FUNCTION;
85   void operator=(const vtkStaticPlaneCutter&) VTK_DELETE_FUNCTION;
86 };
87
88 #endif