VTK: IO/AMR/vtkAMRDataSetCache.h Source File

| VTK 9.3.1

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:
27 static vtkAMRDataSetCache* New();
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:
86 vtkAMRDataSetCache();
87 ~vtkAMRDataSetCache() override;
88
89 typedef std::map<int, vtkUniformGrid*> AMRCacheType;
90 AMRCacheType Cache;
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 */
vtkAMRDataSetCache
A concrete implementation of vtkObject that provides functionality for caching AMR blocks.
Definition: vtkAMRDataSetCache.h:25
vtkAMRDataSetCache::InsertAMRBlockPointData
void InsertAMRBlockPointData(int compositeIdx, vtkDataArray *dataArray)
Inserts a point data array to an already cached block NOTE: this->HasAMRBlock( compositeIdx ) == true...
vtkAMRDataSetCache::vtkAMRDataSetCache
vtkAMRDataSetCache()
vtkAMRDataSetCache::GetAMRBlock
vtkUniformGrid * GetAMRBlock(int compositeIdx)
Given the composite index, this method returns the AMR block.
vtkAMRDataSetCache::New
static vtkAMRDataSetCache * New()
vtkAMRDataSetCache::~vtkAMRDataSetCache
~vtkAMRDataSetCache() override
vtkAMRDataSetCache::HasAMRBlockPointData
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 ...
vtkAMRDataSetCache::Cache
AMRCacheType Cache
Definition: vtkAMRDataSetCache.h:90
vtkAMRDataSetCache::GetAMRBlockPointData
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...
vtkAMRDataSetCache::InsertAMRBlockCellData
void InsertAMRBlockCellData(int compositeIdx, vtkDataArray *dataArray)
Inserts a cell data array to an already cached block NOTE: this->HasAMRBlock( compositeIdx ) == true.
vtkAMRDataSetCache::InsertAMRBlock
void InsertAMRBlock(int compositeIdx, vtkUniformGrid *amrGrid)
Inserts an AMR block to the cache.
vtkAMRDataSetCache::AMRCacheType
std::map< int, vtkUniformGrid * > AMRCacheType
Definition: vtkAMRDataSetCache.h:89
vtkAMRDataSetCache::GetAMRBlockCellData
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 ...
vtkAMRDataSetCache::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAMRDataSetCache::HasAMRBlock
bool HasAMRBlock(int compositeIdx)
Checks if the AMR block associated with the given composite is cached.
vtkAMRDataSetCache::HasAMRBlockCellData
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...
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkUniformGrid
image data with blanking
Definition: vtkUniformGrid.h:39
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkObject.h