[vtk-developers] Extract vtkSource from vtkActor

Luigi Laneve luigi_laneve at hotmail.com
Tue Sep 13 06:28:49 EDT 2011


No success ... :( I've tried with the following codes:
1)             sphere->Update();		//renWin->Render();
		vtkMapper* map = actor_sphere->GetMapper();		vtkSource* SS = map->GetInput()->GetSource(); // SS is already NULL at this point!!!!!!!!!

2)             //  sphere->Update();		renWin->Render();		vtkMapper* map = actor_sphere->GetMapper();		vtkSource* SS = map->GetInput()->GetSource(); // SS is already NULL at this point!!!!!!!!!

3)             vtkActor *actor_sphere = vtkActor::New();		actor_sphere->SetMapper(mapper_sphere);		actor_sphere->GetProperty()->SetColor(1.,0.,0.);		 		actor_sphere->PickableOff();
		//sphere->Update();		renWin->Render();
		renderer->AddActor(actor_sphere); //richiama Render automaticamente dopo ogni evento				vtkMapper* map = actor_sphere->GetMapper();		vtkSource* SS = map->GetInput()->GetSource(); // SS is already NULL at this point!!!!!!!!!

4)             vtkActor *actor_sphere = vtkActor::New();		actor_sphere->SetMapper(mapper_sphere);		actor_sphere->GetProperty()->SetColor(1.,0.,0.);		 		actor_sphere->PickableOff();		sphere->Update();		// renWin->Render();		renderer->AddActor(actor_sphere); //richiama Render automaticamente dopo ogni evento				vtkMapper* map = actor_sphere->GetMapper();		vtkSource* SS = map->GetInput()->GetSource(); // SS is already NULL at this point!!!!!!!!!

The code before the above mentioned lines is the same indicated in the first post.
Thanks for your attention.
Luigi.
Date: Mon, 12 Sep 2011 14:30:36 -0400
Subject: Re: [vtk-developers] Extract vtkSource from vtkActor
From: bill.lorensen at gmail.com
To: luigi_laneve at hotmail.com
CC: vtk-developers at vtk.org

Try either:
sphere->Update();
or
->Render() on the render window





On Mon, Sep 12, 2011 at 9:15 AM, Luigi Laneve <luigi_laneve at hotmail.com> wrote:






Hello,I'm sorry if this can be an off topic question, but i've already submitted to vtkusers forum without success.

I've tried to get the pointer, obtaining the vtkMapper, the vtkDataSet, and the vtkSource by means of the GetInput()->GetSource() method as indicated in the following
lines:
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!!!!!!!!!
But SS is always null.In vtk 4.2 this pointer was VALID, any idea?
Thank you, 
Luigi
____________________________________________________________	
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



Follow this link to subscribe/unsubscribe:

http://www.vtk.org/mailman/listinfo/vtk-developers





 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20110913/cbeff3a7/attachment.html>


More information about the vtk-developers mailing list