try to disable the interactor style set on teh interactor<br><br>interactor-&gt;GetInteractorStyle()-&gt;EnabledOff()<br><br><div class="gmail_quote">On Wed, Nov 4, 2009 at 10:35 AM, Piotr Byzia <span dir="ltr">&lt;<a href="mailto:piotr.byzia@gmail.com">piotr.byzia@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Cory and Karthik,<br>
<br>
Thank you for your suggestions.<br>
<br>
By moving, I meant an interaction with a mouse.<br>
Indeed, I have no interaction style defined explicitly, but it seems that Python interface has some default one set up, because I was able to run this:<br>
<br>
lines_actor.PickableOff()<br>
print lines_actor.GetPickable()<br>
lines_actor.PickableOn()<br>
print lines_actor.GetPickable()<br>
lines_actor.SetPickable(0)<br>
print lines_actor.GetPickable()<br>
<br>
which produced:<br>
0<br>
1<br>
0<br>
<br>
(I apologize if this is something obvious for you, I just started experimenting with VTK)<br>
So, vtkActor() has an interaction style by default, thus I was able to call PickableOff() on it.<br>
However it does not work, while I was able to pick and move around (rotate) lines_actor with the mouse.<br>
<br>
I had the same issue with lines_actor.DragableOff().<br>
<br>
What is surprising, lines_actor.VisibilityOff() works fine! (lines_actor was not visible on the scene)<br>
<br>
Do you possibly have ideas what can interfere with the PickableOff() ??<br>
<br>
Thanks for any suggestions,<br><font color="#888888">
Piotr Byzia</font><div><div></div><div class="h5"><br>
<br>
<br>
On 04.11.2009, at 14:16, Cory Quammen wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Piotr,<br>
<br>
Perhaps you could clarify what you mean by moving an actor. It doesn&#39;t<br>
sound like you have an interactor style that is manipulating the<br>
actors by picking with the mouse. If you did, however, you could call<br>
PickableOff() on the actor, which will prevent you from picking it and<br>
thereby prevent movement of the actor.<br>
<br>
How exactly are you moving the actors now?<br>
<br>
Cory<br>
<br>
On Wed, Nov 4, 2009 at 7:21 AM, Piotr Byzia &lt;<a href="mailto:piotr.byzia@gmail.com" target="_blank">piotr.byzia@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
I want to set an actor to be movable or non-movable, depending on settings<br>
which I control through PyQT GUI.<br>
In other words, having a few actors on the scene I want to set checkboxes in<br>
my GUI that would freeze a given actor, and the rest of them to react as<br>
usual to the mouse movements / clicks.<br>
<br>
Regarding visibility of the actor I&#39;m using GetProperty().SetOpacity(0.0) on<br>
an instance of any given actor.<br>
I can&#39;t see anything related to movement in the GetProperty() properties, I<br>
believe it&#39;s somewhere else?<br>
<br>
Here are most important parts of the code I&#39;m using to generate a single<br>
actor:<br>
<br>
self.ren = vtk.vtkRenderer()<br>
self.ren.SetBackground(0, 0, 0)<br>
self.widget_3d.GetRenderWindow().AddRenderer(self.ren)<br>
<br>
apd=vtk.vtkAppendPolyData()<br>
<br>
for i in xrange(len(coordinates)):<br>
   line=vtk.vtkLineSource()<br>
<br>
   line.SetPoint1(coordinates[i][0]) # 1st atom coordinates for a given bond<br>
   line.SetPoint2(coordinates[i][1]) # 2nd atom coordinates for a given bond<br>
   line.SetResolution(21)<br>
   apd.AddInput(line.GetOutput())<br>
<br>
mapper = vtk.vtkPolyDataMapper()<br>
mapper.SetInput(apd.GetOutput())<br>
lines_actor = vtk.vtkActor()<br>
lines_actor.SetMapper(mapper)<br>
lines_actor.GetProperty().SetColor(0.7, 0.0, 0.0)<br>
lines_actor.GetProperty().SetOpacity(1.0)<br>
<br>
self.ren.AddActor(lines_actor)<br>
<br>
<br>
I found SetCurrentStyleToTrackballActor(), but I want to control this<br>
behavior from my GUI.<br>
Besides, trackball mode is very inconvenient in my case, with molecules in<br>
&quot;lines&quot; representation (it&#39;s hard to pick a single line).<br>
<br>
Thanks,<br>
Piotr Byzia<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at:<br>
<a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br>
</blockquote>
<br>
<br>
<br>
-- <br>
Cory Quammen<br>
Center for Computer Integrated Systems for Microscopy and Manipulation (CISMM)<br>
Department of Computer Science<br>
University of North Carolina at Chapel Hill<br>
<a href="http://www.cs.unc.edu/%7Ecquammen" target="_blank">http://www.cs.unc.edu/~cquammen</a><br>
</blockquote>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br><br>