<div>Thanks Todd. I am using Qt 5.10 on Windows 10. I have tried to call update() function to refresh the window, but it doesn't work.</div><div><br></div><div> </div><div><div style="font-size:12px;padding:2px 0;">---Original---</div><div style="font-size:12px;background:#f0f0f0;color:#212121;padding:8px!important;border-radius:4px;line-height:1.5;"><div><b>From:</b> "Todd"<nztoddler@yahoo.com></div><div><b>Date:</b> Fri, May 18, 2018 20:22 PM</div><div><b>To:</b> "lor fal"<lorfalwit@gmail.com>;</div><div><b>Cc:</b> "vtkusers"<vtkusers@vtk.org>;</div><div><b>Subject:</b> Re: [vtkusers] Cannot render polygen data immediately</div></div><br><div dir="auto"><div>Hi Hugh</div><div dir="auto"><br></div><div dir="auto">You haven't said what platform you're using. Try invalidating the window region/rectangle, using the platform's window API.<br><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">On 18 May 2018 10:02 p.m., lor fal <lorfalwit@gmail.com> wrote:<br type="attribution"><blockquote class="quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 7.18516px; padding: 14px 16px 14px 8.98145px; color: rgb(149, 149, 149); background-color: rgb(245, 246, 250);"><div dir="ltr">Hi all:<div>I have hundreds of images to display by using vtkResliceImageViewer. I need to draw a marker when the left mouse button is clicked. My current solution is to use vtkRegularPolygonSource to draw a circle. The problem is that the circle does not render immediately even if I called render() afterwards. However, if I scroll the mouse wheel, the circle will be rendered correctly. </div><div>The code snippet is attached below:</div><div><br></div><div>void add_marker()</div><div>{<!-- --></div><div><div> auto _circle_source = vtkSmartPointer<vtkRegularPolygonSource>::New();</div><div> _circle_source->SetNormal(1, 0, 0);</div><div> _circle_source->SetRadius(1);</div><div> _circle_source->SetGeneratePolygon(false);</div><div> _circle_source->SetNumberOfSides(50);</div><div> _circle_source->Update();</div><div> auto _mapper = vtkSmartPointer<vtkPolyDataMapper>::New();</div><div> _mapper->SetInputData(_circle_source->GetOutput());</div><div> auto _actor = vtkSmartPointer<vtkActor>::New();</div><div> _actor->SetMapper(_mapper);</div><div> auto _cam_pos_x = _in->GetRenderWindow()->GetRenderers()->GetFirstRenderer()->GetActiveCamera()->GetPosition()[0];</div><div> _actor->SetPosition(_cam_pos_x - 10, nipple[0], nipple[1]);</div><div><br></div><div><br></div><div> _actor->GetProperty()->SetColor(1.0, 1.0, 0.0);</div><div> _in->GetRenderWindow()->GetRenderers()->GetFirstRenderer()->AddActor(_actor);</div></div><div>}</div><div><br></div><div>The add_marker function was called in the callback of vtkCommand::LeftButtonPressEvent.</div><div>Anyone could help me to solve this problem?</div><div>Thank you.<br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div>Best regards,<br>Hugh Lo</div></div></div>
</div></div>
</blockquote></div><br></div></div></div></div>