<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Sorry,&nbsp; thought that I had posted this yesterday, but it seems that I
only sent it to Gerrick. So I'm posting it for posterity ;-)<br>
<br>
Hi Gerrick,<br>
<br>
Although it doesn't answer your question directly, I wrote a
BoxWidgetAdaptor class in C# that could be easily modified to do what
you want. My version ensures that a scale operation is done uniformly
in the X, Y and Z directions and also handles the ESCape key to abort
the operation. Unfortunately it requires source code changes to
vtkBoxWidget.cxx and vtkBoxWidget.h. I've included a a diff of each
file (relative to the 5.2.0 release versions) along with the fully
modified files.<br>
<br>
I hope they are useful to you.<br>
<br>
BTW, does anyone know where I should send these code changes for them
to be considered for "official integration". Is posting them here good
enough? Thanks.<br>
<br>
Gerrick Bivins wrote:
<blockquote cite="mid:C5123AFD.2E1D%25gbivins@objectreservoir.com"
 type="cite">
  <title>VtkBoxWidget: Fix translation to a single axis</title>
  <font face="Calibri, Verdana, Helvetica, Arial"><span
 style="font-size: 11pt;">Hi all,<br>
I&#8217;m using the vtkBoxWidget to move some prop3d&#8217;s &nbsp;around in my scene.
In my callback(Java), <br>
I update the transform as follows to force translation to only be along
the z-axis:<br>
/**<br>
&nbsp;&nbsp;&nbsp;&nbsp;* Method manipulateProp<br>
&nbsp;&nbsp;&nbsp;&nbsp;*<br>
&nbsp;&nbsp;&nbsp;&nbsp;*<br>
&nbsp;&nbsp;&nbsp;&nbsp;*/<br>
&nbsp;&nbsp;&nbsp;public void manipulateProp()<br>
&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(propToManipulate != null)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;boxWidget.GetTransform(transform);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vtkMatrix4x4 matrix = transform.GetMatrix();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matrix.SetElement(0, 3, lockXYPositions[0]);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matrix.SetElement(1, 3, lockXYPositions[1]);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;propToManipulate.SetUserTransform(transform);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;boxWidget.SetTransform(transform);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;}<br>
  <br>
This works as expected however there is an output window that is
reporting this deprecation error:<br>
&#8220;Warning: In /Users/gbivins/work/APIs/VTK/Common/vtkTransform.cxx, line
202<br>
vtkTransform (0x2295e91e0): InternalUpdate: doing hack to support
legacy code. &nbsp;This is deprecated in VTK 4.2. &nbsp;May be removed in a
future version.&#8221;<br>
  <br>
What is the proper way to update the transform in my case to avoid the
legacy code?<br>
I&#8217;m using VTK 5.2 with Java wrappings on Mac OSX 10.5.5<br>
Gerrick<br>
  </span></font></blockquote>
<div class="moz-signature">-- <br>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>Signature</title>
<a href="http:://www.infolytica.com">www.infolytica.com </a><br>
300 Leo Pariseau, Suite 2222, Montreal, QC, Canada, H2X 4B3<br>
(514) 849-8752 x236, Fax: (514) 849-4239
</div>
</body>
</html>