[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:
@@ -634,6 +634,8 @@ bool ViewProviderFemPostObject::setupPipeline()
|
||||
// add a field with an absolute value
|
||||
vtkSmartPointer<vtkDataObject> SPdata = data;
|
||||
vtkDataSet* dset = vtkDataSet::SafeDownCast(SPdata);
|
||||
if (!dset)
|
||||
return false;
|
||||
std::string FieldName;
|
||||
auto numFields = dset->GetPointData()->GetNumberOfArrays();
|
||||
for (int i = 0; i < numFields; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user