MantisBT - VTK
View Issue Details
0011852VTK(No Category)public2011-02-14 07:462013-07-22 19:57
thorbenk 
Clinton Stimpson 
normalminoralways
closedfixed 
Gentoo LinuxLinux2.6.34-gentoo
 
5.10.0 
TBD
incorrect functionality
0011852: QVTKWidget and QVTKWidget behave differently; resizing breaks interactor for QVTKWidget2
The attached small python test case shows some problems with QVTKWidget and QVTKWidget2. I'm using the latest VTK built from git HEAD.

1.) QVTKWidget and QVTKWidget2 behave differently. When the mouse moves over the plane, it gets highlighted green for QVTKWidget but no highlighting happens for QVTKWidget2. Is this a bug or a feature?

To reproduce, run
python test-qvtkwidget.py 1 // to use QVTKWidget
python test-qvtkwidget.py 2 // to use QVTKWidget2

2.) Try resizing the window when using QVTKWidget2 (see above). Now the plane
cannot be dragged anymore. I have tracked this problem down, one can work around this by resizing the interactor in a resizeEvent like this:

def resizeEvent(self, event):
        #ordering is important here
        #1.) Let the QVTKWidget2 resize itself
        QVTKWidget2.resizeEvent(self,event)
        
        w,h = self.width(), self.height()
        #2.) Make sure the interactor is assigned a correct new size
        self.renderWindow.GetInteractor().SetSize(w,h)
python, qt
? test-qvtkwidget.py (1,052) 2011-02-14 07:46
https://www.vtk.org/Bug/file/8693/test-qvtkwidget.py
? test-qvtkwidgetInLayout.py (2,717) 2011-02-23 08:17
https://www.vtk.org/Bug/file/8720/test-qvtkwidgetInLayout.py
png screenShotForOption3.png (1,676,658) 2011-02-23 08:19
https://www.vtk.org/Bug/file/8721/screenShotForOption3.png
? test-qvtkwidget2_TestCaseWindowsTranparency.py (2,218) 2011-02-24 05:15
https://www.vtk.org/Bug/file/8727/test-qvtkwidget2_TestCaseWindowsTranparency.py
Issue History
2011-02-14 07:46thorbenkNew Issue
2011-02-14 07:46thorbenkFile Added: test-qvtkwidget.py
2011-02-23 08:17Christoph SommerFile Added: test-qvtkwidgetInLayout.py
2011-02-23 08:19Christoph SommerFile Added: screenShotForOption3.png
2011-02-23 08:26Christoph SommerNote Added: 0025560
2011-02-23 08:45Oliver PetraNote Added: 0025561
2011-02-23 09:23thorbenkTag Attached: python
2011-02-23 09:23thorbenkTag Attached: qt
2011-02-23 18:57Clinton StimpsonNote Added: 0025566
2011-02-24 03:32thorbenkNote Added: 0025569
2011-02-24 05:15Christoph SommerFile Added: test-qvtkwidget2_TestCaseWindowsTranparency.py
2011-02-24 05:18Christoph SommerNote Added: 0025571
2011-02-24 07:55Oliver PetraNote Added: 0025573
2011-02-25 23:23Clinton StimpsonAssigned To => Clinton Stimpson
2011-02-25 23:23Clinton StimpsonStatusbacklog => tabled
2011-02-25 23:24Clinton StimpsonNote Added: 0025586
2011-06-16 13:12Zack GalbreathCategoryDevelopment => (No Category)
2011-10-03 17:32Clinton StimpsonProject => TBD
2011-10-03 17:32Clinton StimpsonType => incorrect functionality
2011-10-03 17:32Clinton StimpsonStatusbacklog => todo
2011-10-03 17:32Clinton StimpsonResolutionopen => fixed
2011-10-03 17:32Clinton StimpsonFixed in Version => 5.8
2011-10-03 17:32Clinton StimpsonStatustodo => active development
2013-07-22 19:57Dave DeMarleStatusactive development => closed
2013-07-22 19:57Dave DeMarleFixed in Version5.8 => 5.10.0

Notes
(0025560)
Christoph Sommer   
2011-02-23 08:26   
The same problem appears on Windows 7.

PyQt4 = 4.7.3
Qt = 4.6.2
Python = 2.6.5
VTK = git checkout from 22.02.2011

Additionally, after embedding the QVTKWidget2 into a layout of a MainWindow, the transparency is disabled. See attached screenshot.
(0025561)
Oliver Petra   
2011-02-23 08:45   
I can confirm the issues raised in the first bugreport on a Mac Book Pro (OS X 10.6.6, core i5, 8GB RAM). I have compiled VTK from git (version from last week) using all dependencies installed from macports.

However, using
python test-qvtkwidgetInLayout 3
the slicing plane widget is transparent and not opaque as reported above for the Windows platform.

Here are the relevant versions of dependencies:
Python python26 @2.6.6_1 (active)
Qt qt4-mac @4.7.1_1+quartz (active)
PyQt py26-pyqt4 @4.8.3_1 (active)
SIP py26-sip @4.12.1_0 (active)
VTK de74b8e628b5c9683544079d5980b12fc816893d
(0025566)
Clinton Stimpson   
2011-02-23 18:57   
Some fixes committed here. Can you give it a try?
http://vtk.org/gitweb?p=VTK.git;a=commit;h=1d2817 [^]

I can't reproduce the transparency being disabled. However, if you want to help track it down, its probably a matter of OpenGLInit() being called at the right time.
(0025569)
thorbenk   
2011-02-24 03:32   
Thank you very much for having a look at this bug. I've tested your patch on an Ubuntu 10.10 system and it fixes all the issues I reported :-)

As soon as I get my hands on a Windows machine, I'll try looking at the "no transparency" bug. Looking at QVTKWidget2.cxx, OpenGLInit() is only called from SetRenderWindow, so I'll try placing this call somewhere else.

Cheers,

Thorben
(0025571)
Christoph Sommer   
2011-02-24 05:18   
Tried it on Windows 7. Patch worked nicely! Thanks a lot.

I've attached a testCase for Windows where the order of inits is important.

if you call test-qvtkwidget2_TestCaseWindowsTranparency.py <number>
with <number> smaller than 6 the plane is opaque, otherwise semi-transparent (as expected)

Cheers,
Christoph
(0025573)
Oliver Petra   
2011-02-24 07:55   
Seems like the patch works for Mac OS X 10.6.6 too. Thank you very much for your effort and the very quick help. Awesome!


Best regards,
Oliver
(0025586)
Clinton Stimpson   
2011-02-25 23:24   
Ok, I think this transparency issue is fixed.
http://vtk.org/gitweb?p=VTK.git;a=commit;h=bccc28 [^]