<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Ops sorry,<div><br></div><div>The code works fine in VTK 4.2, but now returns null pointer on vtk 5.2.</div><div><br></div><div>Do you think that in VTK is impossible to get the vtkSource from the vtkActor?</div><div><br></div><div><br></div><div><br><br><div>> Date: Fri, 9 Sep 2011 12:11:33 -0400<br>> Subject: Re: [vtkusers] FW: invalid vtkSource Pointer from vtkActor<br>> From: daviddoria@gmail.com<br>> To: luigi_laneve@hotmail.com; vtkusers@vtk.org<br>> <br>> On Fri, Sep 9, 2011 at 12:07 PM, Luigi Laneve <luigi_laneve@hotmail.com> wrote:<br>> > vtkSource can be a vtkSphereSource or a vtkTubeFilter.<br>> > During a mouse move event callback i want to modify its dimensions as a<br>> > function of "camera-source" distance.<br>> > if ((source->IsA("vtkSphereSource"))==1)<br>> > {<br>> > float *center=(float*)(((vtkSphereSource*)source)->GetCenter());<br>> > double<br>> > radius=distance(position[0],position[1],position[2],center[0],center[1],center[2])*d_marker;<br>> > ((vtkSphereSource*)source)->SetRadius(radius);<br>> > }<br>> > if ((source->IsA("vtkTubeFilter"))==1)<br>> > {<br>> > double<br>> > radius=distance(position[0],position[1],position[2],0,0,0)*d_marker*0.5;<br>> > ((vtkTubeFilter*)source)->SetRadius(radius);<br>> > }<br>> > }<br>> <br>> Please keep your replies on the mailing list.<br>> <br>> Oh, I see. I've never used GetSource(), so I'm not sure if it is<br>> supposed to return what you are looking for or not. I can confirm that<br>> is NULL where you have said though.<br>> <br>> David<br></div></div>                                            </div></body>
</html>