[vtk-developers] Extract vtkSource from vtkActor

Bill Lorensen bill.lorensen at gmail.com
Mon Sep 12 14:30:36 EDT 2011


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/20110912/13de6d33/attachment.html>


More information about the vtk-developers mailing list