VTK
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 class vtkUniformGrid;
33 class vtkDataArray;
34 
35 class VTKIOAMR_EXPORT vtkAMRDataSetCache : public vtkObject
36 {
37 public:
39  vtkTypeMacro( vtkAMRDataSetCache, vtkObject );
40  void PrintSelf(ostream &os, vtkIndent indent );
41 
45  void InsertAMRBlock(int compositeIdx,vtkUniformGrid *amrGrid);
46 
52  int compositeIdx, vtkDataArray *dataArray );
53 
59  int compositeIdx, vtkDataArray *dataArray );
60 
67  int compositeIdx, const char *dataName );
68 
75  int compositeIdx, const char *dataName );
76 
81  vtkUniformGrid* GetAMRBlock(int compositeIdx );
82 
87  bool HasAMRBlockCellData(int compositeIdx, const char *name);
88 
93  bool HasAMRBlockPointData(int compositeIdx, const char *name);
94 
98  bool HasAMRBlock( const int compositeIdx );
99 
100 protected:
103 
104  typedef std::map< int, vtkUniformGrid* > AMRCacheType;
106 
107 private:
108  vtkAMRDataSetCache( const vtkAMRDataSetCache& ) VTK_DELETE_FUNCTION;
109  void operator=( const vtkAMRDataSetCache& ) VTK_DELETE_FUNCTION;
110 };
111 
112 #endif /* vtkAMRDataSetCache_h */
vtkAMRDataSetCache::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkUniformGrid
image data with blanking
Definition: vtkUniformGrid.h:41
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
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::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...
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkAMRDataSetCache::Cache
AMRCacheType Cache
Definition: vtkAMRDataSetCache.h:105
vtkAMRDataSetCache::InsertAMRBlockCellData
void InsertAMRBlockCellData(int compositeIdx, vtkDataArray *dataArray)
Inserts a cell data array to an already cached block NOTE: this->HasAMRBlock( compositeIdx ) == true.
vtkAMRDataSetCache
A concrete implementation of vtkObject that provides functionality for caching AMR blocks.
Definition: vtkAMRDataSetCache.h:36
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::InsertAMRBlockPointData
void InsertAMRBlockPointData(int compositeIdx, vtkDataArray *dataArray)
Inserts a point data array to an already cached block NOTE: this->HasAMRBlock( compositeIdx ) == true...
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkObject.h
vtkAMRDataSetCache::InsertAMRBlock
void InsertAMRBlock(int compositeIdx, vtkUniformGrid *amrGrid)
Inserts an AMR block to the cache.
vtkAMRDataSetCache::GetAMRBlock
vtkUniformGrid * GetAMRBlock(int compositeIdx)
Given the composite index, this method returns the AMR block.
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::HasAMRBlock
bool HasAMRBlock(const int compositeIdx)
Checks if the AMR block associated with the given composite is cached.
vtkAMRDataSetCache::AMRCacheType
std::map< int, vtkUniformGrid * > AMRCacheType
Definition: vtkAMRDataSetCache.h:104
vtkAMRDataSetCache::New
static vtkAMRDataSetCache * New()
vtkAMRDataSetCache::vtkAMRDataSetCache
vtkAMRDataSetCache()
vtkAMRDataSetCache::~vtkAMRDataSetCache
virtual ~vtkAMRDataSetCache()