<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 </font><span class="Apple-style-span" style="font-family: Tahoma; font-size: 10pt; ">sphere "source-mapper-actor" </span><span class="Apple-style-span" style="font-family: Tahoma; font-size: 10pt; ">definition </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->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->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 = vtkPolyDataMapper ::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->SetInput(sphere->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->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->GetProperty()->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> </font></div><div><font class="Apple-style-span" face="Tahoma" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>actor_sphere->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->AddActor(actor_sphere); </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->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->GetInput()->GetSource(); <b> 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 </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 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>
<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>