< User:Vladbogolin
Revision as of 17:05, 17 August 2013 by Vladbogolin (talk | contribs) (Week 9)

Daily Progress

Project Info

Project Name New Cross-Platform 3D Display Manager
Student Name Bogolin Simion Vlad
IRC nick vladbogo
Link to proposal


  • Embed Qt in Tk windows
  • Drawing
    • Line drawing
    • Text drawing
  • Keyboard and mouse integration
  • Embedding a framebuffer window


Community bonding

  • 30 May 2013:
    • Updated short description of the project on the melange page.
  • 1 June 2013:
    • A first step in implementing the qt display manager. Now it only prints logs similar to txt dm, but has some improvements
  • 4 June 2013:
  • 14 June 2013:

Week 1 (17 June - 23 June)

  • Weekly milestone:
    • As I haven't worked with Qt before I will focus on getting more familiarized with it this week and also a more detailed look on the existing dm's code to be sure I will not miss anything.
  • 17 June 2013:
    • Created a first qt small application. It is not something complicated. I focused on the compilation procedure and how to integrate qt with cmake.
  • 18 June 2013:
    • I successfully built a qt project using cmake. I struggled with the difference between Qt4 and Qt5 but finally managed to make a cmake build.
  • 19 June 2013:
  • 20 June 2013:
    • Studied existing cmake files in order to complete integration of Qt with cmake.
    • Found out a FindQt.cmake implementation and tested it: does not work.
  • 21 June 2013:
    • Studied existing X-dm implementation, especially the open function.
  • 22 June 2013:
    • A short break so I didn't do much today but I've looked on the mged dm files (mged/dm-ogl.c).
  • 23 June 2013:
    • Studied some more detailed Qt projects that involve basic drawing.
  • Conclusion:
    • Overall it was a good week in which I think I've managed to accomplish the weekly milestone. I still have to clear out some things but I'm confident I can start implementing effectively.

Week 2 (25 June - 30 June)

  • Weekly milestone:
    • Start implementing effectively and make progress in embedding Qt in Tk window.
  • 24 June 2013:
    • Committed the qt display manager patch. It only prints logs now.
    • Additional test to set BRLCAD_ENABLE_QT. Still needs to be improved because at the moment the path to Qt installation should be provided in the CMAKE_PREFIX_PATH.
  • 25 June 2013:
    • Integrated Qt in BRL-CAD's cmake build and created a small application to test the integration. Still needs to quiet warnings from Qt files.
  • 26 June 2013:
    • A break day so I did not do much work.
  • 27 June 2013:
    • IRC discussion regarding various problems: framebuffer to be used by the new display manager (i will start with a null/text framebuffer), fPIC flag
    • Committed changes to complete Qt integration in cmake build and found a suitable solution for the position independent code flag at least for the moment (cmake version 2.8.11)
    • Almost everything ready so tomorrow I will start working effectively to embed Qt in Tk window
  • 28 June 2013:
    • Found different ways to quiet warnings from Qt files.
    • Read Qt documentation and studied some basic drawing applications.
  • 29 June 2013:
    • Started working on actual embedding.
    • Small steps in order to create the Tk main window.
    • Go back to Bucharest (and hopefully this will solve the internet connection problem which was a little bad here) so today is a busy day.
  • 30 June 2013:
    • Dealt with generic Tk window problems such as window type (top-level or embedded), creating a display, window dimension.
    • Almost finished the logic behind the Tk window so that Qt can be successfully embedded in it.
  • Conclusion:
    • A lot of things that were needed to be clarified are now clear, especially after the IRC discussion.
    • Tk main window is almost created so I have made some progress in the actual implementation.
    • Still the cmake integration took more that I've expected so I can't say I've made all things I had in mind for this week but this is nothing to be worried about because I am on schedule.

Week 3 (1 July - 7 July)

  • Weekly milestone:
    • Finish embedding Qt in Tk window.
  • 1 July 2013:
    • Finished creating Tk main window: now it's displays an empty window.
    • Struggled with a segfault due to doevent(mged/doevent.c) function: solved this by adding an qt_doevent(mged/dm-qt.c) function which does nothing for the moment.
  • 2 July 2013:
    • Studied QPixmap examples.
  • 3 July 2013:
    • Review existing dm X implementation and focus on pixmap creation.
  • 4 July 2013:
    • After updating to the latest sources Tcl_Eval from dm_open failed. Solved it by recompiling the whole code again.
    • Read about QApplication in detail because when I tried to create some Qt widgets I got a runtime error saying that QApplication is required.
    • Looked on the drawBegin function to see how drawing is dealt with in the current implementation.
    • Ignored the float-equal warning for libdm so that the code compiles with strict compilation on.
  • 5 July 2013:
    • Break day
  • 6 July 2013:
    • Studied an existing Qt and Tk integration.
  • 7 July 2013:
    • Struggled with showing a Qt window using processEvents function.
  • Conclusion:
    • Quite a busy week with a lot of unexpected problems so I am a little bit behind my original schedule but I am confident I will make up for the lost time next week.
    • I had some discussions with my mentor during the past days and decided to leave the Tk part as small as possible (preferably just Qt to be used in the display window)

Week 4 (8 July - 14 July)

  • Weekly milestone:
    • Draw lines in the new display manager.
  • 8 July 2013:
    • Finally solved the display of the Qt window (processEvents must be called during refresh)
  • 9 July 2013:
    • Studied the mged main loop and refresh procedure to see how could Qt be integrated with.
  • 10 July 2013:
    • Searched for different ways to integrate Tk and Qt main loop event.
    • Found Xt and Qt integration and studied the implementation.
  • 11 July 2013:
    • Tried to make the Qt and Tk integration using the QWidget::create function.
    • Unfortunately this does not work either but at least the solution compiles unlike the previous tries.
  • 12 July 2013:
    • Break day
  • 13 July 2013:
    • Read about X11 Qt event integration so that I could try a similar approach with Tk.
  • 14 July 2013:
    • Committed changes to illustrate the Qt and Tk integration.
    • Implemented qt-close function so that the display manager is gracefully released.
    • IRC discussion regarding Qt and Tk integration.
    • Tested the QWidget::create function also on raw X11 windows.
    • Studied some drawing line examples.
  • Conclusion:
    • Unfortunately the embedding still does not work so in the worst case I will go on another path: not use Tk and create just a Qt window.
    • Drawing lines shouldn't be a problem so that after the windows are created it should not be a big task.

Week 5 (15 July - 21 July)

  • Weekly milestones:
    • Solve the embedding problem.
    • Finish the drawing line functionality.
    • Start implementing the draw string functionality.
  • 15 July 2013:
    • Implemented the qt_reshape function.
    • Partially implemented the qt_configureWin function.
    • Set the window background color.
    • Added the processEvents callback to struct dm so that the QApplication::processEvents could be called in the mged's main event loop.
  • 16 July 2013:
  • 17 July 2013:
    • Almost finished implementing the drawLine2d functionality.
    • Implemented the qt_setBGcolor function.
    • Tried to build on windows but unsuccessful.
  • 18 July 2013:
    • Finished a first implementation for drawLine2d. Still needs to be a little bit cleaned and drawBegin and drawEnd should be used which is scheduled for tomorrow.
    • Read more about Qt events and started to take in consideration ignoring Tk (search for what and where should be changed)
  • 19 July 2013:
    • Implemented the qt_setFGColor function.
    • Implemented the qt_drawBegin and qt_drawEnd and modified the logic so that the QPainter is created in drawBegin and destroyed in drawEnd
    • Implemented the qt_drawString2D function and the qt_drawPoint2D function.
    • Tested embedding Qt in Tk using XReparentWindow even though it wouldn't be a cross platform solution. The test was unsuccessful but there still are some things that I need do read about so I will continue the test tomorrow.
  • 20 July 2013:
  • 21 July 2013:
    • Break day
  • Conclusion:
    • A good week and at the end of it I have implemented the draw string functionality and the draw line 2d.
    • I also asked various questions regarding the embedding but received no answer until now.
    • Results:

Snapshot2.png Snapshot3.png

Week 6 (22 July - 28 July)

  • Weekly milestones:
    • Implement the draw 3d line functionality
    • Decide on the embedding problem
    • Prepare the midterm evaluation
  • 22 July 2013:
    • Couldn't get to a result from the last week's approach on the embedding (using XReparentWindow funtion)
    • Studied some 3d drawing examples in Qt
  • 23 July 2013:
    • Read more about 3d drawing in Qt
    • Tried to resize the window but until the embedding it's not solved the callbacks are not called on resize event.
    • Tried to find a way to solve the lnk1104 error on windows: tried to make cmake add quotes to libraries dependencies path.
  • 24 July 2013:
    • Modified font size for string drawing according to the size of the window.
    • Discussion with my mentor regarding the embedding problem. Received some suggestions and tested them but still no luck.
    • Sometimes I get a SEGFAULT when closing the dm so I investigated the problem using gdb and valgrind but when I tested the error did not occurred.
  • 25 July 2013:
    • Solved the embedding problem: there still are some things that need to be done better but Qt is displayed in the Tk window. I will make the necessary changes so that everything works as expected in the next days.
    • I want to thank D.Rossberg for his help and support in finding the solution :).
  • 26 July 2013:
    • Result:Tkqt.pngTkqt1.png
      • The window's content is the same like in the first pictures posted but this time Qt content is shown within a Tk window :).
      • As seen in picture one the Qt and the Tk windows have different size (the bottom text does not appear) so when resizing the Tk window the Qt one does not automatically changes zie. I'll work to fix this behaviour and hope to be fixed by tomorrow.
    • Made some sanity checks and fixed some small issues.
  • 27 July 2013:
    • Solved the resize problem: the Qt window now gets resized when the Tk one changes size.
  • 28 July 2013:
    • Studied existing dm_drawVList implementation.
  • Conclusion:
    • Good week in which the embedding problem was solved.

Week 7 (29 July - 4 August)

  • Weekly milestones:
    • Finish drawing.
    • Start working at mouse integration.
  • 29 July 2013:
    • Submitted the evaluation form on melange.
    • A little break
  • 30 July 2013:
    • Implemented the qt_loadMatrix, qt_setWinBounds and qt_drawVList function.
    • The display manager is able to display more complex objects:

Sph.png Tor.png

  • 31 July 2013:
    • Struggled with mouse integration.
    • The problem is that Qt receives the events but the Tk window does not so I tried to make Qt pass the events to Tk but I have been unsuccessful for the moment.
  • 1 August 2013:
    • Continued to find a way to send Tk events from Qt. Still I was unsuccessful.
  • 2 August 2013:
    • Break day
  • 3 August 2013:
    • Tried sending events using the XSendEvent function but there still are things that I need to figure out.
  • 4 August 2013:
    • Managed to send events to the Tk window using Tcl_Eval function. I still have a problem because the events are not processed when they are sent but they are processed later.
  • Conclusion:
    • At the end of this week more complex objects can be drawn in the qt window.
    • Also I have made progress in integrating the mouse between Qt and Tk.

Week 8 (5 August - 11 August)

  • Weekly milestone:
    • Finish the keyboard and mouse integration
  • 5 August:
    • Struggled with locale settings and after an IRC discussion found a solution.
    • Committed the changes I've made during the last days regarding mouse integration.
    • Almost finished the mouse integration: the content resizes when pressing mouse buttons:


  • 6 August 2013:
    • Dealt with Control+LeftMouseButton binding: I successfully managed to rotate the object but I still have some problems because since it starts rotating it never stops:


  • 7 August 2013:
    • Break day
  • 8 August 2013:
    • Solved the rotation problem
    • Read about keyboard events
  • 9 August 2013:
    • Integrated keyboard events:


  • 10 August 2013:
    • Break day
  • 11 August 2013:
    • Searched for a more generic way of dealing with events. I've got a couple of ideas that will ease adding new key bindings to the display manager.
    • Did some more testing to see if everything behaves as expected.
  • Conclusion:
    • Good week in which I've almost finished dealing with keyboard and mouse integration.
    • As I am a bit ahead of schedule I'll focus on testing in the next couple of days.

Week 9

  • Weekly milestone:
    • Finish the keyboard and mouse integration
  • 12 August 2013:
    • Some more testing: found a problem when pressing control+mouse button: at the first move the object jumps in a new position then moves as expected.
  • 13 August 2013:
    • Studied archer code to see how the new display manager can be integrated.
  • 14 August 2013:
    • Break day
  • 15 August 2013:
    • Continued to see how archer works and how can I integrate the new display manager.
  • 16 August 2013:
    • Break day
  • 17 August 2013:
    • Break day
    • I had a small holiday and from tomorrow I'll get back to work.