Dear all,<br><br>I'm using a vtkVertexGlyphFilter objects to represent few points. The coordinates of these points are supposed to change as certain parameter changes. That means I have to clean the screen and re-draw these points every time the parameter changes. I used the following function to do the refreshing. <br>
<br>void ReDrawPoints(float current_mode[][3])<br>{<br> float t[3];<br><br> points = vtkPoints::New();<br> for (int i = 0; i < 5090; i++)<br> {<br> t[0] = current_mode[i][0];<br> t[1] = current_mode[i][1];<br>
t[2] = current_mode[i][2];<br> points->InsertPoint(vtkIdType(i), t);<br> }<br><br> polydata = vtkPolyData::New();<br> polydata->SetPoints(points);<br><br> gf = vtkVertexGlyphFilter::New();<br>
gf->AddInput(newpolydata);<br> gf->Update();<br><br> array = vtkFloatArray::New();<br> for (int i = 0; i < 5090; i++)<br> {<br> newarray->InsertTuple1(i, float(i));<br> }<br><br> polydata = vtkPolyData::New();<br>
polydata->GetPointData()->SetScalars(array);<br><br> mapper = vtkPolyDataMapper::New();<br> mapper->SetInputConnection(gf->GetOutputPort());<br><br> actor = vtkActor::New();<br> actor->SetMapper(mapper);<br>
<br> renderer->AddActor(actor);<br> renWin->AddRenderer(renderer);<br><br> ren->Render();<br> iren->SetRenderWindow(renWin);<br> renWin->Render();<br> <br>
gf->RemoveAllInputs();<br> gf->Delete();<br> points->Delete();<br> polydata->Delete();<br> array->Delete();<br> mapper->Delete();<br> actor->Delete();<br> renderer->RemoveActor(actor); //This one erase the points from the screen.<br>
}<br><br>This function is being called all the times until some condition is fulfilled.<br><br>However, it only cleans the screen. The points just show up on the screen for a flash and gone.<br><br>Can anyone help me out of this? I'll be extremely grateful.<br>
<br>Yours<br>Long<br>