<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'>
Please,<div><br></div><div>Any suggestion?</div><div><br></div><div>In the meantime i've verified how the bounds and the center position</div><div>of the mapper object is exactly the same of the previously inserted&nbsp;</div><div>sphere.</div><div><br></div><div>Thank you.</div><div><br><div><hr id="stopSpelling">From: luigi_laneve@hotmail.com<br>To: vtkusers@vtk.org<br>Date: Wed, 7 Sep 2011 16:43:34 +0000<br>Subject: [vtkusers] invalid vtkSource Pointer from vtkActor<br><br>

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

</style>

<div dir="ltr">
<font class="ecxApple-style-span" face="Tahoma" size="2">Hi to all,</font><div style="font-family:Tahoma;font-size:10pt"><br></div><div style="font-family:Tahoma;font-size:10pt">After loading a certain number of&nbsp;vtkSphereSource in a vtkPropCollection object&nbsp;</div><div style="font-family:Tahoma;font-size:10pt">(<span class="ecxApple-style-span" style="font-size:10pt">actor_garbage_collection)&nbsp;</span>,i want to define a callback that is able to read them&nbsp;</div><div style="font-family:Tahoma;font-size:10pt">in order to make some calculations.</div><div style="font-family:Tahoma;font-size:10pt">____________________________________________________________</div><div><div><font class="ecxApple-style-span" face="Tahoma" size="2">int n=actor_garbage_collection-&gt;GetNumberOfItems();<span class="ecxApple-tab-span" style="white-space:pre">        </span></font></div><div><font class="ecxApple-style-span" face="Tahoma" size="2"><span class="ecxApple-tab-span" style="white-space:pre">                        </span>for(int i=0;i&lt;n;i++)</font></div><div><font class="ecxApple-style-span" face="Tahoma" size="2"><span class="ecxApple-tab-span" style="white-space:pre">                        </span>{</font></div><div><font class="ecxApple-style-span" face="Tahoma" size="2"><span class="ecxApple-tab-span" style="white-space:pre">                                </span>vtkActor *actor=(vtkActor*)(actor_garbage_collection-&gt;GetItemAsObject(i));</font></div></div><div style="font-family:Tahoma;font-size:10pt"><br></div><div><div style="font-family:Tahoma;font-size:10pt"><span class="ecxApple-tab-span" style="white-space:pre">                                </span>vtkMapper *mapper=actor-&gt;GetMapper();&nbsp;</div><div style="font-family:Tahoma;font-size:10pt"><span class="ecxApple-tab-span" style="white-space:pre">                                </span>vtkDataSet* dset=mapper-&gt;GetInput();</div><div style="font-family:Tahoma;font-size:10pt"><span class="ecxApple-tab-span" style="white-space:pre">                                </span>vtkSource* source = dset-&gt;GetSource();</div><div style="font-family:Tahoma;font-size:10pt"><br></div><div style="font-family:Tahoma;font-size:10pt"><span class="ecxApple-tab-span" style="text-indent:0px !important;white-space:pre">                                </span>//&nbsp;SOME COMPUTATION</div><div style="font-family:Tahoma;font-size:10pt"><br></div><div><font class="ecxApple-style-span" face="Tahoma" size="2"><span class="ecxApple-tab-span" style="text-indent:0px !important;white-space:pre">                        </span>}</font></div><div style="font-family:Tahoma;font-size:10pt">____________________________________________________________<span class="ecxApple-tab-span" style="white-space:pre">        </span></div></div><div style="font-family:Tahoma;font-size:10pt"><span class="ecxApple-tab-span" style="white-space:pre"><br></span></div><div style="font-family:Tahoma;font-size:10pt">Well,&nbsp;GetNumberOfItems() returns&nbsp;the exact number of spheres previously inserted,</div><div style="font-family:Tahoma;font-size:10pt"><span class="ecxApple-style-span" style="font-size:10pt">GetItemAsObject returns&nbsp;</span>a valid actor pointer&nbsp;-&nbsp;GetMapper&nbsp;returns&nbsp;a valid mapper pointer</div><div style="font-family:Tahoma;font-size:10pt">&nbsp;and&nbsp;GetInput returns a&nbsp;valid dataset pointer.</div><div style="font-family:Tahoma;font-size:10pt"><br></div><div style="font-family:Tahoma;font-size:10pt">But i'm wondering how it's possible that&nbsp;GetSource returns&nbsp;<b>A NULL source pointer :(</b></div><div style="font-family:Tahoma;font-size:10pt"><br></div><div style="font-family:Tahoma;font-size:10pt">Thanks in advance for your contribute to my question.</div><div style="font-family:Tahoma;font-size:10pt"><br></div><div style="font-family:Tahoma;font-size:10pt">Luigi.</div><div style="font-family:Tahoma;font-size:10pt"><br></div><div style="font-family:Tahoma;font-size:10pt"><br></div><div style="font-family:Tahoma;font-size:10pt"><br></div><div style="font-family:Tahoma;font-size:10pt"><br></div>                                               </div>
<br>_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers</div></div>                                               </div></body>
</html>