mardi 29 décembre 2009

Week 11 [21/12 to 27/12]

Work Of The Week



This week was the first Christmas Holiday week. For those 2 week break I prepared a list of tasks I should complete for the project. I update the list during the work also, when new detailed tasks was needed. There was around 20 points to be done, and 13 of them were completed.

The complete list is:

  1. Modify the loading process for OBJ
  2. Add "save normals" options for OBJ
  3. Scale the loaded mesh
  4. Remove the unused "edge" component of a face
    • from Loader
    • from Saver
  5. No double error message when Loader display an error
  6. Rewrite the tooltips of the CameraWidget when the settings changes
  7. Use the translation precision setting
  8. Finish the picking in OpenGL: end up with a unique selection from the mesh
  9. resolve the MeshWidget and the dock resize defaults (mainwidget over the dockwidgets)
  10. Update the settings widget
    • change from a tab to another
    • save and save all
    • reset and reset all
    • default and default all
    • colour and light page
    • no default button to allow enter key to be pressed
    • default values for camera to be used
  11. Find segmentatio fault in loading
  12. Add warning handling for Tasks
  13. Modify the current text format to only load points => real point cloud loading and adapt widget for it
  14. modify the point size in OpenGL

  15. adapt the code to avoid language translation redundancy


  16. add warning if extension name is empty on saving


  17. recognise a triangulated OBJ file


  18. WorkInProgress widget to inform that a task is running


  19. add time information for the task


  20. run another editor from the original one and load in another editor


  21. update the display after closing


And finally the summary of the week work! This week I mostly work on a new process organisation, in order to be able to create a parallel thread more easily to handle a separated action (as loading, saving and later running an algorithm)> It took time to understand how to work with the QThread class, because some points were not obviously explained in the documentation. But after few researches and tests, I managed to create a threaded class called Task, and make the Load and Save classes to inherit from it. In further development the algorithms used to modify the mesh will also inherit from the Task. Creating another thread to handle external processes allow the display thread to continue its job, and avoid a "freezing" look to the interface while a time consuming action is performed.

I also spend a lot of time just after this work to find a segmentation error, caused by a sneaky part of the code, that I taught I wasn't using.

Total worked: 18 hours.







Multiple modifications


I handle the new OBJ loading process, using standard C functions instead of the QString and streaming technique used before. The result is a less sensible loading process, that do not care about spaces between values for example. It now allow all type of OBJ definition to be handle without (normally) causing dangerous troubles. Quad mesh are loaded as Triangulated one, resulting in a strange looking mesh but do not create dangerous failure for loading. Completion of point 1.

Various modification were made on the CameraWidget and MeshWidget to re-distribute tasks. The first scaling code adaptation was done, resulting in strange translation and near/far problems. Was cancelled because causing segmentation fault.

Several modification were made on the interface, mostly to correct few illogic option display and adapt the choices from the settings. Cleaning of the MeshWidget code.

Adding warning handling - task 12 completed

Time worked:
9 h 30

Adapt both Loader and Saver loading and saving function to remove the edge (that is unused) component. Modify the FileSearchWidget to handle the correct option accordingly to the chosen format.
Time worked: 1h



Task: a threaded action



The creation of the threaded task was done in common with the WorkInProgressWidget, as both are related to display the running activity. The main difficulty was to understand the QThread running process to handle the Qt events. Thus it was not difficult to copy the code from my referenced website (see further) but some errors appears just after that. The segmentation fault source was unknown until the 29/12 (week 12).

Time worked:
3 h 30
Segmentation fault search. Not an easy task because it was not thrown when the application was run into the debugger. No solution was found.Time worked: 5 h

Information And References



To use the QThread I used a good explanation from Harold Hunt blog but a also used the previous posted OBJ definition to verify my loader compatibilities with the OBJ standard.

lundi 14 décembre 2009

Week 10 [07/12 to 13/12]


Work Of The Week



This week the loading and saving processes were threaded, in order for the application to not looks like freezing when doing such tasks.

And I started to work on the picking process, thinking of it more precisely and beginning the OpenGL part of the process.


Total worked: 7h hours.




Threading the loading and saving



Basically the idea was to change the static classes Loader and Saver to normal object that extend the QThread one. Then some attributes like the file format, the filename and other details were added to the constructor.
The QThread class invokes the run method in a new thread, separate from the display one when start is called. That suppresses the freeze looking of the GUI when loading huge files.

Finally the MainWindow was adapted to handle such new object, allowing only one loader or saver thread in the application.

Time worked:
2 h 30

Picking in OpenGL



The basic of the picking process was developed. To resume it briefly the SelectionWidget can now handle two type of original data: a NormalizedMesh and a Selection. The first one is the pointer to the original data, and the second the current part to display. If no selection object is there it means that it is the original mesh. Later on the MeshWidget will catch user clicks to send new vertex identifier to the current SelectionWidget that will update its Selection object.

For the moment the Selection class was created, with a full bunch of functions. It is two hash maps of vertices and faces indexes that contains boolean values. If it is true it is in the selection.

I also begin to work on the selection process in OpenGL and done most of it. But no signals are sent yet to warn the SelectionWidget of the modifications (such as no vertex index are return due to a little trouble - the mouse coordinate mush be taken from the MeshWidget coordinate and not the overall application).

Time worked:
4 h 30

Gantt State


No very big news about the Gantt, unless I will be late again soon as my courseworks are taking me more time than expected.


Information And References



This week I read a little about picking in OpenGL, and the previous published websites were used. Nonetheless I also found some information on the following one: Computing normals to achieve flat and smooth shading




Next Week prevision



Next week work will certainly be null as it is the last week for one of my biggest coursework. It takes much more time than expected (I planned 10h on that work and it almost took me 15h and not half is done).

lundi 7 décembre 2009

Week 09 [30/11 to 06/12]


Work Of The Week



I worked quite a lot this week, mostly because I enjoyed it and had time. The interface part was, after all, far more important than expected.


Most of the work was adaptation. I introduced the final architecture for the software, or most of it, this week, and therefore needed to modify most of the interface to make it work.


The other main part was the introduction of the NormalizedMesh that is, as its names indicates it, a mesh that handles shaded view and lightning. It also handles the Wireframe view, that was first part of the SimpleMesh organisation.


As it's been a long time I didn't post a version of the software on that blog, and as the current version is almost finished (for the interface point of view) you can go on my sendpsace to get both sources or win32 executable (that includes sources as well).




Total worked: 23 hours 30.




Adaptation


There is a lot to say about the adaptation, as it was in fact multiple adaptations. Most of them concerned the MeshWidget that were handling most of the operation that it now delegate.


First I continue to work on the CameraWidgwet (that is the camera dock in the interface) and therefore needed to modify the MeshWidget to use it as the centre of all the view informations (translation, rotation are saved in that widget, the MeshWidget is just the user action listener).

Time worked:
1 h 30

Then I introduced the SettingsWidget, that is a window to save, load or reset the global default settings. It is using the QSetting object, that permit to be system independent (saving on the registry in Windows, in XML files for OS X and configuration files for Unix). This required some work, more than expected, and will need some few review before the end. Otherwise it is almost finished.

Time worked:
8 h 30

I created a new type of button: the ColourButton that represent a colour choice, shows it, and allow the user to re-define it by click on it.

Time worked:
1 h

I finally added the last widgets: the SelectionListWidget and the SelectionWidget that are both really important. The second one will handle the whole display machine, containing a selection or the original mesh. The first will contain the list of selection and display it. For the moment only one selection is allowed: the loaded mesh, but it will evolve to more soon. I needed to adapt most of the Interface components to deal with that new architecture, as the MainWindow and the MeshWidget were the most concerned.

Time worked:
4 h

Little and simple work, but I created the icons picture for the interface. They are not pretty but are, as far as I known, obvious.

Time worked:
1 h

NormalizedMesh and the shaded view



This was the most important modification of the week, as it makes me change most of the current code. The changes were smalls, but very important. And some revisions will certainly be needed to improve the current software.


First of all I created the object itself, that is a sub-class of the previous SimpleMesh. Now, as SimpleMesh is just a point cloud representation. The whole faces are handles by the NormalizedMesh. I also worked on the faces and vertices normals computation, and thanks to a good website listed bellow I was pretty much quick. I think I will adapt the algorithm for the vertices computation, as it looks pretty much time consuming for big meshes (doing too much loops that could be avoided by some indexing). This works also contains the adaptation of all the interface object that were using the SimpleMesh to handles the new functionalities.

Time worked:
6 h 30

Project Structure



This work was basically adapting the .pro, that represents a Qt project. This files handles the creation of the Makefiles, and contains all the information about the project itself (source files, designer files, resources, ...). I updated it in order to have a better organisation, and to handle the "install" process that will create a folder with all that is needed to run the software.

Time worked:
2 h


Gantt State



I didn't publish a Gantt chart since a while. It didn't changes a lot. I just make the current task to run longuer (interface creation) as I had some delays and as it takes more time that planned. However the delays are not important at all, and I still have some free time between the second part planned end and the begining of the report writing.




Current task:



General view:




Information And References



I didn't read a lot for this week work, even if I worked a lot. Most of it was Qt documentation.


I used several good websites to understand the normal computation. It is barely simple:

The first one was the one I used to understand more in details how the normals are computed, and the second one was used for the coding part. I mostly copied the code, and adapt it for my purposes.

Next Week prevision

The interface main actions are almost finished. Was is left is the picking part, that is a milestone in this part of the software.

I will also work on a multi-window software (create one new window by loaded mesh).

If I have time I will also work on the loading and saving process, to be handle by threads, in order to do not make the application to freeze during long processes. I will also try to make a special "work in progress" widget that will display few messages and a progress bar about a current time-consuming work.

  • OpenGl picking with Qt
  • Multiple window soft
  • Work in progress widget for loading and saving processes.

mercredi 2 décembre 2009

Week 08 [23/11 to 29/11]


Work Of The Week



This week I worked less than expected. I mostly adapt the existing code to finally have its namespace structure and create the Camera widget for the interface.



Total worked: 6 hours 30.




Namespace adaptation



This work wasn't difficult, but needed to be done. I didn't write any namespace during the past weeks and therefore modify all the files. I also added the licence text in each file. All the software is under the LGPL.

Time worked:
1 h 30

Camera Widget



I created the widget with the Qt designer, as for the others widget. But this one created troubles as a lot of signals and slots needed to be create (one per option, plus others). It also required linking with the MeshWidget object to update the values and get the user interactions. I didn't connect all the actions, just the rotation. But I will do that further on.

Time worked:
5 h


Gantt State



Still no Gantt state... As I need to adapt it for the few time lost last week and didn't take time to do so.



Information And References



The only reference that is related to this week work is the LGPL website: www.gnu.org/copyleft/lesser.html





Next Week prevision



Next week I will continue to work on the Camera widget in order to finish it, and may begin to add new OpenGl features like lightning (as Eyad asked for it during our last meeting).



  • Continue the Camera widget adaptation
  • lightning for OpenGl