VTK
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 =========================================================================*/
25 #ifndef vtkAMRDataInternals_h
26 #define vtkAMRDataInternals_h
27 
28 #include "vtkCommonDataModelModule.h" // For export macro
29 #include "vtkObject.h"
30 #include "vtkSmartPointer.h" //for storing smart pointers to blocks
31 #include <vector> //for storing blocks
32 
33 class vtkUniformGrid;
35 {
36 public:
37  struct Block
38  {
40  unsigned int Index;
41  Block(unsigned int i, vtkUniformGrid* g);
42  };
43  typedef std::vector<vtkAMRDataInternals::Block> BlockList;
44 
47 
48  void Initialize();
49  void PrintSelf(ostream& os, vtkIndent indent);
50 
51  void Insert(unsigned int index, vtkUniformGrid* grid);
52  vtkUniformGrid* GetDataSet(unsigned int compositeIndex);
53 
54  virtual void ShallowCopy(vtkObject *src);
55 
56  bool Empty()const{ return this->GetNumberOfBlocks()==0;}
57 
58 public:
59  unsigned int GetNumberOfBlocks() const{ return static_cast<unsigned int>(this->Blocks.size());}
60  const Block& GetBlock(unsigned int i) { return this->Blocks[i];}
61  const BlockList& GetAllBlocks() const{ return this->Blocks;}
62 
63 protected:
64 
67 
68  void GenerateIndex(bool force=false);
69 
70  std::vector<Block> Blocks;
71  std::vector<int>* InternalIndex; //map from the composite index to internal index
72  bool GetInternalIndex(unsigned int compositeIndex, unsigned int& internalIndex);
73 
74 private:
75  vtkAMRDataInternals(const vtkAMRDataInternals&); // Not implemented.
76  void operator=(const vtkAMRDataInternals&); // Not implemented
77 };
78 
79 #endif
vtkAMRDataInternals::Insert
void Insert(unsigned int index, vtkUniformGrid *grid)
vtkAMRDataInternals::Block::Grid
vtkSmartPointer< vtkUniformGrid > Grid
Definition: vtkAMRDataInternals.h:39
vtkAMRDataInternals::GenerateIndex
void GenerateIndex(bool force=false)
vtkAMRDataInternals::Block::Block
Block(unsigned int i, vtkUniformGrid *g)
vtkCommonDataModelModule.h
vtkUniformGrid
image data with blanking
Definition: vtkUniformGrid.h:40
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkAMRDataInternals::ShallowCopy
virtual void ShallowCopy(vtkObject *src)
vtkAMRDataInternals::Block
Definition: vtkAMRDataInternals.h:38
vtkSmartPointer< vtkUniformGrid >
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkAMRDataInternals::Initialize
void Initialize()
vtkAMRDataInternals::New
static vtkAMRDataInternals * New()
vtkAMRDataInternals::GetBlock
const Block & GetBlock(unsigned int i)
Definition: vtkAMRDataInternals.h:60
vtkAMRDataInternals::vtkAMRDataInternals
vtkAMRDataInternals()
vtkgl::src
GLenum src
Definition: vtkgl.h:12525
vtkAMRDataInternals::GetInternalIndex
bool GetInternalIndex(unsigned int compositeIndex, unsigned int &internalIndex)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkAMRDataInternals::GetNumberOfBlocks
unsigned int GetNumberOfBlocks() const
Definition: vtkAMRDataInternals.h:59
vtkSmartPointer.h
vtkAMRDataInternals::Block::Index
unsigned int Index
Definition: vtkAMRDataInternals.h:40
vtkAMRDataInternals::Empty
bool Empty() const
Definition: vtkAMRDataInternals.h:56
vtkAMRDataInternals::InternalIndex
std::vector< int > * InternalIndex
Definition: vtkAMRDataInternals.h:71
vtkAMRDataInternals::BlockList
std::vector< vtkAMRDataInternals::Block > BlockList
Definition: vtkAMRDataInternals.h:43
vtkAMRDataInternals::GetAllBlocks
const BlockList & GetAllBlocks() const
Definition: vtkAMRDataInternals.h:61
vtkObject.h
vtkgl::index
GLuint index
Definition: vtkgl.h:11983
vtkgl::g
GLboolean GLboolean g
Definition: vtkgl.h:12312
vtkAMRDataInternals::GetDataSet
vtkUniformGrid * GetDataSet(unsigned int compositeIndex)
vtkAMRDataInternals::~vtkAMRDataInternals
~vtkAMRDataInternals()
VTKCOMMONDATAMODEL_EXPORT
#define VTKCOMMONDATAMODEL_EXPORT
Definition: vtkCommonDataModelModule.h:15
vtkAMRDataInternals::Blocks
std::vector< Block > Blocks
Definition: vtkAMRDataInternals.h:70
vtkAMRDataInternals
container of vtkUniformGrid for an AMR data set
Definition: vtkAMRDataInternals.h:35
vtkAMRDataInternals::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)