<!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, 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’m using the vtkBoxWidget to move some prop3d’s 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>
* Method manipulateProp<br>
*<br>
*<br>
*/<br>
public void manipulateProp()<br>
{<br>
if(propToManipulate != null)<br>
{<br>
boxWidget.GetTransform(transform);<br>
vtkMatrix4x4 matrix = transform.GetMatrix();<br>
matrix.SetElement(0, 3, lockXYPositions[0]);<br>
matrix.SetElement(1, 3, lockXYPositions[1]);<br>
propToManipulate.SetUserTransform(transform);<br>
boxWidget.SetTransform(transform);<br>
}<br>
}<br>
<br>
This works as expected however there is an output window that is
reporting this deprecation error:<br>
“Warning: In /Users/gbivins/work/APIs/VTK/Common/vtkTransform.cxx, line
202<br>
vtkTransform (0x2295e91e0): InternalUpdate: doing hack to support
legacy code. This is deprecated in VTK 4.2. May be removed in a
future version.”<br>
<br>
What is the proper way to update the transform in my case to avoid the
legacy code?<br>
I’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>