<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'>
<div><font class="Apple-style-span" face="Tahoma" size="2">I've verified that if i try to extract the vtkSource object (SS) immediatly after the&nbsp;</font><span class="Apple-style-span" style="font-family: Tahoma; font-size: 10pt; ">sphere "source-mapper-actor"&nbsp;</span><span class="Apple-style-span" style="font-family: Tahoma; font-size: 10pt; ">definition&nbsp;</span></div><div><font class="Apple-style-span" face="Tahoma" size="2">it result a NULL pointer.</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">See the following instructions:</font></div><div><font class="Apple-style-span" face="Tahoma" size="2">-----</font></div><div><font class="Apple-style-span" face="Tahoma" size="2">vtkSphereSource *sphere=vtkSphereSource::New();</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">                        </span>sphere-&gt;SetRadius(radius);</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">                        </span>sphere-&gt;SetCenter(pf[0],pf[1],pf[2]);</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>vtkPolyDataMapper *mapper_sphere =&nbsp;vtkPolyDataMapper&nbsp;::New();</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">                        </span>mapper_sphere-&gt;SetInput(sphere-&gt;GetOutput());</font></div><div><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="Tahoma" size="2">                        </font></span></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>vtkActor *actor_sphere = vtkActor::New();</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">                        </span>actor_sphere-&gt;SetMapper(mapper_sphere);</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">                        </span>actor_sphere-&gt;GetProperty()-&gt;SetColor(1.,0.,0.);</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>&nbsp;</font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>actor_sphere-&gt;PickableOff();</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>renderer-&gt;AddActor(actor_sphere);&nbsp;</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-&gt;GetMapper();</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"><br></font></div><div><span class="Apple-style-span" style="font-family: Tahoma; font-size: 10pt; "><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="white-space: normal;">        </span>                </span></span><span class="Apple-style-span" style="font-family: Tahoma; font-size: 10pt; ">vtkSource* SS = map-&gt;GetInput()-&gt;GetSource(); <b>&nbsp;SS is already NULL at this point!!!!!!!!!</b></span></div><div><span class="Apple-style-span" style="font-family: Tahoma; font-size: 10pt; "><b>-----</b></span></div><div><font class="Apple-style-span" face="Tahoma" size="2">Any suggestion?</font></div><br><div style="font-family: Tahoma; font-size: 10pt; "><hr id="stopSpelling">From: luigi_laneve@hotmail.com<br>To: vtkusers@vtk.org<br>Date: Fri, 9 Sep 2011 09:54:30 +0000<br>Subject: [vtkusers] FW:  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">
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="ecxstopSpelling">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>



<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>
<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<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></body>
</html>