VTK  9.2.20221001
vtkAMRDataSetCache.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAMRDataSetCache.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  =========================================================================*/
25 #ifndef vtkAMRDataSetCache_h
26 #define vtkAMRDataSetCache_h
27 
28 #include "vtkIOAMRModule.h" // For export macro
29 #include "vtkObject.h"
30 #include <map> // For STL map used as the data-structure for the cache.
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkUniformGrid;
34 class vtkDataArray;
35 
36 class VTKIOAMR_EXPORT vtkAMRDataSetCache : public vtkObject
37 {
38 public:
40  vtkTypeMacro(vtkAMRDataSetCache, vtkObject);
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
46  void InsertAMRBlock(int compositeIdx, vtkUniformGrid* amrGrid);
47 
52  void InsertAMRBlockPointData(int compositeIdx, vtkDataArray* dataArray);
53 
58  void InsertAMRBlockCellData(int compositeIdx, vtkDataArray* dataArray);
59 
65  vtkDataArray* GetAMRBlockCellData(int compositeIdx, const char* dataName);
66 
72  vtkDataArray* GetAMRBlockPointData(int compositeIdx, const char* dataName);
73 
78  vtkUniformGrid* GetAMRBlock(int compositeIdx);
79 
84  bool HasAMRBlockCellData(int compositeIdx, const char* name);
85 
90  bool HasAMRBlockPointData(int compositeIdx, const char* name);
91 
95  bool HasAMRBlock(const int compositeIdx);
96 
97 protected:
99  ~vtkAMRDataSetCache() override;
100 
101  typedef std::map<int, vtkUniformGrid*> AMRCacheType;
103 
104 private:
105  vtkAMRDataSetCache(const vtkAMRDataSetCache&) = delete;
106  void operator=(const vtkAMRDataSetCache&) = delete;
107 };
108 
109 VTK_ABI_NAMESPACE_END
110 #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...
bool HasAMRBlock(const int compositeIdx)
Checks if the AMR block associated with the given composite is cached.
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 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:166
a simple class to control print indentation
Definition: vtkIndent.h:120
abstract base class for most VTK objects
Definition: vtkObject.h:83
image data with blanking
@ name
Definition: vtkX3D.h:231