[vtkusers] Actor -- isMovable?

Karthik Krishnan karthik.krishnan at kitware.com
Wed Nov 4 08:38:19 EST 2009


Perhaps you are referring to actor2D's that lie on the overlay plane and
don't move with the rest of the scene during interaction ? If so, to pick
it, you should us a vtkPropPicker. Cell pickers won't pick actor2D's

On Wed, Nov 4, 2009 at 8:16 AM, Cory Quammen <cquammen at cs.unc.edu> wrote:

> Hi Piotr,
>
> Perhaps you could clarify what you mean by moving an actor. It doesn't
> sound like you have an interactor style that is manipulating the
> actors by picking with the mouse. If you did, however, you could call
> PickableOff() on the actor, which will prevent you from picking it and
> thereby prevent movement of the actor.
>
> How exactly are you moving the actors now?
>
> Cory
>
> On Wed, Nov 4, 2009 at 7:21 AM, Piotr Byzia <piotr.byzia at gmail.com> wrote:
> > Hi,
> >
> > I want to set an actor to be movable or non-movable, depending on
> settings
> > which I control through PyQT GUI.
> > In other words, having a few actors on the scene I want to set checkboxes
> in
> > my GUI that would freeze a given actor, and the rest of them to react as
> > usual to the mouse movements / clicks.
> >
> > Regarding visibility of the actor I'm using GetProperty().SetOpacity(0.0)
> on
> > an instance of any given actor.
> > I can't see anything related to movement in the GetProperty() properties,
> I
> > believe it's somewhere else?
> >
> > Here are most important parts of the code I'm using to generate a single
> > actor:
> >
> > self.ren = vtk.vtkRenderer()
> > self.ren.SetBackground(0, 0, 0)
> > self.widget_3d.GetRenderWindow().AddRenderer(self.ren)
> >
> > apd=vtk.vtkAppendPolyData()
> >
> > for i in xrange(len(coordinates)):
> >    line=vtk.vtkLineSource()
> >
> >    line.SetPoint1(coordinates[i][0]) # 1st atom coordinates for a given
> bond
> >    line.SetPoint2(coordinates[i][1]) # 2nd atom coordinates for a given
> bond
> >    line.SetResolution(21)
> >    apd.AddInput(line.GetOutput())
> >
> > mapper = vtk.vtkPolyDataMapper()
> > mapper.SetInput(apd.GetOutput())
> > lines_actor = vtk.vtkActor()
> > lines_actor.SetMapper(mapper)
> > lines_actor.GetProperty().SetColor(0.7, 0.0, 0.0)
> > lines_actor.GetProperty().SetOpacity(1.0)
> >
> > self.ren.AddActor(lines_actor)
> >
> >
> > I found SetCurrentStyleToTrackballActor(), but I want to control this
> > behavior from my GUI.
> > Besides, trackball mode is very inconvenient in my case, with molecules
> in
> > "lines" representation (it's hard to pick a single line).
> >
> > Thanks,
> > Piotr Byzia
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
>
>
>
> --
> Cory Quammen
> Center for Computer Integrated Systems for Microscopy and Manipulation
> (CISMM)
> Department of Computer Science
> University of North Carolina at Chapel Hill
> http://www.cs.unc.edu/~cquammen <http://www.cs.unc.edu/%7Ecquammen>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
_________________________________
Karthik Krishnan
R&D Engineer,
Kitware Inc.
Ph: +1 5188814919, +91 9538477060
Fax: 518 371 4573
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091104/0e2e0c68/attachment.htm>


More information about the vtkusers mailing list