<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
<font class="Apple-style-span" face="Tahoma" size="2">No success ... :( </font><div><font class="Apple-style-span" face="Tahoma" size="2">I've tried with the following codes:</font><div style="font-family: Tahoma; font-size: 10pt; "><br></div><div><font class="Apple-style-span" face="Tahoma" size="2">1)             sphere->Update();</font><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">              </span>//renWin->Render();</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><br></font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>vtkMapper* map = actor_sphere->GetMapper();</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space: pre; ">             </span>vtkSource* SS = map->GetInput()->GetSource(); // SS is already NULL at this point!!!!!!!!!</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><b><br></b></font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><b><br></b></font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><b><span class="Apple-style-span" style="font-weight: normal; ">2)            </span></b></font><span class="Apple-style-span" style="font-family: Tahoma; font-size: 10pt; "> //  <span style="text-indent: 0px !important; ">sphere->Update();</span></span></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span style="text-indent: 0px !important; "><span class="Apple-tab-span" style="text-indent: 0px !important; white-space: pre; ">          </span>renWin->Render();</span></font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span style="text-indent: 0px !important; "><br style="text-indent: 0px !important; "></span></font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span style="text-indent: 0px !important; "><span class="Apple-tab-span" style="text-indent: 0px !important; white-space: pre; ">                </span>vtkMapper* map = actor_sphere->GetMapper();</span></font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span style="text-indent: 0px !important; "><span class="Apple-tab-span" style="text-indent: 0px !important; white-space: pre; ">               </span>vtkSource* SS = map->GetInput()->GetSource(); </span><span style="text-indent: 0px !important; ">// SS is already NULL at this point!!!!!!!!!</span></font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span style="text-indent: 0px !important; "><br></span></font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span style="text-indent: 0px !important; "><br></span></font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span style="text-indent: 0px !important; ">3)             </span></font><font class="Apple-style-span" face="Tahoma" size="2">vtkActor *actor_sphere = vtkActor::New();</font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">             </span>actor_sphere->SetMapper(mapper_sphere);</font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">            </span>actor_sphere->GetProperty()->SetColor(1.,0.,0.);</font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span> </font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>actor_sphere->PickableOff();</font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2"><br></font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">               </span>//sphere->Update();</font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>renWin->Render();</font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2"><br></font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">          </span>renderer->AddActor(actor_sphere); //richiama Render automaticamente dopo ogni evento</font></div><div style="text-indent: 0px !important; "><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="Tahoma" size="2">               </font></span></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">              </span>vtkMapper* map = actor_sphere->GetMapper();</font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>vtkSource* SS = map->GetInput()->GetSource(); // SS is already NULL at this point!!!!!!!!!</font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span style="text-indent: 0px !important; "><br></span></font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span style="text-indent: 0px !important; "><br></span></font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span style="text-indent: 0px !important; ">4) </span></font><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span style="text-indent: 0px !important; ">            </span></font><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; ">vtkActor *actor_sphere = vtkActor::New();</font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span class="Apple-tab-span" style="text-indent: 0px !important; white-space: pre; ">              </span>actor_sphere->SetMapper(mapper_sphere);</font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span class="Apple-tab-span" style="text-indent: 0px !important; white-space: pre; ">            </span>actor_sphere->GetProperty()->SetColor(1.,0.,0.);</font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span class="Apple-tab-span" style="text-indent: 0px !important; white-space: pre; ">                </span> </font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span class="Apple-tab-span" style="text-indent: 0px !important; white-space: pre; ">                </span>actor_sphere->PickableOff();</font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><br style="text-indent: 0px !important; "></font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span class="Apple-tab-span" style="text-indent: 0px !important; white-space: pre; ">               </span>sphere->Update();</font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span class="Apple-tab-span" style="text-indent: 0px !important; white-space: pre; ">          </span>// renWin->Render();</font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><br style="text-indent: 0px !important; "></font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span class="Apple-tab-span" style="text-indent: 0px !important; white-space: pre; ">          </span>renderer->AddActor(actor_sphere); //richiama Render automaticamente dopo ogni evento</font></div><div style="text-indent: 0px !important; "><span class="Apple-tab-span" style="text-indent: 0px !important; white-space: pre; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; ">               </font></span></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span class="Apple-tab-span" style="text-indent: 0px !important; white-space: pre; ">              </span>vtkMapper* map = actor_sphere->GetMapper();</font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span class="Apple-tab-span" style="text-indent: 0px !important; white-space: pre; ">                </span>vtkSource* SS = map->GetInput()->GetSource(); // SS is already NULL at this point!!!!!!!!!</font></div><div><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><br></font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><span style="text-indent: 0px !important; "><br></span></font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2">The code before the above mentioned lines is the same indicated in the first post.</font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2"><br></font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2">Thanks for your attention.</font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2"><br></font></div><div style="text-indent: 0px !important; "><font class="Apple-style-span" face="Tahoma" size="2">Luigi.</font></div><div><font class="Apple-style-span" face="Tahoma" size="2" style="text-indent: 0px !important; "><b style="text-indent: 0px !important; "><br></b></font></div><div style="font-family: Tahoma; font-size: 10pt; "><hr id="stopSpelling">Date: Mon, 12 Sep 2011 14:30:36 -0400<br>Subject: Re: [vtk-developers] Extract vtkSource from vtkActor<br>From: bill.lorensen@gmail.com<br>To: luigi_laneve@hotmail.com<br>CC: vtk-developers@vtk.org<br><br>Try either:<br>sphere->Update();<br>or<br>->Render() on the render window<br><br><br><br><br><br><div class="ecxgmail_quote">On Mon, Sep 12, 2011 at 9:15 AM, Luigi Laneve <span dir="ltr"><<a href="mailto:luigi_laneve@hotmail.com">luigi_laneve@hotmail.com</a>></span> wrote:<br>
<blockquote class="ecxgmail_quote" style="padding-left:1ex">



<div><div dir="ltr">
<div style="font-family:Tahoma;font-size:10pt">Hello,</div><div style="font-family:Tahoma;font-size:10pt">I'm sorry if this can be an off topic question, but i've already submitted to vtkusers forum without success.</div>
<div style="font-family:Tahoma;font-size:10pt"><span style="color:rgb(42, 42, 42);line-height:17px"><br></span></div><div style="font-family:Tahoma;font-size:10pt"><span style="color:rgb(42, 42, 42);line-height:17px">I've tried to get the pointer, obtaining the vtkMapper, the vtkDataSet, and the vtkSource </span><span style="color:rgb(42, 42, 42);line-height:17px">by means of the GetInput()->GetSource() method as indicated in the following</span></div>
<div style="font-family:Tahoma;font-size:10pt"><span style="color:rgb(42, 42, 42);line-height:17px">lines:</span></div><div style="font-family:Tahoma;font-size:10pt"><br></div><div><span style="color:rgb(42, 42, 42)"><font size="2" face="Tahoma"><span style="font-family:Tahoma,Verdana,Arial,sans-serif;font-size:13px"><pre style="line-height:17px;white-space:normal">vtkSphereSource *sphere=vtkSphereSource::New();<br style="line-height:17px">sphere->SetRadius(radius);<br style="line-height:17px">sphere->SetCenter(pf[0],pf[1],pf[2]);<br style="line-height:17px">vtkPolyDataMapper *mapper_sphere = vtkPolyDataMapper ::New();<br style="line-height:17px">
mapper_sphere->SetInput(sphere->GetOutput());<br style="line-height:17px">vtkActor *actor_sphere = vtkActor::New();<br style="line-height:17px">actor_sphere->SetMapper(mapper_sphere);<br style="line-height:17px">
actor_sphere->GetProperty()->SetColor(1.,0.,0.);<br style="line-height:17px"><br style="line-height:17px">actor_sphere->PickableOff();<br style="line-height:17px">renderer->AddActor(actor_sphere);<br style="line-height:17px">
vtkMapper* map = actor_sphere->GetMapper();<br style="line-height:17px">vtkSource* SS = map->GetInput()->GetSource();  SS is already NULL at this point!!!!!!!!!</pre><pre style="line-height:17px;white-space:normal"><br></pre><pre style="line-height:17px;white-space:normal"><b>But SS is always null.</b></pre><pre style="line-height:17px;white-space:normal">In vtk 4.2 this pointer was VALID, any idea?</pre><pre style="line-height:17px;white-space:normal"><br></pre><pre style="line-height:17px;white-space:normal">Thank you, </pre><pre style="line-height:17px;white-space:normal"><br></pre><pre style="line-height:17px;white-space:normal">Luigi</pre></span></font><div style="font-family:Tahoma,Verdana,Arial,sans-serif;font-size:10pt;line-height:17px">
<div style="line-height:17px;font-family:Tahoma;font-size:10pt">____________________________________________________________<span style="line-height:17px;white-space:pre-wrap">        </span></div></div><div style="line-height:17px;font-family:Tahoma;font-size:10pt">
<span style="line-height:17px;white-space:pre-wrap"><br style="line-height:17px"></span></div><div style="line-height:17px;font-family:Tahoma;font-size:10pt">Well, GetNumberOfItems() returns the exact number of spheres previously inserted,</div>
<div style="line-height:17px;font-family:Tahoma;font-size:10pt"><span style="line-height:17px;font-size:10pt">GetItemAsObject returns </span>a valid actor pointer - GetMapper returns a valid mapper pointer</div>
<div style="line-height:17px;font-family:Tahoma;font-size:10pt"> and GetInput returns a valid dataset pointer.</div><div style="line-height:17px;font-family:Tahoma;font-size:10pt"><br style="line-height:17px">
</div><div style="line-height:17px;font-family:Tahoma;font-size:10pt">But i'm wondering how it's possible that GetSource returns <b style="line-height:17px;font-weight:bold">A NULL source pointer :(</b></div>
<div style="line-height:17px;font-family:Tahoma;font-size:10pt"><br style="line-height:17px"></div><div style="line-height:17px;font-family:Tahoma;font-size:10pt">Thanks in advance for your contribute to my question.</div>
<div style="line-height:17px;font-family:Tahoma;font-size:10pt"><br style="line-height:17px"></div><font color="#888888"><div style="line-height:17px;font-family:Tahoma;font-size:10pt">Luigi.</div></font></span></div>
<div style="font-family:Tahoma;font-size:10pt"><br></div>                                     </div></div>
<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>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
<br></blockquote></div><br></div></div></div>                                           </div></body>
</html>