MantisBT - VTK
View Issue Details
0009883VTK(No Category)public2009-11-11 13:442016-08-12 09:55
Mathieu Coursolle 
Kitware Robot 
normalcrashsometimes
closedmoved 
 
 
0009883: vtkXYPlotActor clipping causes crash and/or rendering problems.
When a vtkXYPlotActor is use to display data, it clips the values that are out of the specified range.

In the function vtkXYPlotActor::ClipPlotData, it checks all the points are creates new cells for which the points outside the specified range are kept. The ones outside the range are excluded.

One case is not handled. In the following code, if there are no trivial rejection, nor trivial acceptance, than we check if x1 is out of range. If so, we assume that x2 is not, which is not always true.

In that case, an id of -1 will be set to a cell, which may cause a crash at rendering time.

//intersect each segment with the four planes
      if ( (x1[0] < p1[0] && x2[0] < p1[0]) || (x1[0] > p2[0] && x2[0] > p2[0]) ||
           (x1[1] < p1[1] && x2[1] < p1[1]) || (x1[1] > p2[1] && x2[1] > p2[1]) )
        {
        ;//trivial rejection
        }
      else if (x1[0] >= p1[0] && x2[0] >= p1[0] && x1[0] <= p2[0] && x2[0] <= p2[0] &&
               x1[1] >= p1[1] && x2[1] >= p1[1] && x1[1] <= p2[1] && x2[1] <= p2[1] )
        {//trivial acceptance
        newPts[0] = pointMap[pts[i]];
        newPts[1] = pointMap[pts[i+1]];
        newLines->InsertNextCell(2,newPts);
        }
      else
        {
        if (x1[0] >= p1[0] && x1[0] <= p2[0] && x1[1] >= p1[1] && x1[1] <= p2[1] )
          {//first point in
          newPts[0] = pointMap[pts[i]];
          }
        else
          {//second point in
          newPts[0] = pointMap[pts[i+1]];
          }
        for (j=0; j<4; j++)
          {
          this->ClipPlanes->GetPoints()->GetPoint(j, px);
          this->ClipPlanes->GetNormals()->GetTuple(j, n);
          if ( vtkPlane::IntersectWithLine(x1,x2,n,px,t,xint) && t >= 0 && t <= 1.0 )
            {
            newPts[1] = newPoints->InsertNextPoint(xint);
            break;
            }
          }
      newLines->InsertNextCell(2,newPts);
    }
 
      }
No tags attached.
txt vtkXYPlotActorPatch.txt (597) 2009-11-11 13:44
https://www.vtk.org/Bug/file/7651/vtkXYPlotActorPatch.txt
Issue History
2009-11-11 13:44Mathieu CoursolleNew Issue
2009-11-11 13:44Mathieu CoursolleFile Added: vtkXYPlotActorPatch.txt
2009-11-11 13:45Mathieu CoursolleNote Added: 0018393
2009-11-19 15:28Mathieu CoursolleNote Added: 0018487
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:55Kitware RobotNote Added: 0037119
2016-08-12 09:55Kitware RobotStatusexpired => closed
2016-08-12 09:55Kitware RobotResolutionopen => moved
2016-08-12 09:55Kitware RobotAssigned To => Kitware Robot

Notes
(0018393)
Mathieu Coursolle   
2009-11-11 13:45   
A proposed patch was uploaded on 2009-11-11 (vtkXYPlotActorPatch.txt).
(0018487)
Mathieu Coursolle   
2009-11-19 15:28   
Commited vtkXYPlotActor.cxx, revision 1.70 on 2009/11/19.
(0037119)
Kitware Robot   
2016-08-12 09:55   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.