<div dir="ltr"><div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:100%;float:none;background-color:transparent">It may not be a good idea to delete the actor and make a new one in every</span><br style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;overflow:visible;text-decoration:none;word-spacing:0px;white-space:normal;font-size-adjust:none;font-stretch:100%;background-color:transparent"><span style="font:400 13.33px/19.99px Arial,Helvetica,sans-serif;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;font-size-adjust:none;font-stretch:100%;float:none;background-color:transparent">
call.</span></blockquote><div><br></div><div>It can work, but in addition to deleting the old actor, you have to call renderer->RemoveActor(oldactor); Otherwise the renderer's reference keeps the original actor alive.</div><div><div class="gmail_signature" dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><br></div><div>David E DeMarle<br>Kitware, Inc.<br>Principal Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4909</div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Dec 1, 2018 at 9:27 AM newcfd via vtkusers <<a href="mailto:vtkusers@public.kitware.com">vtkusers@public.kitware.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks for your reply. mapSphere was a typing error and should be mapper.<br>
I made the following changes and still have the same problem.<br>
<br>
void MyApp::redraw( const double value )<br>
{<br>
    if ( m_pActor == nullptr )<br>
    {<br>
       m_pActor = vtkActor::New();<br>
      vtkSmartPointer<vtkPolyDataMapper> mapper =<br>
vtkSmartPointer<vtkPolyDataMapper>::New();<br>
       mapper->SetScalarRange(0.0, 1.0);<br>
       m_pActor->SetMapper( mapper );<br>
<br>
       renderer->AddActor( m_pActor );<br>
       renderer->SetBackground(1,1,1); // Background color white<br>
   }<br>
<br>
   vtkStructuredGrid * mesh =...<br>
<br>
  vtkSmartPointer<vtkContourFilter> filter =<br>
  vtkSmartPointer<vtkContourFilter>::New();<br>
  filter->SetInputData( mesh );<br>
  filter->SetNumberOfContours( 1 );<br>
  filter->Setvalue( 0, value ); // value is passed in<br>
<br>
  m_pActor->GetMapper()->SetInputConnection( filter->GetOutputPort() );<br>
  renderWindow->Render();<br>
}<br>
<br>
It may not be a good idea to delete the actor and make a new one in every<br>
call.<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html</a><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote></div>