Try either:<br>sphere->Update();<br>or<br>->Render() on the render window<br><br><br><br><br><br><div class="gmail_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="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); 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>