<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><div style="text-align: left;">Put this line at the end and see if it does anything.<br><br>VTK3-&gt;GetRenderer()-&gt;Render();<br></div><br><div></div><br><br><blockquote><hr id="EC_stopSpelling">From: rcpompeu@hotmail.com<br>To: frederic.danesi@dinccs.com<br>Date: Mon, 5 May 2008 15:20:36 +0000<br>CC: vtkusers@public.kitware.com<br>Subject: Re: [vtkusers] Removing Actors<br><br>

<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
<style>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Tahoma;}
</style>


I'm using a button to show/disappear an actor. <br>
<br>Here's the code:<br>
&nbsp;<br>
vtkCubeSource *cubo = vtkCubeSource::New();<br>&nbsp;&nbsp;&nbsp; cubo-&gt;SetXLength(14);<br>&nbsp;&nbsp;&nbsp; cubo-&gt;SetYLength(14);<br>&nbsp;&nbsp;&nbsp; cubo-&gt;SetZLength(14);<br>&nbsp;&nbsp;&nbsp; cubo-&gt;SetCenter(a/2,b/2,c/2);<br>
&nbsp; vtkPolyDataMapper *cuboMapper = vtkPolyDataMapper::New();<br>&nbsp;&nbsp;&nbsp; cuboMapper-&gt;SetInput(cubo-&gt;GetOutput());<br>
&nbsp; vtkActor *cubo1 = vtkActor::New();<br>&nbsp;&nbsp;&nbsp; cubo1-&gt;SetMapper(cuboMapper);<br>&nbsp;&nbsp;&nbsp; cubo1-&gt;GetProperty()-&gt;SetColor(0.52, 0.27, 0);<br>&nbsp;&nbsp;&nbsp; cubo1-&gt;GetProperty()-&gt;SetAmbient(0.2);<br>&nbsp;&nbsp;&nbsp; cubo1-&gt;GetProperty()-&gt;SetDiffuse(0.3);<br>&nbsp;&nbsp;&nbsp; cubo1-&gt;GetProperty()-&gt;SetSpecular(0.8);<br>
&nbsp;<br>
if&nbsp; (tbnCubo-&gt;Down) {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;the button is down = the cube appears<br>&nbsp;&nbsp;&nbsp; VTK3-&gt;GetRenderer()-&gt;AddActor(cubo1);<br>
}<br>
else {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// the button is up = the cube disappears&nbsp;<br>&nbsp;&nbsp;&nbsp; VTK3-&gt;GetRenderer()-&gt;RemoveActor(cubo1);<br>&nbsp;&nbsp;&nbsp; VTK3-&gt;GetRenderer()-&gt;RemoveViewProp(cubo1);<br>&nbsp;&nbsp;&nbsp; VTK3-&gt;GetRenderer()-&gt;Clear();<br>
}<br>
cubo-&gt;Delete();<br>cuboMapper-&gt;Delete();<br>cubo1-&gt;Delete();<br>
VTK3-&gt;Invalidate();<br><br>
When the button is up the actor does not disappear.<br>
&nbsp;<br>
&nbsp;<br>
&nbsp;<br>
<blockquote>
<hr>
From: frederic.danesi@dinccs.com<br>To: rcpompeu@hotmail.com<br>Subject: RE: [vtkusers] Removing Actors<br>Date: Mon, 5 May 2008 17:01:17 +0200<br><br>

<style>
.ExternalClass .EC_shape
{;}
</style>

<style>
.ExternalClass p.EC_MsoNormal, .ExternalClass li.EC_MsoNormal, .ExternalClass div.EC_MsoNormal
{margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass a:link, .ExternalClass span.EC_MsoHyperlink
{color:blue;text-decoration:underline;}
.ExternalClass a:visited, .ExternalClass span.EC_MsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
.ExternalClass p
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass span.EC_EmailStyle18
{font-family:'Calibri','sans-serif';color:#1F497D;}
.ExternalClass .EC_MsoChpDefault
{font-size:10.0pt;}
@page Section1
{size:612.0pt 792.0pt;}
.ExternalClass div.EC_Section1
{page:Section1;}
</style>

<div class="EC_EC_Section1">
<p class="EC_EC_MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125); font-family: 'Calibri','sans-serif';" lang="EN-US">Just a dumb question&nbsp;: is your outlineActor the same at each call or not ? … could you please provide us with more sourcecode (t least the code before your condition …) ?</span></p>
<p class="EC_EC_MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125); font-family: 'Calibri','sans-serif';" lang="EN-US">Fred.</span></p>
<p class="EC_EC_MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125); font-family: 'Calibri','sans-serif';" lang="EN-US">&nbsp;</span></p>
<div style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color blue; border-width: medium medium medium 1.5pt; padding: 0cm 0cm 0cm 4pt;">
<div>
<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">
<p class="EC_EC_MsoNormal"><b><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">De&nbsp;:</span></b><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"> vtkusers-bounces@vtk.org [mailto:vtkusers-bounces@vtk.org] <b>De la part de</b> Renato Cesar Pompeu<br><b>Envoyé&nbsp;:</b> lundi 5 mai 2008 15:45<br><b>À&nbsp;:</b> vtkusers@public.kitware.com<br><b>Objet&nbsp;:</b> [vtkusers] Removing Actors</span></p></div></div>
<p class="EC_EC_MsoNormal">&nbsp;</p>
<p class="EC_EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">Hello All,<br>&nbsp;</span></p>
<div id="EC_EC_result_box">
<p class="EC_EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">How do I remove an individual actor from the scene? My code does not work. Someone help me? Thanks.</span></p></div>
<p class="EC_EC_MsoNormal" style="margin-bottom: 12pt;"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">&nbsp;<br>if&nbsp; (tbnIniciar-&gt;Down) {<br>&nbsp;&nbsp;VTK3-&gt;GetRenderer()-&gt;AddActor(outlineActor);<br>&nbsp; }<br>&nbsp;<br>else {<br>&nbsp;&nbsp;&nbsp; VTK3-&gt;GetRenderer()-&gt;RemoveActor(outlineActor);<br>&nbsp;&nbsp;&nbsp; VTK3-&gt;GetRenderer()-&gt;RemoveViewProp(outlineActor);<br>&nbsp;&nbsp;&nbsp;&nbsp;VTK3-&gt;GetRenderer()-&gt;Clear();<br>&nbsp;&nbsp;&nbsp;}<br>&nbsp;<br>VTK3-&gt;Invalidate();<br><br></span></p>
<div class="EC_EC_MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">
<hr align="center" size="2" width="100%">
</span></div>
<p class="EC_EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">Notícias direto do New York Times, gols do Lance, videocassetadas e muitos outros vídeos no MSN Videos! <a href="http://video.msn.com/?mkt=pt-br" target="_blank">Confira já!</a></span></p></div></div></blockquote><br><hr>Conheça já o Windows Live Spaces, o site de relacionamentos do Messenger! <a href="http://www.amigosdomessenger.com.br" target="_blank">Crie já o seu!</a>
</blockquote><br /><hr />Hotmail on your mobile. <a href='http://www.livelife.ninemsn.com.au/article.aspx?id=343869' target='_new'>Never miss another e-mail with </a></body>
</html>