VTK  9.3.20240302
vtkAMRDataSetCache.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
13 #ifndef vtkAMRDataSetCache_h
14 #define vtkAMRDataSetCache_h
15 
16 #include "vtkIOAMRModule.h" // For export macro
17 #include "vtkObject.h"
18 #include <map> // For STL map used as the data-structure for the cache.
19 
20 VTK_ABI_NAMESPACE_BEGIN
21 class vtkUniformGrid;
22 class vtkDataArray;
23 
24 class VTKIOAMR_EXPORT vtkAMRDataSetCache : public vtkObject
25 {
26 public:
28  vtkTypeMacro(vtkAMRDataSetCache, vtkObject);
29  void PrintSelf(ostream& os, vtkIndent indent) override;
30 
34  void InsertAMRBlock(int compositeIdx, vtkUniformGrid* amrGrid);
35 
40  void InsertAMRBlockPointData(int compositeIdx, vtkDataArray* dataArray);
41 
46  void InsertAMRBlockCellData(int compositeIdx, vtkDataArray* dataArray);
47 
53  vtkDataArray* GetAMRBlockCellData(int compositeIdx, const char* dataName);
54 
60  vtkDataArray* GetAMRBlockPointData(int compositeIdx, const char* dataName);
61 
66  vtkUniformGrid* GetAMRBlock(int compositeIdx);
67 
72  bool HasAMRBlockCellData(int compositeIdx, const char* name);
73 
78  bool HasAMRBlockPointData(int compositeIdx, const char* name);
79 
83  bool HasAMRBlock(int compositeIdx);
84 
85 protected:
87  ~vtkAMRDataSetCache() override;
88 
89  typedef std::map<int, vtkUniformGrid*> AMRCacheType;
91 
92 private:
93  vtkAMRDataSetCache(const vtkAMRDataSetCache&) = delete;
94  void operator=(const vtkAMRDataSetCache&) = delete;
95 };
96 
97 VTK_ABI_NAMESPACE_END
98 #endif /* vtkAMRDataSetCache_h */
A concrete implementation of vtkObject that provides functionality for caching AMR blocks.
void InsertAMRBlockPointData(int compositeIdx, vtkDataArray *dataArray)
Inserts a point data array to an already cached block NOTE: this->HasAMRBlock( compositeIdx ) == true...
vtkUniformGrid * GetAMRBlock(int compositeIdx)
Given the composite index, this method returns the AMR block.
static vtkAMRDataSetCache * New()
~vtkAMRDataSetCache() override
bool HasAMRBlockPointData(int compositeIdx, const char *name)
Checks if the point data array, associated with the provided name, has been cached for the AMR block ...
vtkDataArray * GetAMRBlockPointData(int compositeIdx, const char *dataName)
Given the name of the point array and AMR block composite index, this method returns a pointer to the...
void InsertAMRBlockCellData(int compositeIdx, vtkDataArray *dataArray)
Inserts a cell data array to an already cached block NOTE: this->HasAMRBlock( compositeIdx ) == true.
void InsertAMRBlock(int compositeIdx, vtkUniformGrid *amrGrid)
Inserts an AMR block to the cache.
std::map< int, vtkUniformGrid * > AMRCacheType
vtkDataArray * GetAMRBlockCellData(int compositeIdx, const char *dataName)
Given the name of the cell array and AMR block composite index, this method returns a pointer to the ...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool HasAMRBlock(int compositeIdx)
Checks if the AMR block associated with the given composite is cached.
bool HasAMRBlockCellData(int compositeIdx, const char *name)
Checks if the cell data array, associated with the provided name, has been cached for the AMR block w...
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:154
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:161
image data with blanking
@ name
Definition: vtkX3D.h:219