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.<br>
<br>I simplified the observer code:<br>void ObserverMousePicker::Execute(vtkObject *caller, unsigned long event, void*) <br>{<br> double *p_x;<br> p_x = m_planeWidgetX->GetCurrentCursorPosition();<br> m_points->InsertNextPoint(p_x);<br>
log->WriteLog(wxString::Format("Clicked at: (%f,%f,%f)", p_x[0], p_x[1], p_x[2]));<br><br> m_conn->InsertNextCell(1);<br> m_poly->Update();<br> m_polyMapper->Update();<br> m_polyActor->GetMapper()->GetInput()->Update();<br>
m_ren1->Render();<br> m_vtkWindow->Render();<br>}<br><br>