Commit 757f5e85 authored by Scott Wittenburg's avatar Scott Wittenburg

Fix issue preventing rendering of multiple vtkPolyDataItems

parent 3a2d0ce2
......@@ -629,7 +629,7 @@ private:
void DrawLines(vtkPolyData* polyData, int scalarMode, float const x,
float const y, float const scale)
{
if (polyData->GetMTime() > this->LinesLoadingTime)
if (polyData != this->lastLinesPolyDataAddr || polyData->GetMTime() > this->LinesLoadingTime)
{
vtkNew<vtkGenericCell> genericCell;
this->Lines.clear();
......@@ -674,6 +674,7 @@ private:
}
}
this->lastLinesPolyDataAddr = polyData;
this->LinesLoadingTime.Modified();
cellIter->Delete();
}
......@@ -716,7 +717,7 @@ private:
void DrawPolygons(vtkPolyData* polyData, int scalarMode, float const x,
float const y, float const scale)
{
if (polyData->GetMTime() > this->PolygonsLoadingTime)
if (polyData != this->lastPolysPolyDataAddr || polyData->GetMTime() > this->PolygonsLoadingTime)
{
this->PolyTri.clear();
this->PolyColors->Reset();
......@@ -780,6 +781,7 @@ private:
}
}
this->lastPolysPolyDataAddr = polyData;
this->PolygonsLoadingTime.Modified();
cellIter->Delete();
}
......@@ -810,6 +812,7 @@ private:
std::vector<float> PolyTri;
vtkNew<vtkUnsignedCharArray> PolyColors;
vtkTimeStamp PolygonsLoadingTime;
vtkPolyData* lastPolysPolyDataAddr;
//@}
//@{
......@@ -819,6 +822,7 @@ private:
std::vector<float> Lines;
vtkNew<vtkUnsignedCharArray> LineColors;
vtkTimeStamp LinesLoadingTime;
vtkPolyData* lastLinesPolyDataAddr;
//@}
};
#endif // VTKOPENGLCONTEXTDEVICE2DPRIVATE_H
......
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