Skip to content

Instantly share code, notes, and snippets.

View fmorency's full-sized avatar
💭
🚀

Félix C. Morency fmorency

💭
🚀
View GitHub Profile
@fmorency
fmorency / itk-4_cmake-error.log
Created January 10, 2012 16:14
ITK-4 CMake compilation options
[ 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
@fmorency
fmorency / gist:2596951
Created May 4, 2012 18:53
VTK Qt Python example
"""
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
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'])
@fmorency
fmorency / pyside_crash.py
Created June 13, 2012 20:48
PySide v1.1.1 crash
import sys
from PySide.QtCore import *
from PySide.QtGui import *
class Dummy(QObject):
def __init__(self, parent=None):
super(Dummy, self).__init__(parent)
@Slot()
@fmorency
fmorency / vtk_baddrawable.py
Created June 21, 2012 17:51
GLXBadDrawable when using multiple QVTKRenderWindow in a QMdiArea
#!/usr/bin/python
import sys
import vtk
from vtk.qt4.QVTKRenderWindowInteractor import *
from PySide.QtCore import *
from PySide.QtGui import *
@fmorency
fmorency / vtk_baddrawable.py
Created June 27, 2012 17:43
GLXBadDrawable when using multiple QVTKRenderWindow
import sys
import vtk
from vtk.qt4.QVTKRenderWindowInteractor import *
from PySide.QtCore import *
from PySide.QtGui import *
if __name__ == '__main__':
#Qt boilerplate
@fmorency
fmorency / VTKMdiSubWindowInteractor_example.py
Created July 3, 2012 20:29
VTKMdiSubWindowInteractor example
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)
@fmorency
fmorency / QVTKFrame_example.py
Created July 3, 2012 20:29
QVTKFrame example
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()
@fmorency
fmorency / VTKCloseEventFilter.py
Created July 3, 2012 20:31
VTK close event filter
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:
@fmorency
fmorency / pyside_destroy_slot.py
Created July 4, 2012 14:37
PySide destroy slot
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)