<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">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 vtkSphereSource in a vtkPropCollection object </div><div style="font-family: Tahoma; font-size: 10pt; ">(<span class="Apple-style-span" style="font-size: 10pt; ">actor_garbage_collection) </span>,i want to define a callback that is able to read them </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="Apple-style-span" face="Tahoma" size="2">int n=actor_garbage_collection->GetNumberOfItems();<span class="Apple-tab-span" style="white-space: pre; ">        </span></font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">                        </span>for(int i=0;i<n;i++)</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">                        </span>{</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space: pre; ">                                </span>vtkActor *actor=(vtkActor*)(actor_garbage_collection->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="Apple-tab-span" style="white-space:pre">                                </span>vtkMapper *mapper=actor->GetMapper(); </div><div style="font-family: Tahoma; font-size: 10pt; "><span class="Apple-tab-span" style="white-space:pre">                                </span>vtkDataSet* dset=mapper->GetInput();</div><div style="font-family: Tahoma; font-size: 10pt; "><span class="Apple-tab-span" style="white-space:pre">                                </span>vtkSource* source = dset->GetSource();</div><div style="font-family: Tahoma; font-size: 10pt; "><br></div><div style="font-family: Tahoma; font-size: 10pt; "><span class="Apple-tab-span" style="text-indent: 0px !important; white-space: pre; ">                                </span>// SOME COMPUTATION</div><div style="font-family: Tahoma; font-size: 10pt; "><br></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="text-indent: 0px !important; white-space: pre; ">                        </span>}</font></div><div style="font-family: Tahoma; font-size: 10pt; ">____________________________________________________________<span class="Apple-tab-span" style="white-space:pre">        </span></div></div><div style="font-family: Tahoma; font-size: 10pt; "><span class="Apple-tab-span" style="white-space:pre"><br></span></div><div style="font-family: Tahoma; font-size: 10pt; ">Well, GetNumberOfItems() returns the exact number of spheres previously inserted,</div><div style="font-family: Tahoma; font-size: 10pt; "><span class="Apple-style-span" style="font-size: 10pt; ">GetItemAsObject returns </span>a valid actor pointer - GetMapper returns a valid mapper pointer</div><div style="font-family: Tahoma; font-size: 10pt; "> and GetInput returns a 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 GetSource returns <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></body>
</html>