[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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user