Can't pick property after changing display setting

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Can't pick property after changing display setting

wenyalin
Hey guys, I'm a newbie in VTK. I got some display problem when trying to
change the style of displaying image.
I have a renderwindow and an observer to pick pixel when mouse hovering, the
observer setup is imitated from link below.
(https://vtk.org/Wiki/VTK/Examples/Cxx/Images/PickPixel2)

[CASE 1]
current display function is as below:
/* begin */
m_ImageViewer->SetInputData(image);
m_ImageViewer->UpdateDisplayExtent();
m_Renderer->ResetCamera();
m_ImageViewer->SetRenderWindow(RenderWindow);
RenderWindow->Render();
/* end */
and this is the result, which is great.
<http://vtk.1045678.n5.nabble.com/file/t342744/1.png>

[CASE 2]
Afterward, I try to change the style of image by SetOpacity(0.5). (Actually,
I use <vtkLookupTable> and <vtkImageMapToColors>, but the SetOpacity
represent the same situation)
Than, I can't get the coordinate from observer anymore.
The Only line of code I added was
"m_ImageViewer->GetImageActor()->GetProperty()->SetOpacity(0.5);"
and this is the result, can't pick prop anymore. (the annotation at the
bottom-left)
<http://vtk.1045678.n5.nabble.com/file/t342744/2.png>


I found out that in observer callback (exactly same as the example
PickPixel2), "this->Picker->GetPath()" always return NULL in [CASE 2], which
means I didn't pickup any prop with my mouse events.
The only change I make is setting opacity, how could this make any different
in prop-picking?

Any idea?
Thanks in advance for any help !



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers