Commit 53b98a74 authored by Yuanxin Liu's avatar Yuanxin Liu
Browse files

add default data selection behavior back for backward compatability

Change-Id: I19006a431662377e9ee856643a4aff95c0805859
parent 9eefcc29
......@@ -93,13 +93,25 @@ int vtkAbstractInterpolatedVelocityField::FunctionValues
f[0] = f[1] = f[2] = 0.0;
// See if a dataset has been specified and if there are input vectors
if ( !dataset ||
!(vectors = dataset->GetAttributesAsFieldData(this->VectorsType)->GetArray(this->VectorsSelection))
)
if ( !dataset)
{
vtkErrorMacro( << "Can't evaluate dataset!" );
vectors = NULL;
return 0;
}
if(!this->VectorsSelection) //if a selection is not speicifed,
//use the first one in the point set (this is a behavior for backward compatability)
{
vectors = dataset->GetPointData()->GetVectors(0);
}
else
{
vectors = dataset->GetAttributesAsFieldData(this->VectorsType)->GetArray(this->VectorsSelection);
}
if(!vectors)
{
vtkErrorMacro( << "Can't evaluate dataset!" );
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment