<div dir="ltr">I believe this has been fixed in VTK master now ala <a href="https://gitlab.kitware.com/vtk/vtk/merge_requests/1434">https://gitlab.kitware.com/vtk/vtk/merge_requests/1434</a><div><br></div><div>Thanks for tracking it down.</div><div><br></div><div>Ken</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 6, 2016 at 9:21 PM, ABE Hiroshi <span dir="ltr"><<a href="mailto:habe36@gmail.com" target="_blank">habe36@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear All,<br>
<br>
I found the reason why the problem occurs.<br>
<br>
Dragging the handle and then stop to set the vector of motion of mouse pointer to zero vector in “vtkPlaneWIdget::MovePoint?” methods.<br>
The vector is expected not to be zero but it is on OSX. I put statement to prevent zero divide as;<br>
// Project v onto these vector to determine the amount of motion<br>
// Scale it by the relative size of the motion to the vector length<br>
double d1, d2;<br>
if( vN == 0 ) {<br>
d1 = 0.0;<br>
d2 = 0.0;<br>
} else {<br>
d1 = (vN/n10) * vtkMath::Dot(v,p10) / (vN*n10);<br>
d2 = (vN/n20) * vtkMath::Dot(v,p20) / (vN*n20);<br>
}<br>
to work fine for me.<br>
<br>
Tchuss,<br>
<br>
2016/04/06 16:57、ABE Hiroshi <<a href="mailto:habe36@gmail.com">habe36@gmail.com</a>> のメール:<br>
<br>
> Dear All,<br>
><br>
> I modified the VTK wiki’s sample as is bottom of this mail to show the status of vtkPlaneWidget.<br>
> The output of “Print” method in the constructor is;<br>
><br>
> vtkPlaneWidget (0x7fea78d1e1d0)<br>
> Debug: Off<br>
> Modified Time: 2705<br>
> Reference Count: 1<br>
> Registered Events: (none)<br>
> Current Renderer: 0x0<br>
> Default Renderer: 0x0<br>
> Enabled: 0<br>
> Priority: 0.5<br>
> Interactor: 0x0<br>
> Key Press Activation: On<br>
> Key Press Activation Value: i<br>
> Prop3D: 0x0<br>
> Input: 0x0<br>
> Handle Size: 0.05<br>
> Place Factor: 0.5<br>
> Handle Property: 0x7fea78d4a2c0<br>
> Selected Handle Property: 0x7fea78d4a470<br>
> Plane Property: 0x7fea78d4a620<br>
> Selected Plane Property: 0x7fea78d4a7d0<br>
> Plane Representation: Wireframe<br>
> Normal To X Axis: Off<br>
> Normal To Y Axis: Off<br>
> Normal To Z Axis: Off<br>
> Resolution: 4<br>
> Origin: (-0.5, -0.5, 0)<br>
> Point 1: (0.5, -0.5, 0)<br>
> Point 2: (-0.5, 0.5, 0)<br>
><br>
> and in the destructor;<br>
><br>
> vtkPlaneWidget (0x7fea78d1e1d0)<br>
> Debug: Off<br>
> Modified Time: 2806<br>
> Reference Count: 0<br>
> Registered Events: (none)<br>
> Current Renderer: 0x7fea78f00160<br>
> Default Renderer: 0x0<br>
> Enabled: 1<br>
> Priority: 0.5<br>
> Interactor: 0x7fea78f00b40<br>
> Key Press Activation: On<br>
> Key Press Activation Value: i<br>
> Prop3D: 0x0<br>
> Input: 0x0<br>
> Handle Size: 0.05<br>
> Place Factor: 0.5<br>
> Handle Property: 0x7fea78d4a2c0<br>
> Selected Handle Property: 0x7fea78d4a470<br>
> Plane Property: 0x7fea78d4a620<br>
> Selected Plane Property: 0x7fea78d4a7d0<br>
> Plane Representation: Wireframe<br>
> Normal To X Axis: Off<br>
> Normal To Y Axis: Off<br>
> Normal To Z Axis: Off<br>
> Resolution: 4<br>
> Origin: (-0.562965, -0.555969, 0)<br>
> Point 1: (nan, nan, nan)<br>
> Point 2: (nan, nan, nan)<br>
><br>
> The Point 1 and 2 are changed to “nan”. The value (X,Y) in OnMouseMove is not strange as;<br>
> ( 182, 172 )<br>
> ( 180, 170 )<br>
> ( 180, 169 )<br>
> ( 177, 169 )<br>
> ( 177, 167 )<br>
> ( 175, 167 )<br>
> ( 174, 166 )<br>
> ( 174, 165 )<br>
> ( 173, 165 )<br>
> ( 218, 212 )<br>
> ( 219, 213 )<br>
> ( 221, 215 )<br>
> ( 222, 217 )<br>
> ( 224, 218 )<br>
> ( 225, 221 )<br>
> ( 226, 222 )<br>
> ( 227, 224 )<br>
> ( 229, 225 )<br>
> ( 230, 225 )<br>
> ( 232, 227 )<br>
> ( 235, 229 )<br>
> ( 237, 231 )<br>
> ( 241, 234 )<br>
> ( 244, 235 )<br>
> ( 246, 236 )<br>
> ( 247, 238 )<br>
> ( 249, 238 )<br>
> ( 250, 238 )<br>
> ( 250, 239 )<br>
> ( 252, 239 )<br>
> ( 253, 241 )<br>
> ( 253, 241 )<br>
> ( 255, 241 )<br>
> ( 255, 242 )<br>
> ( 255, 244 )<br>
> ( 256, 244 )<br>
> ( 256, 244 )<br>
> ( 258, 244 )<br>
><br>
> This is the result of my investigation on this.<br>
><br>
> Still I am looking for any suggestions on this.<br>
> Thank you.<br>
><br>
> 2016/04/05 11:28、ABE Hiroshi <<a href="mailto:habe36@gmail.com">habe36@gmail.com</a>> のメール:<br>
><br>
>> Dear all,<br>
>><br>
>> This might be a known issue but I could find any description about it on the net so I ask you about vtkPlaneWidget.<br>
>> That is a weired behavior that the handles of vtkPlaneWidget is gone when you drag one of the handles.<br>
>><br>
>> The sample program I used is available at:<br>
>> <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/PlaneWidget" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/PlaneWidget</a><br>
>><br>
>> Building it straightforwardly and get an executable program. The application launches as usual to display a VTK window.<br>
>> You can find a vtkPlaneWidget’s plane in the window, which has four handles. If you drag one of the handles suddenly the handle disappears. This is always happens on OSX (10.9.5, 10.10.5). The env. are:<br>
>><br>
>> OS X 10.9.5 (iMac late 2013 21.5”) VTK 5.10.1 (with Apple Wireless Trackpad)<br>
>> OS X 10.10.5 (MBP Letina 13”) VTK 5.10.1 VTK 6.3.0<br>
>><br>
>> As an additional info. Run the same program on OpenSUSE 13 (VTK 5.10) on the Linux box itself, it works fine as expected. But if you display on iMac with XQuartz (2.7.8), the same problem happens.<br>
>><br>
>> Anybody out there point me the way workaround or any suggestions to solve this.<br>
>><br>
>> Thank you very much in advance.<br>
><br>
> ABE Hiroshi<br>
> from Tokorozawa, JAPAN<br>
><br>
> #include <iostream><br>
><br>
> #include <vtkPlaneWidget.h><br>
> #include <vtkRenderer.h><br>
> #include <vtkRenderWindow.h><br>
> #include <vtkRenderWindowInteractor.h><br>
> #include <vtkSmartPointer.h><br>
> #include <vtkObjectFactory.h><br>
><br>
> class myPlaneWidget : public vtkPlaneWidget {<br>
> public:<br>
> static myPlaneWidget *New();<br>
> myPlaneWidget() : vtkPlaneWidget() {<br>
> this->Print( std::cout );<br>
> }<br>
> virtual ~myPlaneWidget() {<br>
> this->Print( std::cout );<br>
> }<br>
> virtual void UpdatePlacement() {<br>
> this->Print( std::cout );<br>
> vtkPlaneWidget::UpdatePlacement();<br>
> }<br>
> virtual void PositionHandles() {<br>
> this->Print( std::cout );<br>
> vtkPlaneWidget::PositionHandles();<br>
> }<br>
> };<br>
> vtkStandardNewMacro(myPlaneWidget);<br>
><br>
> int main(int, char *[])<br>
> {<br>
> vtkSmartPointer<vtkRenderer> renderer =<br>
> vtkSmartPointer<vtkRenderer>::New();<br>
><br>
> vtkSmartPointer<vtkRenderWindow> renderWindow =<br>
> vtkSmartPointer<vtkRenderWindow>::New();<br>
> renderWindow->AddRenderer(renderer);<br>
><br>
> vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =<br>
> vtkSmartPointer<vtkRenderWindowInteractor>::New();<br>
> renderWindowInteractor->SetRenderWindow(renderWindow);<br>
><br>
> vtkSmartPointer<myPlaneWidget> planeWidget =<br>
> vtkSmartPointer<myPlaneWidget>::New();<br>
> planeWidget->SetInteractor(renderWindowInteractor);<br>
><br>
> planeWidget->On();<br>
><br>
> renderWindowInteractor->Initialize();<br>
><br>
> renderer->ResetCamera();<br>
> renderWindow->Render();<br>
><br>
> renderWindowInteractor->Start();<br>
><br>
> return EXIT_SUCCESS;<br>
> }<br>
><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br>
ABE Hiroshi<br>
from Tokorozawa, JAPAN<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Ken Martin PhD<div>Chairman & CFO<br>Kitware Inc.<br>28 Corporate Drive<br>Clifton Park NY 12065<br>518 371 3971<div><br></div><div><span style="font-size:10pt;font-family:Tahoma,sans-serif">This communication,
including all attachments, contains confidential and legally privileged
information, and it is intended only for the use of the addressee. Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken in reliance on it is prohibited and may be
unlawful. If you received this communication in error please notify us
immediately and destroy the original message.
Thank you.</span></div></div></div>
</div>