VTK  9.1.0
vtkAMRDataInternals.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkAMRDataInternals.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=========================================================================*/
26#ifndef vtkAMRDataInternals_h
27#define vtkAMRDataInternals_h
28
29#include "vtkCommonDataModelModule.h" // For export macro
30#include "vtkObject.h"
31#include "vtkSmartPointer.h" //for storing smart pointers to blocks
32#include <vector> //for storing blocks
33
34class vtkUniformGrid;
35class VTKCOMMONDATAMODEL_EXPORT vtkAMRDataInternals : public vtkObject
36{
37public:
38 struct Block
39 {
41 unsigned int Index;
42 Block(unsigned int i, vtkUniformGrid* g);
43 };
44 typedef std::vector<vtkAMRDataInternals::Block> BlockList;
45
48
49 void Initialize();
50 void PrintSelf(ostream& os, vtkIndent indent) override;
51
52 void Insert(unsigned int index, vtkUniformGrid* grid);
53 vtkUniformGrid* GetDataSet(unsigned int compositeIndex);
54
55 virtual void ShallowCopy(vtkObject* src);
57
58 bool Empty() const { return this->GetNumberOfBlocks() == 0; }
59
60public:
61 unsigned int GetNumberOfBlocks() const { return static_cast<unsigned int>(this->Blocks.size()); }
62 const Block& GetBlock(unsigned int i) { return this->Blocks[i]; }
63 const BlockList& GetAllBlocks() const { return this->Blocks; }
64
65protected:
68
69 void GenerateIndex(bool force = false);
70
71 std::vector<Block> Blocks;
72 std::vector<int>* InternalIndex; // map from the composite index to internal index
73 bool GetInternalIndex(unsigned int compositeIndex, unsigned int& internalIndex);
74
75private:
77 void operator=(const vtkAMRDataInternals&) = delete;
78};
79
80#endif
container of vtkUniformGrid for an AMR data set
void GenerateIndex(bool force=false)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void Insert(unsigned int index, vtkUniformGrid *grid)
static vtkAMRDataInternals * New()
unsigned int GetNumberOfBlocks() const
const BlockList & GetAllBlocks() const
vtkUniformGrid * GetDataSet(unsigned int compositeIndex)
bool GetInternalIndex(unsigned int compositeIndex, unsigned int &internalIndex)
~vtkAMRDataInternals() override
std::vector< vtkAMRDataInternals::Block > BlockList
virtual void ShallowCopy(vtkObject *src)
std::vector< int > * InternalIndex
void RecursiveShallowCopy(vtkObject *src)
std::vector< Block > Blocks
const Block & GetBlock(unsigned int i)
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:73
image data with blanking
@ index
Definition: vtkX3D.h:252
Block(unsigned int i, vtkUniformGrid *g)
vtkSmartPointer< vtkUniformGrid > Grid