Skip to content
Snippets Groups Projects
Commit c99a85fb authored by Lars Bilke's avatar Lars Bilke
Browse files

Better check in VtkVisPointSetItem::activeAttributeExists().

parent ffcb5dce
No related branches found
No related tags found
No related merge requests found
...@@ -270,6 +270,7 @@ void VtkVisPointSetItem::SetActiveAttribute( const QString& name ) ...@@ -270,6 +270,7 @@ void VtkVisPointSetItem::SetActiveAttribute( const QString& name )
_algorithm->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS, charName); _algorithm->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS, charName);
_mapper->SetScalarModeToUsePointData(); _mapper->SetScalarModeToUsePointData();
pointData->GetArray(_activeArrayName.c_str())->GetRange(range); pointData->GetArray(_activeArrayName.c_str())->GetRange(range);
pointData->GetArray(charName)->GetRange(range);
} }
else else
{ {
...@@ -290,6 +291,7 @@ void VtkVisPointSetItem::SetActiveAttribute( const QString& name ) ...@@ -290,6 +291,7 @@ void VtkVisPointSetItem::SetActiveAttribute( const QString& name )
_algorithm->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_CELLS, charName); _algorithm->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_CELLS, charName);
_mapper->SetScalarModeToUseCellData(); _mapper->SetScalarModeToUseCellData();
cellData->GetArray(_activeArrayName.c_str())->GetRange(range); cellData->GetArray(_activeArrayName.c_str())->GetRange(range);
cellData->GetArray(charName)->GetRange(range);
} }
else else
{ {
...@@ -340,6 +342,11 @@ bool VtkVisPointSetItem::activeAttributeExists(vtkDataSetAttributes* data, std:: ...@@ -340,6 +342,11 @@ bool VtkVisPointSetItem::activeAttributeExists(vtkDataSetAttributes* data, std::
{ {
data->SetActiveAttribute(name.c_str(), vtkDataSetAttributes::SCALARS); data->SetActiveAttribute(name.c_str(), vtkDataSetAttributes::SCALARS);
return true; return true;
int i = data->SetActiveAttribute(name.c_str(), vtkDataSetAttributes::SCALARS);
if (i < 0)
return false;
else
return true;
} }
else else
return false; return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment