[vtkusers] FW: invalid vtkSource Pointer from vtkActor

David Doria daviddoria at gmail.com
Fri Sep 9 12:11:33 EDT 2011


On Fri, Sep 9, 2011 at 12:07 PM, Luigi Laneve <luigi_laneve at hotmail.com> wrote:
> vtkSource can be a vtkSphereSource or a vtkTubeFilter.
> During a mouse move event callback i want to modify its dimensions as a
> function of "camera-source" distance.
> if ((source->IsA("vtkSphereSource"))==1)
> {
> float *center=(float*)(((vtkSphereSource*)source)->GetCenter());
> double
> radius=distance(position[0],position[1],position[2],center[0],center[1],center[2])*d_marker;
> ((vtkSphereSource*)source)->SetRadius(radius);
> }
> if ((source->IsA("vtkTubeFilter"))==1)
> {
> double
> radius=distance(position[0],position[1],position[2],0,0,0)*d_marker*0.5;
> ((vtkTubeFilter*)source)->SetRadius(radius);
> }
> }

Please keep your replies on the mailing list.

Oh, I see. I've never used GetSource(), so I'm not sure if it is
supposed to return what you are looking for or not. I can confirm that
is NULL where you have said though.

David



More information about the vtkusers mailing list