[vtkusers] vtkPolyData Modified() and rendering

MOUSSAUD David 244079 David.MOUSSAUD at cea.fr
Mon Mar 14 05:50:06 EDT 2016


Hello,

Could someone explain me how to use smartly the Modified() method for vtkPolyData.
In attachment, I give a simple example. I'm with VTK 6.3 and I use Qt bindings.

I have a timer (200ms) that fill dynamically a vtkPolyData instance.

points->Initialize();
vertices->Initialize();
colors->Initialize();

for(quint8 i=0;i<nb_points;i++)
{
points->InsertNextPoint(i*0.01, 0.0, 0.0);
vertex->GetPointIds()->SetId(0,i);
vertices->InsertNextCell(vertex);
/* the first point is red, others are blue */
if(i==0)
colors->InsertNextTuple3(255,0,0);
else
colors->InsertNextTuple3(0,0,255);
}

And just after I call : polydata->Modified();

This call produces no effects unless if I click inside my renderWindow or resize it.

If a add an other timer (100ms) that just call renderWindow->Render(); , then my points are well updated in my renderWindow but the Modified() call seems useless.

Thanks in advance for your support,
Regards,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160314/0f410cd8/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: qvtkwidgetrendu3d.cpp
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160314/0f410cd8/attachment.ksh>


More information about the vtkusers mailing list