[vtkusers] Can't pick property after changing display setting

wenyalin wenyalintw at gmail.com
Tue May 7 15:50:36 EDT 2019


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


More information about the vtkusers mailing list