Arct,
this is not as easy as it sounds as there are several aspects going on.
1) We need to have a small group of developer that can work in sprint’s to design several aspect’s of any new codebase so we have something running in a small amouth of time, this can set the base for further developments.
2) Somebody needs to write a design document ao any developer within the team can follow this design.
3) Somebody needs to write a architectural document so everybody can understand how to develop against LibreCAD, so we don’t get a hack’ish design and put’s us in the same position as we are currently at.
before we do anything, 2) and 3) are very important. I personally have a idea how thing’s should be designed, Dli and I am sure some hard-core c++ user with CAD experience have their own ideas!
The problem is to get everybody on the same line and make time to have this happen...
It was designed with the following in mind:
1) Separate of concern.
* Application (the GUI) has it’s own codebase
* The kernel (that handles CAD entities) has it’s own codebase
* a CAD viewer /that handles viewing of entities) has it’w own codebase.
2) All CAD entities are immutable it has the following advantages
* Very easy to handle unto/redo
* Multi processor ‘ready’
* Easer to make a storage layer (DB, File, REST etc…)
3) ‘Kernel’ handles all entities and it’s modifications through a clear interface
* This will make plugging various things into the kernel a LOT easer without having the modify the viewer or the GUI
Here is a bit of code example to create lines:
void CadMdiChild::on_actionAdd_Random_Lines_triggered() {
lc::CreateEntities* foo = new lc::CreateEntities(_document, "0");
for (int i = 0; i < 1000; i++) {
..
..
foo->append(shared_ptr<const lc::CADEntity>(new lc::Line(lc::geo::Coordinate(x1, y1), lc::geo::Coordinate(x2, y2))));
}
_document->operateOn(shared_ptr<lc::Operation>(foo));
}
The only way to get your drawing modified is using the operateOn method. So even if some code tries to ‘move’ a line/circle etc,
the kernel will never be updated you cannot do this on line , example : myLine=line->Move(10,0);
…
...
-- |
Kind Regards,
e:[hidden email] / Tel. <a href="callto:+1%20803%20426%203350">+1 803 426 3350 / Skype: <a href="callto:r.vantwisk">r.vantwisk http://riesvantwisk.com / chat:<a href="im:vantwisk@gmail.com">vantwisk@gmail.com |
|
On Feb 6, 2014, at 8:25 AM, arct [via LibreCAD] <
[hidden email]> wrote:
Any feedback on this ?