<div>Hi,</div><div><br></div><div>I use BorderWidget on the vtkImageViewer2 to select area. After I set the initial left bottom and right top corner and enable it, I can't move the borderWidget. Why?</div><div><br></div><div>And when I drag the left bottom corner, the right top corner will change automatically. Can any guy tell me what happens?</div><div><br></div><div>Below is the C# code for BorderWidget:</div><div><br></div><div><p><font face="Consolas" size="2"><font face="Consolas" size="2">vtkBorderWidget m_areaSegment = </font></font><font color="#2b91af" face="Consolas" size="2"><font color="#2b91af" face="Consolas" size="2"><font color="#2b91af" face="Consolas" size="2">vtkBorderWidget</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2">.New();</font></font></p><font face="Consolas" size="2"><font face="Consolas" size="2">
<p> m_areaSegment.SetInteractor( m_renderWindow.GetInteractor() );</p>
</font></font><p><font face="Consolas" size="2"><font face="Consolas" size="2"> </font></font><font color="#2b91af" face="Consolas" size="2"><font color="#2b91af" face="Consolas" size="2"><font color="#2b91af" face="Consolas" size="2">vtkBorderRepresentation</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> rep = </font></font><font color="#2b91af" face="Consolas" size="2"><font color="#2b91af" face="Consolas" size="2"><font color="#2b91af" face="Consolas" size="2">vtkBorderRepresentation</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2">.New();</font></font></p><font face="Consolas" size="2"><font face="Consolas" size="2">
</font></font><font color="#008000" face="Consolas" size="2"><font color="#008000" face="Consolas" size="2"><font color="#008000" face="Consolas" size="2">
</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"><p> rep.SetShowBorderToOn();</p>
</font></font><font color="#008000" face="Consolas" size="2"><font color="#008000" face="Consolas" size="2"><font color="#008000" face="Consolas" size="2">
</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"><p> m_areaSegment.SetRepresentation( rep );</p>
</font></font><p><font face="Consolas" size="2"><font face="Consolas" size="2"> m_areaSegment.InteractionEvt += </font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">new</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> </font></font><font color="#2b91af" face="Consolas" size="2"><font color="#2b91af" face="Consolas" size="2"><font color="#2b91af" face="Consolas" size="2">vtkObject</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2">.</font></font><font color="#2b91af" face="Consolas" size="2"><font color="#2b91af" face="Consolas" size="2"><font color="#2b91af" face="Consolas" size="2">vtkObjectEventHandler</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2">( area_segment_InteractionEvt );</font></font></p><font face="Consolas" size="2"><font face="Consolas" size="2">
</font></font><font color="#008000" face="Consolas" size="2"><font color="#008000" face="Consolas" size="2"><font color="#008000" face="Consolas" size="2">
</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"><p> m_areaSegment.SelectableOn();</p></font></font></div><div><p><font color="#2b91af" face="Consolas" size="2"><font color="#2b91af" face="Consolas" size="2"><font color="#2b91af" face="Consolas" size="2">vtkBorderRepresentation</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> borderrep = </font></font><font color="#2b91af" face="Consolas" size="2"><font color="#2b91af" face="Consolas" size="2"><font color="#2b91af" face="Consolas" size="2">vtkBorderRepresentation</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2">.SafeDownCast( m_areaSegment.GetRepresentation() );</font></font></p><font face="Consolas" size="2"><font face="Consolas" size="2">
</font></font><font color="#008000" face="Consolas" size="2"><font color="#008000" face="Consolas" size="2"><font color="#008000" face="Consolas" size="2">
</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"><p> m_renderer.WorldToView();</p>
</font></font><p><font face="Consolas" size="2"><font face="Consolas" size="2"> </font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">double</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2">[] viewpint1 = m_renderer.GetViewPoint();</font></font></p><font face="Consolas" size="2"><font face="Consolas" size="2">
</font></font><font color="#008000" face="Consolas" size="2"><font color="#008000" face="Consolas" size="2"><font color="#008000" face="Consolas" size="2">
</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"><p> m_renderer.SetWorldPoint(displaybounds[0], displaybounds[2], displaybounds[4], 1);</p>
<p> m_renderer.WorldToView();</p>
</font></font><p><font face="Consolas" size="2"><font face="Consolas" size="2"> </font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">double</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2">[] viewpint = m_renderer.GetViewPoint();</font></font></p><font face="Consolas" size="2"><font face="Consolas" size="2"><p>borderrep.GetPositionCoordinate().SetCoordinateSystemToView();</p>
<p> borderrep.GetPosition2Coordinate().SetCoordinateSystemToView();</p>
<p> borderrep.SetPosition(viewpint[0], viewpint[1]);</p>
<p> borderrep.SetPosition2(viewpint1[0], viewpint1[1]);</p>
<p> borderrep.GetBorderProperty().SetColor(0.0, 1.0, 0.0);</p>
<p> borderrep.SetShowBorderToOn();</p>
<p> borderrep.MovingOn();</p>
<p> m_renderWindow.Render();</p>
<p> m_areaSegment.On();</p></font></font></div><div><br></div><div>Thanks</div><div><br></div><br><br><span title="neteasefooter"><p> </p></span>