Commit ce02da6a authored by George Zagaris's avatar George Zagaris
Browse files

ENH: Add AppendDataSet method

Added method to append a dataset at a given level
parent 87536521
......@@ -223,6 +223,30 @@ void vtkHierarchicalBoxDataSet::SetDataSet(
}
}
//------------------------------------------------------------------------------
void vtkHierarchicalBoxDataSet::AppendDataSet(
unsigned int level, vtkUniformGrid* grid )
{
// STEP 0: Resize the number of levels accordingly
if( level >= this->GetNumberOfLevels() )
{
this->SetNumberOfLevels( level+1 );
}
// STEP 1: Insert data at the end
vtkMultiPieceDataSet* levelDS =
vtkMultiPieceDataSet::SafeDownCast( this->Superclass::GetChild(level));
if( levelDS != NULL )
{
unsigned int idx = levelDS->GetNumberOfPieces();
levelDS->SetPiece(idx, grid);
}
else
{
vtkErrorMacro( "Multi-piece data-structure is NULL!!!!" );
}
}
//------------------------------------------------------------------------------
void vtkHierarchicalBoxDataSet::SetMetaData(
unsigned int level, unsigned int id, const vtkAMRBox &box )
......
......@@ -111,6 +111,11 @@ public:
// resize the number of levels and the number of datasets accordingly.
void SetDataSet(unsigned int level, unsigned int id, vtkUniformGrid* dataSet);
// Description:
// Appends the dataset to the given level. This will resize the
// number of levels and the number of datasets accordingly.
void AppendDataSet(unsigned int level, vtkUniformGrid* dataSet );
// Description:
// Sets the meta-data object at a given node. This will resize the number
// of levels and number of datasets acoordingly.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment