[vtkusers] Again: How to scale widget representations based on scale interactions with a different widget?
Karthik Krishnan
karthik.krishnan at kitware.com
Wed Jun 17 15:02:06 EDT 2009
On Wed, Jun 17, 2009 at 10:20 AM, kent williams
<nkwmailinglists at gmail.com>wrote:
> Again very simple: I have vtkHandleWidget instances in multiple views.
> When I scale the handle in one view, I'd like the other instances to
> scale as well.
>
> What I've discovered since my last post on the subject:
>
> 1. Trying to observe vtkWidgetEvent::Scale and
> vtkWidgetEvent::EndScale is wrong. This is clear to me now from the
> Doxygen page for vtkHandleWidget, but it bears repeating, because it
> was my first impulse on how to catch scale events.
>
> 2. There's no way to recover the scaling from the handle
> representation, or set the scaling of the representation.
>
> 3. You can't really share vtkHandleRepresentations between
> vtkHandleWidget instances. Well you can, and if you do, scaling in
> one Widget will update the others. But the position is stored in the
> representation, and it puts the handle in the other views at the same
> display coordinates -- which is wrong.
>
> The only way I can see to do this is to write my own subclass for my
> chosen representation, and expose methods to set and get the scaling.
> Right?
Or contribute a patch :)
You are right, in that the scaling isn't directly exposed. Its internally
computed by using a vtkTransform (represented by a 4x4 matrix) in response
to interaction. You can expose it quite easily by setting the diagonal
elements of the matrix representing the transform.
Thanks
--
karthik
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090617/14c75ee4/attachment.htm>
More information about the vtkusers
mailing list