Development environment should be set up during community bonding period. If that can help someone, here is a list of packages required to build LibreCAD 3 from source on ArchLinux :

Instructions to build LibreCAD 3 and libdxfrw are on the ReadMe files.

Work done for LibreCAD 3

I updated my project plan

  • Selection: That was planned to store an EntityContainer with selected entities in the kernel, but it will stay in the DocumentCanvas
  • UI: First, I choose QtLua to create and manage windows. But after some tests the existing LC kernel bindings couldn't be included, and we can't consider maintaining two versions of the same bindings or removing the kernel bindings and having a dependency on Qt for the kernel. So I'll keep using the lua-intf library and create bindings for Qt.
  • Lua: An access to the painter methods will be created

You can see my project plan here

The Lua GUI made for the evaluation has been improved:

  • Modified Lua/Qt connection by passing a LuaRef to C++ instead of Lua function name as a string, because that caused crashes when the slot was called, and not when connected
  • The events and operations are separated from other documents
  • The system cursor is now hidden and replaced by LC's one
  • The operations are now using the snap points
  • Fixed a bug in Lua code that created two callbacks when an event was not used before, that created an invisible entity (a line with the same point for begin and end) which make the program crash when dragging this entity.

What can be improved:

  • Move line operations in a new file when other entities will be supported

I began the work on selection because I have exams the week of the 23rd May. The current selection was a demonstration (entities were immediately deselected when mouse is released), what changed :

  • DocumentCanvas was modified to keep the current selection in a new EntityContainer and to create accessor for current selection.
  • It's now possible to add new entities to current selection (by pressing CTRL key)
  • Selection area is disabled when dragging an entity
  • Add drag points for entities (only implemented for Line currently). They are shown when hovering the entity in the canvas, the entity can be modified by dragging these points.
  • If some entities are selected, only them are dragable, so if two (or more) entities shares the same point, it's possible to move only one of these points
  • Allow undo of drag entity

Problems and possible improvements:

  • Add to current selection should deselect already selected entities
  • Currently, some entities are not dragable (for example a circle), it would require to add drag points all over the circle, maybe we could get the cursor position here and send only a point on the circle
  • Drag points of entities are shown only when it is in a 5*5 area around the cursor, some entities can have points outside of this area, here we could show all drag points of selected entities.
  • Moving an entity create two undo operations, one when removing the entity from the document, and one when recreating it in the document. It's possible to fix this without modifying Builder but the code doesn't look good
    //Remove entity
    //Recreating entity 
    builder->undo(); //Prevent deleting the already deleted entity
    builder->redo(); //Doesn't create new undo operation

The builder would need two modifications :
One to clear the stack after execute() because we need to use the same builder to remove and create the entity. Currently, that will only delete the two entities (and crash because one is not in the document). The other to prevent the creation of a second undo operation, here we have two options:

  • Use a parameter in execute() to prevent creation of the undo operation
  • Create a new method to execute the operations in the stack with no modifications on the document. The entity will be removed manually when selected in the document, and re-inserted before executing the Builder operations, or we can make the Builder check if an entity exists before trying to remove it.

You can see the work on the selection in this commit. It will be continued after the 28th May.