[vtkusers] FW: invalid vtkSource Pointer from vtkActor

Luigi Laneve luigi_laneve at hotmail.com
Fri Sep 9 12:21:58 EDT 2011


Ops sorry,
The code works fine in VTK 4.2, but now returns null pointer on vtk 5.2.
Do you think that in VTK is impossible to get the vtkSource from the vtkActor?



> Date: Fri, 9 Sep 2011 12:11:33 -0400
> Subject: Re: [vtkusers] FW: invalid vtkSource Pointer from vtkActor
> From: daviddoria at gmail.com
> To: luigi_laneve at hotmail.com; vtkusers at vtk.org
> 
> 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
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110909/f69a9ace/attachment.htm>


More information about the vtkusers mailing list