VTK  9.4.20241222
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
20VTK_ABI_NAMESPACE_BEGIN
21class vtkUniformGrid;
22class vtkDataArray;
23
24class VTKIOAMR_EXPORT vtkAMRDataSetCache : public vtkObject
25{
26public:
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
85protected:
88
89 typedef std::map<int, vtkUniformGrid*> AMRCacheType;
91
92private:
94 void operator=(const vtkAMRDataSetCache&) = delete;
95};
96
97VTK_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.
~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 ...
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 * 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...
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 ...
static vtkAMRDataSetCache * New()
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
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
image data with blanking