Hi Henrik, Jelle is right : it's an X11/Cocoa "conflict" issue. In a few words, the OpenCascade library is built upon X11 (even on MacOSX) for everything dealing with graphic display. In order to run an OCC/pythonOCC program, you must first create a X11 GUI, and pass to OCC the identifier of one of the window you want to use. If no windows id is passed, of if the identifier does not define an X11 windows, then an error is raised by OCC.
Your version of Qt is built upon Cocoa. That is, if you both run pythonOCC and pyQt, it's like they are not connected since they use a different system. There are 3 ways to get done with these issues under MacOSX SL 64 bits: (1) use the python-xlib package as a GUi manager. It allows low level X11 programming, it's lightweight, but it can't be used to develop a complete app, (2) compile pyQt/X11 or wxPython/X11 but unfortunately I didn't manage to do it, (3) develop a native Cocoa OCC implementation. I tried to, but it's definitely too difficult for me : the mix OpenGL / AGL / Carbon / Cocoa / C++ / ObjectiveC made me become crazy, and I gave up with that. Up to now, if you want to play with pythonOCC, I suggest you choose the frist solution. Best Rehgards, Thomas 2010/2/3 jelle feringa <jelleferi...@gmail.com> > Hi Henrik, > > This is a OSX only issue. > Having QT & pythonOCC working together on OSX is perhaps difficult to > achieve. > The OGL that OCC has been built with, is that of X11, while QT is > implemented on top of Quartz / Cocoa. > Could that perhaps explain it? I'm simplying echo'ing what Thomas explained > me before. > > You mentioned to me that you were able to get the demo app in Cocoa ( OCC > cocoa patch Emmanual ) running. > Well, it would be an absolute dream if somehow, someway we'd be able to get > this working with pythonOCC too! > > Cheers, > > -jelle > > On Wed, Feb 3, 2010 at 6:31 PM, Henrik Rudstrom > <hrudst...@googlemail.com>wrote: > >> Hi >> First of all thanks for the new osx build! >> Was in an optimistic mood today, so i thought i'd try to get occ working >> in qt, but i got a good old overflow error. >> >> 4317497200 <<---- window._handle which is more than 2 ^ 32 >> Traceback (most recent call last): >> File "qtocc.py", line 33, in <module> >> window.glWidget.InitDriver() >> File "/Library/Python/2.6/site-packages/OCC/Display/qtDisplay.py", line >> 122, in InitDriver >> self._display.Create() >> File "/Library/Python/2.6/site-packages/OCC/Display/OCCViewer.py", line >> 79, in Create >> self.Init(self._window_handle) >> OverflowError: in method 'Display3d_Init', argument 2 of type 'int' >> >> seems the visualization module cant handle 64bit numbers, isnt that a bit >> wierd if the build is 64 bit? or is this a osx issue, does the qt viewer >> work on other platforms? >> would the fix be just a matter of changing a few typedef's or does that >> propagate throught the whole framework? >> >> >> >> Henrik Rudstrom >> >> >> code i used: >> >> import sys >> from OCC.Display.qtDisplay import qtViewer3d >> from PyQt4 import QtGui >> >> class Window(QtGui.QWidget): >> def __init__(self): >> super(Window, self).__init__() >> self.glWidget = qtViewer3d() >> mainLayout = QtGui.QHBoxLayout() >> mainLayout.addWidget(self.glWidget) >> self.setLayout(mainLayout) >> self.setWindowTitle(self.tr("Hello GL")) >> self.glWidget >> #self.glWidget.DisplayShape(BRepPrimAPI_MakeSphere(1).Shape()) >> >> if __name__ == '__main__': >> app = QtGui.QApplication(sys.argv) >> window = Window() >> window.show() >> window.glWidget.InitDriver() >> window.glWidget._display.Test() >> sys.exit(app.exec_()) >> >> _______________________________________________ >> Pythonocc-users mailing list >> Pythonocc-users@gna.org >> https://mail.gna.org/listinfo/pythonocc-users >> >> > > _______________________________________________ > Pythonocc-users mailing list > Pythonocc-users@gna.org > https://mail.gna.org/listinfo/pythonocc-users > >
_______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users