[vtkusers] FW: invalid vtkSource Pointer from vtkActor
Luigi Laneve
luigi_laneve at hotmail.com
Fri Sep 9 11:33:13 EDT 2011
I've verified that if i try to extract the vtkSource object (SS) immediatly after the sphere "source-mapper-actor" definition it result a NULL pointer.
See the following instructions:-----vtkSphereSource *sphere=vtkSphereSource::New(); sphere->SetRadius(radius); sphere->SetCenter(pf[0],pf[1],pf[2]);
vtkPolyDataMapper *mapper_sphere = vtkPolyDataMapper ::New(); mapper_sphere->SetInput(sphere->GetOutput()); vtkActor *actor_sphere = vtkActor::New(); actor_sphere->SetMapper(mapper_sphere); actor_sphere->GetProperty()->SetColor(1.,0.,0.); actor_sphere->PickableOff();
renderer->AddActor(actor_sphere); vtkMapper* map = actor_sphere->GetMapper();
vtkSource* SS = map->GetInput()->GetSource(); SS is already NULL at this point!!!!!!!!!-----Any suggestion?
From: luigi_laneve at hotmail.com
To: vtkusers at vtk.org
Date: Fri, 9 Sep 2011 09:54:30 +0000
Subject: [vtkusers] FW: invalid vtkSource Pointer from vtkActor
Please,
Any suggestion?
In the meantime i've verified how the bounds and the center positionof the mapper object is exactly the same of the previously inserted sphere.
Thank you.
From: luigi_laneve at hotmail.com
To: vtkusers at vtk.org
Date: Wed, 7 Sep 2011 16:43:34 +0000
Subject: [vtkusers] invalid vtkSource Pointer from vtkActor
Hi to all,
After loading a certain number of vtkSphereSource in a vtkPropCollection object (actor_garbage_collection) ,i want to define a callback that is able to read them in order to make some calculations.____________________________________________________________int n=actor_garbage_collection->GetNumberOfItems(); for(int i=0;i<n;i++) { vtkActor *actor=(vtkActor*)(actor_garbage_collection->GetItemAsObject(i));
vtkMapper *mapper=actor->GetMapper(); vtkDataSet* dset=mapper->GetInput(); vtkSource* source = dset->GetSource();
// SOME COMPUTATION
}____________________________________________________________
Well, GetNumberOfItems() returns the exact number of spheres previously inserted,GetItemAsObject returns a valid actor pointer - GetMapper returns a valid mapper pointer and GetInput returns a valid dataset pointer.
But i'm wondering how it's possible that GetSource returns A NULL source pointer :(
Thanks in advance for your contribute to my question.
Luigi.
_______________________________________________
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
_______________________________________________
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
_______________________________________________
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110909/cf5bcab1/attachment.htm>
More information about the vtkusers
mailing list