This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ 44%] Generating itkSpatialObjectBase.xml | |
In file included from /home/morency/lib/ITK/ITK-build/Wrapping/Modules/ITKSpatialObjects/itkSpatialObjectBase.cxx:21: | |
/home/morency/lib/ITK/Modules/Core/SpatialObjects/include/itkMetaEvent.h:31: error: expected class-name before '{' token | |
/home/morency/lib/ITK/ITK-build/Wrapping/Modules/ITKSpatialObjects/itkSpatialObjectBase.cxx:43: error: 'MetaEvent' does not name a type | |
/home/morency/lib/ITK/ITK-build/Wrapping/Modules/ITKSpatialObjects/itkSpatialObjectBase.cxx: In function 'void _cable_::force_instantiate()': | |
/home/morency/lib/ITK/ITK-build/Wrapping/Modules/ITKSpatialObjects/itkSpatialObjectBase.cxx:73: error: 'itkMetaEvent_Superclass' was not declared in this scope | |
make[2]: *** [Wrapping/Modules/ITKSpatialObjects/itkSpatialObjectBase.xml] Error 1 | |
make[1]: *** [Wrapping/Modules/ITKSpatialObjects/CMakeFiles/ITKSpatialObjectsGccXML.dir/all] Error 2 | |
make: *** [all] Error 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A simple example that uses the QVTKRenderWindowInteractor | |
class. | |
""" | |
#from PySide import QtGui | |
from PyQt4 import QtGui | |
from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor | |
import vtk | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import vtk | |
from vtk.qt4.QVTKRenderWindowInteractor import * | |
from PySide.QtCore import * | |
from PySide.QtGui import * | |
from PySide.QtXml import * | |
from PySide.QtUiTools import * | |
if __name__ == "__main__": | |
app = QApplication(['QVTKRenderWindowInteractor']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from PySide.QtCore import * | |
from PySide.QtGui import * | |
class Dummy(QObject): | |
def __init__(self, parent=None): | |
super(Dummy, self).__init__(parent) | |
@Slot() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import vtk | |
from vtk.qt4.QVTKRenderWindowInteractor import * | |
from PySide.QtCore import * | |
from PySide.QtGui import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import vtk | |
from vtk.qt4.QVTKRenderWindowInteractor import * | |
from PySide.QtCore import * | |
from PySide.QtGui import * | |
if __name__ == '__main__': | |
#Qt boilerplate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class QVTKRenderMdiSubWindowInteractor(QMdiSubWindow): | |
def __init__(self, parent=None, | |
wflags=Qt.WindowFlags() | Qt.WA_DeleteOnClose): | |
super(QVTKRenderMdiSubWindowInteractor, self).__init__(parent, wflags) | |
self.qhbox = QHBoxLayout() | |
self.qframe = QFrame() | |
self.vtk_interactor = QVTKRenderWindowInteractor(parent=self.qframe) | |
self.qhbox.addWidget(self.vtk_interactor) | |
self.qframe.setLayout(self.qhbox) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class QVTKFrame(QFrame): | |
def __init__(self, parent=None): | |
super(QVTKFrame, self).__init__(parent=parent) | |
def closeEvent(self, evt): | |
for w in self.children(): | |
if hasattr(w, 'close'): | |
w.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CloseEventFilter(QObject): | |
def eventFilter(self, target, event): | |
if event.type() == QEvent.Close: | |
for w in target.children(): | |
if hasattr(w, 'close'): | |
w.close() | |
return True | |
return False | |
#Usage example: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from PySide.QtCore import * | |
from PySide.QtGui import * | |
class MyQWidget(QWidget): | |
def __init__(self, parent=None, wflags=Qt.WindowFlags()): | |
super(MyQWidget, self).__init__(parent, wflags) | |
self.destroyed.connect(self.destroy_slot) |
OlderNewer