I'm new to OpenCascade, I need help in viewing an object in a qt widget, below you can see the code for that, it is very basic, the bottle was created as in the tutorial (I think it is the only Real tutorial for openCascade).
So, what's wrong in my code?
int main(int argc, char *argv)
QApplication a(argc, argv);
// create a Qt window
QWidget *window = new QWidget();
// create a bottle (TopoDS_Shape)
TopoDS_Shape myBottle = MakeBottle(70., 120., 30.);
// th DisplayDonnection
// the GraphicDriver
Handle(OpenGl_GraphicDriver) aGraphicDriver = new OpenGl_GraphicDriver(aDisplayConnection);
// creating the Viewer
Handle(V3d_Viewer) aViewer = new V3d_Viewer(aGraphicDriver, Standard_ExtString("my3dViewer"));
// creating a View
Handle(V3d_View) aView = aViewer->CreateView();
// creating an Xw_Window (I'm on Ubuntu)
aWindow = new Xw_Window(aDisplayConnection, window->winId());
// the Interactive context
Handle(AIS_InteractiveContext) aContext = new AIS_InteractiveContext(aViewer);
Handle(AIS_Shape) anAISShape = new AIS_Shape(myBottle);
When running the code I get this error:
terminate called after throwing an instance of 'Aspect_WindowDefinitionError'
The program has unexpectedly finished.
I'm using Occt 6.8.0 and Qt 4.8 on Linux Ubuntu 14.04 32bit.
As I see there are many tutorials about geometric manipulation of shapes, but the there is no one tutorial that explains the visualization in a GUI (I've read nearly all the available tutorials and posts in this forum, but nothing works correctly !).