Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Christian Butz
VTK
Commits
ce02da6a
Commit
ce02da6a
authored
Apr 07, 2011
by
George Zagaris
Browse files
ENH: Add AppendDataSet method
Added method to append a dataset at a given level
parent
87536521
Changes
2
Hide whitespace changes
Inline
Side-by-side
Filtering/vtkHierarchicalBoxDataSet.cxx
View file @
ce02da6a
...
...
@@ -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
)
...
...
Filtering/vtkHierarchicalBoxDataSet.h
View file @
ce02da6a
...
...
@@ -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.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment