Loading and Displaying a DXF file
Posted: Fri Sep 27, 2013 4:52 pm
I'm just playing with QCad source code because I'm a Qt programmer and I found this code really interesting and strong.
I want to load and display a .dxf file in a GraphicsViewQt . I used this code but I got a black screen :
What's wrong with my code ?
I want to load and display a .dxf file in a GraphicsViewQt . I used this code but I got a black screen :
Code: Select all
RMemoryStorage* storage = new RMemoryStorage();
RSpatialIndexNavel* spatialIndex = new RSpatialIndexNavel();
RDocument * document = new RDocument(*storage, *spatialIndex);
RGraphicsViewQt *view = new RGraphicsViewQt;
RDocumentInterface * documentInterface = new RDocumentInterface(*document);
documentInterface->importFile("2.dxf", "DXF 2000");
RGraphicsSceneQt *scene = new RGraphicsSceneQt(*documentInterface);
view->setScene(scene);
view->show();