Hi,<br><br>The deletion with Delete( ) won&#39;t remove the line because... the line is used by the renderer (Take a look at the object factory, garbage collector, reference counter and all these stuff). I suggest you to remove the actor from the renderer... With, for instance, ren-&gt;RemoveActor( actor1 );<br>
<br>Or, if you want, you can set the background color to the line color...<br><br>HTH<br><br>Jerome<br><br><div class="gmail_quote">2009/5/14 luciangoron <span dir="ltr">&lt;<a href="mailto:luciangoron@gmail.com">luciangoron@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
I have a simple code here:<br>
<br>
I &quot;print&quot; 2 lines, and than I want to &quot;delete&quot; the first one... (I want to<br>
NOT see it anymore)<br>
<br>
#include &quot;../common/CommonVTKRoutines.h&quot;<br>
#include &quot;../common/CommonANNRoutines.h&quot;<br>
#include &quot;../common/Common3DGeomRoutines.h&quot;<br>
#include &quot;../common/CommonIORoutines.h&quot;<br>
#include &quot;../common/CommonTerminalRoutines.h&quot;<br>
#include &quot;../common/ANN-VTK.h&quot;<br>
<br>
using namespace cANN;<br>
using namespace std;<br>
<br>
int main (int argc, char** argv)<br>
{<br>
  // create vtk renderer and vtk interactor //<br>
  vtkRenderer *ren = vtkRenderer::New ();<br>
  ren-&gt;SetBackground (0, 0, 0);<br>
  vtkRenderWindowInteractor *iren = CreateRenderWindowAndInteractor (ren,<br>
&quot;TEST&quot;, argc, argv);<br>
<br>
  // first line //<br>
  vtkLineSource *line1 = vtkLineSource::New();<br>
  line1-&gt;SetPoint1 (1.0, 1.0, 1.0);<br>
  line1-&gt;SetPoint2 (1.5, 1.5, 1.5);<br>
  vtkActor *actor1 = createActorFromDataSet (line1-&gt;GetOutput(), false);<br>
  actor1-&gt;GetProperty()-&gt;SetColor (1, 0, 0);<br>
  ren-&gt;AddActor(actor1);<br>
<br>
  // do a refresh //<br>
  iren-&gt;Render();<br>
  iren-&gt;Start();<br>
<br>
  // second line //<br>
  vtkLineSource *line2 = vtkLineSource::New();<br>
  line2-&gt;SetPoint1 (0.5, 1.0, 1.5);<br>
  line2-&gt;SetPoint2 (1.5, 1.0, 0.5);<br>
  vtkActor *actor2 = createActorFromDataSet (line2-&gt;GetOutput(), false);<br>
  actor2-&gt;GetProperty()-&gt;SetColor (0, 1, 0);<br>
  ren-&gt;AddActor(actor2);<br>
<br>
  // do a refresh //<br>
  iren-&gt;Render();<br>
  iren-&gt;Start();<br>
<br>
  // suppose to delete de line //<br>
  line1-&gt;Delete();<br>
  actor1-&gt;Delete();<br>
<br>
  // do a refresh //<br>
  iren-&gt;Render();<br>
  iren-&gt;Start();<br>
<br>
  return 0;<br>
}<br>
<br>
PS : Please do not send me suggestions such as :<br>
<br>
&quot; Why don&#39;t you color the line which you want to delete in black.. &quot;<br>
<br>
Thanks in advance !<br>
--<br>
View this message in context: <a href="http://www.nabble.com/How-to-delete-a-line---tp23501139p23501139.html" target="_blank">http://www.nabble.com/How-to-delete-a-line---tp23501139p23501139.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" 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" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br>