[vtkusers] how to update vtkActor
Greg Book
gbook at gbook.org
Mon Jul 13 11:51:51 EDT 2009
I'm updating my question on a previous post about drawing points from inside
an observer. I have an observer which is supposed to draw a new point (and
add it to a vtkPolyData object) when the mouse is clicked. By debugging, I
can see that the point is being added to the vtkPolyData object, but it's
not being updated on the screen. I start off the program with 3 points
displayed just to test it (those points are displayed). I then click a few
times and check to see if vtkPolyData contains the new points (it does), but
nothing new is displayed! I'm not sure if I'm not setting up the rendering
correctly, or the mapper, etc.
I simplified the observer code:
void ObserverMousePicker::Execute(vtkObject *caller, unsigned long event,
void*)
{
double *p_x;
p_x = m_planeWidgetX->GetCurrentCursorPosition();
m_points->InsertNextPoint(p_x);
log->WriteLog(wxString::Format("Clicked at: (%f,%f,%f)", p_x[0], p_x[1],
p_x[2]));
m_conn->InsertNextCell(1);
m_poly->Update();
m_polyMapper->Update();
m_polyActor->GetMapper()->GetInput()->Update();
m_ren1->Render();
m_vtkWindow->Render();
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090713/2fd89a8d/attachment.htm>
More information about the vtkusers
mailing list