VTK  9.5.20250813
vtkAMRDataInternals.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
14#ifndef vtkAMRDataInternals_h
15#define vtkAMRDataInternals_h
16
17#include "vtkCommonDataModelModule.h" // For export macro
18#include "vtkDeprecation.h" //for VTK_DEPRECATED_IN_9_6_0
19#include "vtkObject.h"
20#include "vtkSmartPointer.h" //for storing smart pointers to blocks
21
22#include <vector> //for storing blocks
23
24VTK_ABI_NAMESPACE_BEGIN
25class vtkUniformGrid;
26class VTK_DEPRECATED_IN_9_6_0("This class is not used anymore and will be removed.")
27 VTKCOMMONDATAMODEL_EXPORT vtkAMRDataInternals : public vtkObject
28{
29public:
30 struct Block
31 {
33 unsigned int Index;
34 Block(unsigned int i, vtkUniformGrid* g);
35 };
36 typedef std::vector<vtkAMRDataInternals::Block> BlockList;
37
40
41 void Initialize();
42 void PrintSelf(ostream& os, vtkIndent indent) override;
43
44 void Insert(unsigned int index, vtkUniformGrid* grid);
45 vtkUniformGrid* GetDataSet(unsigned int compositeIndex);
46
49 void DeepCopy(vtkObject* src);
50
51 bool Empty() const { return this->GetNumberOfBlocks() == 0; }
52
53public:
54 unsigned int GetNumberOfBlocks() const { return static_cast<unsigned int>(this->Blocks.size()); }
55 const Block& GetBlock(unsigned int i) { return this->Blocks[i]; }
56 const BlockList& GetAllBlocks() const { return this->Blocks; }
57
58protected:
61
62 void GenerateIndex(bool force = false);
63
64 std::vector<Block> Blocks;
65 std::vector<int>* InternalIndex; // map from the composite index to internal index
66 bool GetInternalIndex(unsigned int compositeIndex, unsigned int& internalIndex);
67
68private:
70 void operator=(const vtkAMRDataInternals&) = delete;
71};
72
73VTK_ABI_NAMESPACE_END
74#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 DeepCopy(vtkObject *src)
void Insert(unsigned int index, vtkUniformGrid *grid)
static vtkAMRDataInternals * New()
unsigned int GetNumberOfBlocks() const
void CompositeShallowCopy(vtkObject *src)
const BlockList & GetAllBlocks() const
vtkUniformGrid * GetDataSet(unsigned int compositeIndex)
bool GetInternalIndex(unsigned int compositeIndex, unsigned int &internalIndex)
~vtkAMRDataInternals() override
std::vector< vtkAMRDataInternals::Block > BlockList
std::vector< int > * InternalIndex
std::vector< Block > Blocks
void ShallowCopy(vtkObject *src)
const Block & GetBlock(unsigned int i)
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
Hold a reference to a vtkObjectBase instance.
Deprecated vtkImageData.
Block(unsigned int i, vtkUniformGrid *g)
vtkSmartPointer< vtkUniformGrid > Grid
#define VTK_DEPRECATED_IN_9_6_0(reason)