<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000066">
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:
<blockquote cite="mid:BLU0-SMTP966601F4283DFC280F9F0287060@phx.gbl"
type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
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";}
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";}
pre
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<div class="Section1">
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;">Hi Greg,<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"><o:p> </o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;">sometimes this happens if you use a GUI element <o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;">that embeds a vtkRenderWindow and that element does<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;">not have focus. As soon as you place the mouse in<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;">the renderwindow and click, the renderer updates.<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;">try: <o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;">planeWidgetX->GetInteractor()->Render();<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"><o:p> </o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;">Dean<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"><o:p> </o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"><a class="moz-txt-link-abbreviated" href="http://www.camris.ca">www.camris.ca</a><o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"><o:p> </o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;">I'm using a vtkImagePlaneWidget to display some 3d data, and I need to<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;">programmaticaly change the location of the current plane. I'm trying to<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;">increment or decrement the location along the current plane normal. It<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;">appears to work... but not completely. When I change points1,2,and the<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;">origin, it updates the position of the bounding box of the plane, but<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;">not the plane itself. If I try to move the plane with the middle mouse<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;">button, it suddenly jumps to where it should be and then moves normally.<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"><o:p> </o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;">Here is the code to change the location of the plane along the current<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"
lang="FR-CA">normal:<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"
lang="FR-CA"><o:p> </o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"
lang="FR-CA"> double *normal;<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"
lang="FR-CA"> double *origin;<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"
lang="FR-CA"> </span>double *p1;<o:p></o:p></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"> double *p2;<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"><o:p> </o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"> normal = planeWidgetX->GetNormal();<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"><o:p> </o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"> origin = planeWidgetX->GetOrigin();<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"> origin[0]-=normal[0]; origin[1]-=normal[1]; origin[2]-=normal[2];<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"> planeWidgetX->SetOrigin(origin);<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"><o:p> </o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"> p1 = planeWidgetX->GetPoint1();<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"> p1[0]-=normal[0]; p1[1]-=normal[1]; p1[2]-=normal[2];<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"> planeWidgetX->SetPoint1(p1);<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"><o:p> </o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"> p2 = planeWidgetX->GetPoint2();<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"> p2[0]-=normal[0]; p2[1]-=normal[1]; p2[2]-=normal[2];<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"> planeWidgetX->SetPoint2(p2);<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"><o:p> </o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"> planeWidgetX->Modified();<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"> planeWidgetX->UpdatePlacement();<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"> //planeWidgetX->GetTexturePlaneProperty()->Render();<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"> vtkWindow->Render();<o:p></o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;"><o:p> </o:p></span></font></pre>
<pre><font face="Courier New" size="2"><span style="font-size: 10pt;">How do I update the plane once I've changed it's position?<o:p></o:p></span></font></pre>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;"><o:p> </o:p></span></font></p>
</div>
</blockquote>
<br>
</body>
</html>