1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: vtkForceStaticMesh.h
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
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.
14 =========================================================================*/
16 * @class vtkForceStaticMesh
17 * @brief Takes in input as a cache the first time it is executed then use it as a static mesh
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
24 #ifndef vtkForceStaticMesh_h
25 #define vtkForceStaticMesh_h
27 #include <vtkUnstructuredGridAlgorithm.h>
30 #include "StaticMeshModuleModule.h"
32 class vtkUnstructuredGrid;
34 class STATICMESHMODULE_EXPORT vtkForceStaticMesh : public vtkUnstructuredGridAlgorithm
37 static vtkForceStaticMesh* New();
38 vtkTypeMacro(vtkForceStaticMesh, vtkUnstructuredGridAlgorithm);
39 void PrintSelf(ostream& os, vtkIndent indent) override;
43 * When set to true, this will force this filter to recompute its cache.
46 vtkSetMacro(ForceCacheComputation, vtkTypeBool);
47 vtkGetMacro(ForceCacheComputation, vtkTypeBool);
48 vtkBooleanMacro(ForceCacheComputation, vtkTypeBool);
52 vtkForceStaticMesh() = default;
53 ~vtkForceStaticMesh() override = default;
55 int FillInputPortInformation(int port, vtkInformation* info) override;
56 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
59 vtkForceStaticMesh(const vtkForceStaticMesh&) = delete;
60 void operator=(const vtkForceStaticMesh&) = delete;
62 bool ForceCacheComputation = false;
63 bool CacheInitialized = false;
64 vtkNew<vtkUnstructuredGrid> Cache;