[FEM] improve checks for datasets

- check if datasets exists before we access them
- speed up the check for the datatype by testing after the downcast
This commit is contained in:
Uwe
2023-02-15 00:34:56 +01:00
committed by wwmayer
parent 7a0acd1db6
commit 05af64ae9e
4 changed files with 25 additions and 21 deletions

View File

@@ -48,8 +48,9 @@ vtkBoundingBox FemPostObject::getBoundingBox() {
vtkBoundingBox box;
if (Data.getValue() && Data.getValue()->IsA("vtkDataSet"))
box.AddBounds(vtkDataSet::SafeDownCast(Data.getValue())->GetBounds());
vtkDataSet* dset = vtkDataSet::SafeDownCast(Data.getValue());
if (dset)
box.AddBounds(dset->GetBounds());
// TODO: add calculation of multiblock and Multipiece datasets