1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
/*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkMultiBlockDataSet.h,v $
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkMultiBlockDataSet - Composite dataset that organize datasets in blocks
// .SECTION Description
// vtkMultiBlockDataSet is a vtkCompositeDataSet that stores
// a hierarchy of datasets. The dataset collection consists of
// multiple blocks. Each block can have zero or more sub-blocks.
// Sub-blocks are usually used to distribute blocks across processors.
// For example, a 1 block dataset can be distributed as following:
// @verbatim
// proc 0:
// Block 0:
// * ds 0
// * (null)
//
// proc 1:
// Block 0:
// * (null)
// * ds 1
// @endverbatim
//
// The levels are implemented as groups (see vtkMultiGroupDataSet) and can
// be treated as such. This allows the use of all vtkMultiGroupDataSet.
// Currently, the interface for connecting parents-children is incomplete.
//
// .SECTION See Also
// vtkMultiGroupDataSet
#ifndef __vtkMultiBlockDataSet_h
#define __vtkMultiBlockDataSet_h
#include "vtkMultiGroupDataSet.h"
class vtkDataObject;
class VTK_FILTERING_EXPORT vtkMultiBlockDataSet : public vtkMultiGroupDataSet
{
public:
static vtkMultiBlockDataSet *New();
vtkTypeRevisionMacro(vtkMultiBlockDataSet,vtkMultiGroupDataSet);
virtual void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Return class name of data type (see vtkType.h for
// definitions).
virtual int GetDataObjectType() {return VTK_MULTIBLOCK_DATA_SET;}
// Description:
// Set the number of blocks. This call might cause
// allocation if the new number of blocks is larger than the
// current one.
void SetNumberOfBlocks(unsigned int numBlocks)
{
this->SetNumberOfGroups(numBlocks);
}
// Description:
// Returns the number of blocks.
unsigned int GetNumberOfBlocks()
{
return this->GetNumberOfGroups();
}
// Description:
// Uses keys BLOCK() and INDEX() to call SetDataSet(BLOCK, INDEX, dobj)
virtual void AddDataSet(vtkInformation* index, vtkDataObject* dobj);
// Description:
// Uses keys BLOCK() and INDEX() to call GetDataSet(BLOCK, INDEX)
virtual vtkDataObject* GetDataSet(vtkInformation* index);
vtkDataObject* GetDataSet(unsigned int block, unsigned int id)
{ return this->Superclass::GetDataSet(block, id); }
static vtkInformationIntegerKey* BLOCK();
//BTX
// Description:
// Retrieve an instance of this class from an information object.
static vtkMultiBlockDataSet* GetData(vtkInformation* info);
static vtkMultiBlockDataSet* GetData(vtkInformationVector* v, int i=0);
//ETX
protected:
vtkMultiBlockDataSet();
~vtkMultiBlockDataSet();
private:
vtkMultiBlockDataSet(const vtkMultiBlockDataSet&); // Not implemented.
void operator=(const vtkMultiBlockDataSet&); // Not implemented.
};
#endif
|