btw the code that throws the error: OSX_GraphicDevice::OSX_GraphicDevice () { CGDirectDisplayID mainDisplay = CGMainDisplayID (); CGSize size = CGDisplayScreenSize (mainDisplay); myWidth = size.width; myHeight = size.height;
SetGraphicDriver (); MyGraphicDriver->Begin (""); <<----- Here } #### graphics driver defined here... (not sure if i should use Graphic3d_GraphicDriver or OpenGL_GraphicDriver) void OSX_GraphicDevice::SetGraphicDriver () { char *glshr = getenv("CSF_GraphicShr"); //OpenGl_GraphicDriver gld(glshr); //Handle(OpenGl_GraphicDriver) hgld(&gld); //MyGraphicDriver = &gld; MyGraphicDriver = Handle(Graphic3d_GraphicDriver)(&Graphic3d_GraphicDriver(glshr)); } Henrik Rudstrom On 5 February 2010 11:21, Henrik Rudstrom <hrudst...@googlemail.com> wrote: > Thanks for the info! > got pas that issue at least... now its more fun: > > > Program received signal: “EXC_BAD_ACCESS”. > (gdb) bt > #0 0x0000000000000000 in ?? () <<----huh > #1 0x0000000100071e1b in OSX_GraphicDevice::OSX_GraphicDevice > (this=0x108007d38) at > /Users/henrik/Development/QtOSXOCCHarness-0.1/src/OSX_GraphicDevice.cxx:44 > #2 0x000000010004c478 in QoccViewerContext::createViewer > (this=0x106d714d0, aDisplay=0x1000e4b14 "DISPLAY", aName=0x108007d18, > aDomain=0x1000e4b84 "", ViewSize=1000) at > /Users/henrik/Development/QtOSXOCCHarness-0.1/src/qoccviewercontext.cpp:80 > #3 0x000000010004c805 in QoccViewerContext::QoccViewerContext > (this=0x106d714d0) at > /Users/henrik/Development/QtOSXOCCHarness-0.1/src/qoccviewercontext.cpp:34 > #4 0x000000010005bb85 in QoccHarnessWindow::QoccHarnessWindow > (this=0x106d70500) at > /Users/henrik/Development/QtOSXOCCHarness-0.1/src/qoccharnesswindow.cpp:35 > #5 0x000000010004a242 in main (argc=1, argv=0x7fff5fbff688) at > /Users/henrik/Development/QtOSXOCCHarness-0.1/src/main.cpp:34 > > > > Henrik Rudstrom > > > > On 5 February 2010 05:21, Thomas Paviot <tpav...@gmail.com> wrote: > >> HI Hendrik, >> >> I already had this trace: >> #0 0x0000000101d495b7 in Handle_Standard_Transient::EndScope () >> #1 0x0000000101d4968e in Handle_Standard_Transient::Assign () >> etc. >> >> I did not yet have a look to your project, but it may come from the fact >> that you run a 64 bit version of OCC : you *must* pass the -D_OCC64 flag to >> the compiler otherwise you have memory issues. >> >> Just for your information, here is the part of code extracted from the >> 'Handle_Standard_Transient.hxx" header that deals with 64 bit memory >> addressing: >> #ifdef _OCC64 >> #define UndefinedHandleAddress ((Standard_Transient *)0xfefdfefdfefd0000) >> #else >> #define UndefinedHandleAddress ((Standard_Transient *)0xfefd0000) >> #endif >> >> Hope this helps, >> >> Thomas >> >> 2010/2/4 Henrik Rudstrom <hrudst...@googlemail.com> >> >> Hello again... >>> Got a bit further now (unless its a dead end of course). Got past the >>> linking, and managed to run it, but it throws a “EXC_BAD_ACCESS” signal: >>> >>> Program received signal: “EXC_BAD_ACCESS”. >>> (gdb) bt >>> #0 0x0000000101d495b7 in Handle_Standard_Transient::EndScope () >>> #1 0x0000000101d4968e in Handle_Standard_Transient::Assign () >>> #2 0x000000010007245d in Handle_Graphic3d_GraphicDriver::operator= >>> (this=0x108007d60, anItem=0x7fff5fbff390) at >>> Handle_Graphic3d_GraphicDriver.hxx:61 >>> #3 0x0000000100071c02 in OSX_GraphicDevice::SetGraphicDriver >>> (this=0x108007d38) at >>> /Users/henrik/Development/QtOSXOCCHarness-0.1/src/OSX_GraphicDevice.cxx:69 >>> #4 0x0000000100071ee8 in OSX_GraphicDevice::OSX_GraphicDevice >>> (this=0x108007d38) at >>> /Users/henrik/Development/QtOSXOCCHarness-0.1/src/OSX_GraphicDevice.cxx:43 >>> #5 0x000000010004c570 in QoccViewerContext::createViewer >>> (this=0x106b4e000, aDisplay=0x1000e4b74 "DISPLAY", aName=0x108007d18, >>> aDomain=0x1000e4be4 "", ViewSize=1000) at >>> /Users/henrik/Development/QtOSXOCCHarness-0.1/src/qoccviewercontext.cpp:80 >>> #6 0x000000010004c8fd in QoccViewerContext::QoccViewerContext >>> (this=0x106b4e000) at >>> /Users/henrik/Development/QtOSXOCCHarness-0.1/src/qoccviewercontext.cpp:34 >>> #7 0x000000010005bc75 in QoccHarnessWindow::QoccHarnessWindow >>> (this=0x106b0e550) at >>> /Users/henrik/Development/QtOSXOCCHarness-0.1/src/qoccharnesswindow.cpp:35 >>> #8 0x000000010004a33a in main (argc=1, argv=0x7fff5fbff688) at >>> /Users/henrik/Development/QtOSXOCCHarness-0.1/src/main.cpp:34 >>> (gdb) >>> >>> google suggests it has something to do with autoreleasing, but i guess it >>> could be a lot of other things too.. is EXC_BAD_ACCESS specific to cooca? >>> >>> attached the project just i case anyone feels inspired. >>> >>> >>> Henrik Rudstrom >>> >>> >>> >>> On 4 February 2010 14:11, Henrik Rudstrom <hrudst...@googlemail.com>wrote: >>> >>>> hi, >>>> Yes, i remember we had some discussions half a year ago. There was also >>>> something on the wiki back then that you where pinning your hopes on >>>> amongst >>>> other, qt4.6. >>>> I managed to compile and run an carbon or cocoa app(not too sure, was >>>> just correcting compiler errors till it worked). But never managed to >>>> access >>>> it from python. >>>> Just tried to revive it. and managed to compile everything, but it >>>> apparently compiles to 32bit, but the graphics stuff compiles at least. >>>> Dont >>>> have time to continue now, but i've attached the xcode project (generated >>>> from a qt project file (basically adapted the qtocc-harnass). If you give >>>> it >>>> a try, be carefull when you edit the .pro files, (backup xcode file and run >>>> qmake -spec macx-xcode qtoccharness.pro). >>>> >>>> >>>> Henrik Rudstrom >>>> >>>> >>>> >>>> On 4 February 2010 05:23, Thomas Paviot <tpav...@gmail.com> wrote: >>>> >>>>> 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 >>>>> >>>>> >>>> >>> >>> _______________________________________________ >>> 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