[vtkusers] invalid vtkSource Pointer from vtkActor

Luigi Laneve luigi_laneve at hotmail.com
Wed Sep 7 12:43:34 EDT 2011


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.



 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110907/68f7c554/attachment.htm>


More information about the vtkusers mailing list