Since 2011, I’ve been slowly working on a CAD program, although in recent years it’s taken a back seat too a lot of the more pressing projects I’ve been working on for Virtex. I’d stumbled across OpenCascade years ago, but never sat down too truly getting it to work. My background is in C#, and using a library like that in C++ was, honestly, not so much intimidating as knowing “getting this working is gonna take some time and tenacity”.
After 3 weeks of bouncing around Burma and Northern Thailand, I’d realized I hadn’t touched a piece of code in close to a month. The month prior, I’d gotten a Python Interpreter working in IRIS using boost::python . I was able to do some pretty basic operations sending lines of python code that would call c++ classes and functions.
Sitting in the hostel on at the end of the trip, I decided I was all traveled out and a bit of coding might be a nice change of pace. Bringing up OpenCascade, I figured why not try and get it working. I dl’d the source, installed the dependencies, and then hopeful and moderately confident, I ran ‘make’.
and then waited,
finally conceding that it was going to take a bit of time to get this thing up and running, I threw my laptop in my pack, placed it between me and the wall of my bunk and went off to sleep.
Waking up in the middle of the night to some not-so-quiet-not-so-sober Aussies coming in, I realized make had finished. Running install, and then trying the DRAWEXE command to only get a set of errors, it dawned on me I wasn’t doing something right.
Fast forward a day, I’d taken a flight from Chiang Mai to Bangkok waiting to head out back to Korea. After 3 weeks of hostels, guesthouses, and a handful of bamboo huts, I decided I’d earned a 5 star hotel for my last night in SE Asia.
I spent the entire trip from Chiang Mai too Bangkok trying to figure out what I wasn’t doing right.
Stumbling upon the community version of OpenCascade, it was significantly easier and straight forward to get it installed. After another night of letting ‘make’ run, and an early morning install, DRAWEXE worked on the first try.
Now all I had to do was get the same thing working in a wxWidgets window…..
I found a lot of tutorials and examples for Qt and MFC, But all of my code so far was written in wxWidgets. Apparently getting it to work in Windows is fine, but the only example I found of getting it working in wxGTK was from 2004, and didn’t work any longer. It doesn’t help that the OpenCascade Documentation is somewhat lacking in the “Getting Started” section.
Scouring forums, posts and tutorials, and translating a handful of chinese blog posts, I was trying to peace together a working system with each solved issue only throwing a new error at compile time each time. It took a bit of perseverance.
After two flights, and a week of almost constant error chasing, I finally was able to embed an OpenCascade window within a wxPanel at first, and then put it in it’s own inherited control to be used in conjunction with wxAUI.
So in light of the lack of documentation for getting OpenCascade embedded into wxGTK, I’ve started a tutorial set to try and help those out in OpenCascade.
But for those who’d like to see a basic working example, you can download the source for CodeLite over at GitHub.
It uses version 0.17.1 of the community version of OpenCascade (OCE).