<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:#000066;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:#000066;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:#000066;}
pre
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:#000066;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:Arial;
        color:windowtext;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor=white lang=EN-CA link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>It might be that you are accessing and
modifying pointers<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>directly:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<pre style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
lang=FR-CA style='font-size:10.0pt'> double *normal;<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
lang=FR-CA style='font-size:10.0pt'> double *origin;<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
lang=FR-CA style='font-size:10.0pt'> double *p1;<o:p></o:p></span><u1:p></u1:p></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
lang=FR-CA style='font-size:10.0pt'> </span>double *p2;<o:p></o:p></font></pre><u1:p></u1:p><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'><u1:p> </u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'> normal = planeWidgetX->GetNormal();<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'><u1:p> </u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'> origin = planeWidgetX->GetOrigin();<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'> origin[0]-=normal[0]; origin[1]-=normal[1]; origin[2]-=normal[2];<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'> planeWidgetX->SetOrigin(origin);<u1:p></u1:p><o:p></o:p></span></font></pre>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><u1:p><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>try using <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>double normal[3];<o:p></o:p></span></font></p>
<pre><font size=2 color="#000066" face="Courier New"><span style='font-size:
10.0pt'>planeWidgetX->GetNormal(normal);<u1:p></u1:p><o:p></o:p></span></font></pre><pre><font
size=2 color="#000066" face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color="#000066" face="Courier New"><span style='font-size:10.0pt'>etc. also, you do not need to call<o:p></o:p></span></font></pre><pre><font
size=2 color="#000066" face="Courier New"><span style='font-size:10.0pt'>planeWidgetX->Modified();<u1:p></u1:p><o:p></o:p></span></font></pre><pre><font
size=2 color="#000066" face="Courier New"><span style='font-size:10.0pt'>just<o:p></o:p></span></font></pre><pre><font
size=2 color="#000066" face="Courier New"><span style='font-size:10.0pt'>planeWidgetX->UpdatePlacement();<u1:p></u1:p><o:p></o:p></span></font></pre><pre><font
size=2 color="#000066" face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 color="#000066" face="Courier New"><span style='font-size:10.0pt'>Dean<o:p></o:p></span></font></pre><pre><font
size=2 color="#000066" face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><u1:p><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='margin-left:36.0pt;text-align:center'><font
size=3 color=black face="Times New Roman"><span lang=EN-US style='font-size:
12.0pt;color:windowtext'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal style='margin-left:36.0pt'><b><font size=2 color=black
face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma;
color:windowtext;font-weight:bold'>From:</span></font></b><font size=2
color=black face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:
Tahoma;color:windowtext'> Greg Book [mailto:gbook@gbook.org] <br>
<b><span style='font-weight:bold'>Sent:</span></b> August-10-09 5:03 PM<br>
<b><span style='font-weight:bold'>To:</span></b> dean.inglis@camris.ca<br>
<b><span style='font-weight:bold'>Cc:</span></b> vtkusers@vtk.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [vtkusers] updating
plane placement in vtkImagePlaneWidget</span></font><font color=black><span
lang=EN-US style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=3 color="#000066"
face="Times New Roman"><span style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-left:36.0pt'><font size=3 color="#000066"
face="Times New Roman"><span style='font-size:12.0pt'>Unfortunately adding that
line didn't work out. It updates the texture when I execute the code below, and
it even updates the outline on the plane, but it doesn't update the position of
the plane... so as I change the slice along the normal, the texture appears to
change, but its location in 3d does not.<br>
-Greg<br>
<br>
<br>
Dean Inglis wrote: <o:p></o:p></span></font></p>
<pre style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'>Hi Greg,<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'><u1:p> </u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'>sometimes this happens if you use a GUI element <u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'>that embeds a vtkRenderWindow and that element does<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'>not have focus. As soon as you place the mouse in<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'>the renderwindow and click, the renderer updates.<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'>try: <u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'>planeWidgetX->GetInteractor()->Render();<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'><u1:p> </u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'>Dean<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'><u1:p> </u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'><a href="http://www.camris.ca">www.camris.ca</a><u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'><u1:p> </u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'>I'm using a vtkImagePlaneWidget to display some 3d data, and I need to<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'>programmaticaly change the location of the current plane. I'm trying to<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'>increment or decrement the location along the current plane normal. It<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'>appears to work... but not completely. When I change points1,2,and the<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'>origin, it updates the position of the bounding box of the plane, but<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'>not the plane itself. If I try to move the plane with the middle mouse<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'>button, it suddenly jumps to where it should be and then moves normally.<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'><u1:p> </u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'>Here is the code to change the location of the plane along the current<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
lang=FR-CA style='font-size:10.0pt'>normal:<u1:p></u1:p></span><o:p></o:p></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
lang=FR-CA style='font-size:10.0pt'><u1:p> </u1:p></span><o:p></o:p></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
lang=FR-CA style='font-size:10.0pt'> double *normal;<u1:p></u1:p></span><o:p></o:p></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
lang=FR-CA style='font-size:10.0pt'> double *origin;<u1:p></u1:p></span><o:p></o:p></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
lang=FR-CA style='font-size:10.0pt'> </span>double *p1;<u1:p></u1:p><o:p></o:p></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'> double *p2;<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'><u1:p> </u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'> normal = planeWidgetX->GetNormal();<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'><u1:p> </u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'> origin = planeWidgetX->GetOrigin();<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'> origin[0]-=normal[0]; origin[1]-=normal[1]; origin[2]-=normal[2];<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'> planeWidgetX->SetOrigin(origin);<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'><u1:p> </u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'> p1 = planeWidgetX->GetPoint1();<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'> p1[0]-=normal[0]; p1[1]-=normal[1]; p1[2]-=normal[2];<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'> planeWidgetX->SetPoint1(p1);<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'><u1:p> </u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'> p2 = planeWidgetX->GetPoint2();<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'> p2[0]-=normal[0]; p2[1]-=normal[1]; p2[2]-=normal[2];<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'> planeWidgetX->SetPoint2(p2);<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'><u1:p> </u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'> planeWidgetX->Modified();<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'> planeWidgetX->UpdatePlacement();<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'> //planeWidgetX->GetTexturePlaneProperty()->Render();<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'> vtkWindow->Render();<u1:p></u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'><u1:p> </u1:p><o:p></o:p></span></font></pre><pre
style='margin-left:36.0pt'><font size=2 color="#000066" face="Courier New"><span
style='font-size:10.0pt'>How do I update the plane once I've changed it's position?<u1:p></u1:p><o:p></o:p></span></font></pre>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color="#000066"
face=Arial><span style='font-size:10.0pt;font-family:Arial'><u1:p> </u1:p></span></font><o:p></o:p></p>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color="#000066"
face=Arial><span style='font-size:10.0pt;font-family:Arial'><u1:p> </u1:p></span></font><o:p></o:p></p>
<p class=MsoNormal style='margin-left:36.0pt'><font size=3 color="#000066"
face="Times New Roman"><span style='font-size:12.0pt'><u1:p> </u1:p><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:36.0pt'><font size=3 color="#000066"
face="Times New Roman"><span style='font-size:12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>