[vtkusers] How to get a pointer to the instance of vtk***Source from vtkActor

Kjeld Vestberg Hansen kjeld at aub.dk
Tue Apr 4 03:40:14 EDT 2006


hi Masa

Her you got it

sphSource = (vtkSphereSource *)Actor->GetMapper()->GetInputAsDataSet()->GetSource();

Best regards Kjeld

> Dear all,
>
> In the following example,
> I'd like to get a pointer to the instance of vtkSphereSource class from a
> pointer to the instance of vtkActor class.
> How Can I do this?
> I mean I only know sphereActor and would like to reset the PhiResolution of
> sphere.
> -----------------------------------------------------------
> vtkSphereSource* sphere = vtkSphereSource::New();
>     sphere->SetRadius(3);
>     sphere->SetPhiResolution(10);
>     sphere->SetThetaResolution(10);
> vtkPolyDataMapper* sphereMapper = vtkPolyDataMapper::New();
>     sphereMapper->SetInput(sphere->GetOutput());
> vtkActor* sphereActor = vtkActor::New();
>     sphereActor->SetMapper(sphereMapper);
> ------------------------------------------------------------
>
> Thank you very much in advance.
>
> Cheers,
> Masa
> --
> ohsuga at nucl.phys.titech.ac.jp
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>





More information about the vtkusers mailing list