Salome HOME
export preselected_id to client
[modules/paravis.git] / src / Plugins / StaticMesh / plugin / StaticMeshModule / vtkForceStaticMesh.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    vtkForceStaticMesh.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 vtkForceStaticMesh
17  * @brief Takes in input as a cache the first time it is executed then use it as a static mesh
18  *
19  * The Force Static Mesh filter create a cache the first time it is used using its input. It will then only
20  * update PointData, CellData and FieldData from the input if their dimensions are valid.
21  * This filter operates only on vtkUnstructuredGrid or on vtkMultiBlockDataSet containing a single vtkUnstructuredGrid
22  */
23
24 #ifndef vtkForceStaticMesh_h
25 #define vtkForceStaticMesh_h
26
27 #include <vtkUnstructuredGridAlgorithm.h>
28 #include <vtkNew.h>
29
30 #include "StaticMeshModuleModule.h"
31
32 class vtkUnstructuredGrid;
33
34 class STATICMESHMODULE_EXPORT vtkForceStaticMesh : public vtkUnstructuredGridAlgorithm
35 {
36 public:
37   static vtkForceStaticMesh* New();
38   vtkTypeMacro(vtkForceStaticMesh, vtkUnstructuredGridAlgorithm);
39   void PrintSelf(ostream& os, vtkIndent indent) override;
40
41   //@{
42   /**
43    * When set to true, this will force this filter to recompute its cache.
44    * Default is false.
45    */
46   vtkSetMacro(ForceCacheComputation, vtkTypeBool);
47   vtkGetMacro(ForceCacheComputation, vtkTypeBool);
48   vtkBooleanMacro(ForceCacheComputation, vtkTypeBool);
49   //@}
50
51 protected:
52   vtkForceStaticMesh() = default;
53   ~vtkForceStaticMesh() override = default;
54
55   int FillInputPortInformation(int port, vtkInformation* info) override;
56   int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
57
58 private:
59   vtkForceStaticMesh(const vtkForceStaticMesh&) = delete;
60   void operator=(const vtkForceStaticMesh&) = delete;
61   
62   bool ForceCacheComputation = false;
63   bool CacheInitialized = false;
64   vtkNew<vtkUnstructuredGrid> Cache;
65 };
66
67 #endif