<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 </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 vtkSphereSource in a vtkPropCollection object </div><div style="font-family:Tahoma;font-size:10pt">(<span class="ecxApple-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="ecxApple-style-span" face="Tahoma" size="2">int n=actor_garbage_collection->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<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->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->GetMapper(); </div><div style="font-family:Tahoma;font-size:10pt"><span class="ecxApple-tab-span" style="white-space:pre">                                </span>vtkDataSet* dset=mapper->GetInput();</div><div style="font-family:Tahoma;font-size:10pt"><span class="ecxApple-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="ecxApple-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="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, GetNumberOfItems() returns 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 </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>
<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>