2013/3/14 Thomas Paviot <tpav...@gmail.com> > Hi Charles, > > 2013/3/14 Charles Sharman <charles.shar...@skybeam.com> > >> I circumvented the problem by modifying OCCViewer.py. I removed the >> OCCViewer.Viewer3d inheritance of OCC.Visualization and directly called >> the >> OCC.Visualization equivalents within OCCViewer.Viewer3d itself, being very >> careful to call handles shortly after an object's creation. >> Unfortunately, this >> fix only works for Viewer3d. Viewer2d and NISVisualization3d will still >> have >> the problem. >> > > The 2d part of OCC has been dropped a few weeks ago from their git > repository, they focus on 3D only. I'm about to do the same on the wrapper > side, since I did not heard anybody using the 2d viewer. It's the same for > the NIS based viewer: I do think it's useless. So unless someone > specifically asks for these wrappers to still be part of pythonocc, I will > soon only keep the Viewer3d. > > So this solves your problem with Viewer2d and NISVis. > > >> Anyway, now you can run wxViewer3d under threads. I can open multiple >> Viewer >> windows under ipython and interact with each separately. If there is >> great >> demand to get similar improvements to Viewer2d, let me know, and I'll >> work on >> them. Make sure the demand is real, though. Despite the brevity of the >> code, >> it took a lot of time to find a solution. >> > > Interesting, thank you for looking into this issue. > > >> >> For those interested, the code changes follow. (I can't test the Windows >> version, but Linux works for sure.) Interestingly enough, a full change >> to all >> viewers would remove the need for the OCC.Visualization module, I think. >> I'll >> wait a couple days to hear if there's demand for the other Viewers. > > > I'm quite sure there won't. > > If not, and >> pending Thomas's approval, I'll submit these fixes to the 0.6 release >> early next >> week. >> > > Let's proceed this opposite way: open an issue on the github pythonocc > page (https://github.com/tpaviot/pythonocc), either submit a patch or, > even better, push a branch with your code, and request for it t be > integrated into the master branch. I can give you a write access if you > need. If you don't feel comfortable with git, just send a patch and I will > apply it. > > This fix however has to be seriously tested on all platforms, since I > experienced many different behaviors when developing gui using so-called > portable libraries. > > Cheers, > > Thomas >
Hi Charles, Your fix is actually very smart: you actually decided to implement the Visualization module in pure python rather than in C++. I remember that I had difficulties to do it in Python, and that's why I developed the graphical part in C++ and wrapped it in python. Your approach is much more pythonic. I wonder whether it can be done on Windows, let me check that. Regards, Thomas
_______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users