Skip to content

Commit

Permalink
vtkPeriodicDataArray: fix vector range computation.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjcorona committed Jun 15, 2016
1 parent bf7f399 commit 7b08d2d
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions Common/Core/vtkPeriodicDataArray.txx
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,9 @@ ComputeScalarRange(double* range)
template <class Scalar> bool vtkPeriodicDataArray<Scalar>::
ComputeVectorRange(double range[2])
{
if (this->NumberOfComponents == 3)
if (this->NumberOfComponents == 3 && this->Data)
{
if (this->InvalidRange)
{
this->ComputePeriodicRange();
}

range[0] = vtkTypeTraits<Scalar>::Max();
range[1] = vtkTypeTraits<Scalar>::Min();

for (int i = 0; i < 3; i++)
{
range[0] = std::min(this->PeriodicRange[i * 2], range[0]);
range[1] = std::max(this->PeriodicRange[i * 2 + 1], range[1]);
}
this->Data->GetRange(range, -1);
}
else
{
Expand Down

0 comments on commit 7b08d2d

Please sign in to comment.