LibreCAD 3 Development Logs

Development logs of GSoC 2016

No comments

Today I sent the pull request with modification of unit tests. Every test were moved to their own file and the directory structure correspond to the LibreCAD one (kernel tests are in unittests/kernel...).
Now the unit test creation is faster as before every tests were recompiled on each modification.

I also copied the required files for the DxfLinePattern selector problem, the bug is still present (DxfLinePattern is correct but cast to EntityMetaType is incorrect). One temporary solution is to overload the add function of MetaInfo with a DxfLinePattern parameter.

No comments

I sent a pull request containing the unit tests for layers and line patterns dialogs today.
During creation of these unit tests I saw the compilation of main.cpp is taking too much time. It's because every test is written as a .h file and included in main.cpp.
The solution is to change .h files to .cpp and include them in CMakeLists.txt, which will make them compile separately.

No comments

Today I finished the layer unit tests, which helped find some bugs (layer list wasn't empty when you close the document and list is empty when you pass a document in the constructor), which are fixed now.
I'll send a pull request with the line patterns unit tests next week.

No comments

I didn't get to resolve the bug which prevent the line pattern selected from the toolbar to be applied to the entity. It seems to be a problem of casting to base class in Lua.
When add method MetaInfo is called with selected line pattern, the name function seems to be called instead of metaTypeID one, and the cast to DxfLinePattern is impossible.

I tried to add two methods in Lua :

  • EntityMetaType metaTypeID() => return line pattern name
  • DxfLinePattern metaTypeID() => returns "_LINEPATTERN" which is correct

I began the work on unit tests, what will be tested
for layers:

  • Creation
  • Selection
  • Edition
  • Remove

for line patterns:

  • Creation
  • Edition
  • Copy
  • Selection
  • Remove

No comments

Today I have added the line pattern selector in the toolbar and added a function to generate MetaInfo with the selected line pattern, but the lines are always continuous. The entity MetaInfo seems to contain the DxfLinePattern, but the name (MetaInfo name, not the line pattern one) is empty, it should be _LINEPATTERN.

After fixing this I could begin the unit tests

No comments

Today I worked on the line pattern manager

It supports updating on new/remove/replace layer and on document change.
I'm currently changing the way to handle the document change for the widgets. Before I was giving a pointer to QMdiArea as parameter and watch for his events. Now I manage the window changed event in Lua and call each widget setDocument function.

No comments

Today I added the option to create a new DxfLinePattern in the document during layer creation.
The creation dialog now have an access to the document so the line pattern is saved even if it is not used for the newly created layer.

The next steps are to add a line pattern manager and a selector in the toolbar. Then I could focus on the unit tests.

No comments

Yesterday we found that the dots in line patterns are not shown because their size is too small.
I've made changes to DxfLinePattern to generate the internal pattern with dot size equals to line width, a new pattern for each line width is created and cached.
Only the dot size changes, so small lines might be smaller than dots in some cases.

The layer widget now have a button to edit a layer. Before only name could be changed by double-clicking on it.
The differences with LC2 are the ability to modify layer name, and the layer doesn't need to be selected before editing it.

No comments

I've added to the two Lua plugins (gear and fractal tree) parameters to let the user customize the created gear or fractal tree.

Parameters for Gear:

  • Number of teeth
  • Pressure angle
  • Circular pitch
  • Center
  • External point (for size)

Parameters for Fractal Tree:

  • Starting angle
  • Depth
  • Origin

Lines are always using continuous line pattern because the draw method in DocumentCanvas isn't looking for DxfLinePattern of entity layer.
It's now working but some patterns are too small to be displayed.

No comments

Today I continued the work on DxfLinePattern support in GUI. The ByBlock and ByLayer are now hidden by default and needs to be added manually, which add them in the first line of QComboBox menu.
A new entry allow to add a new DxfLinePattern, the creation dialog is not finished yet, it should be tomorrow.

I'll wait until drawing with line patterns is fully supported before adding options to select line pattern and color for individual entities. I'll continue the work on spline creation.