Login  Register

Re: Add entities beeing created to main container...

Posted by fernandohildebrand on Mar 07, 2012; 12:47am
URL: https://forum.librecad.org/Add-entities-beeing-created-to-main-container-tp5539557p5542807.html

Dongxu, I dont get it: Why go through all possible perpendiclar points? Shouldnt snap just check nearest entities from the cursor?

2012/3/6 dxli [via LibreCAD] <[hidden email]>
Hi Fernando,

It's impractical to first generate the entities followed by checking perpendicular conditions.

However, it's possible to follow the rs_creation route. The rs_snapper class holds a boolean flag of "perpendicular enabled". For each new entity drawing action, in the last step, say, like the second point of drawing a line, rs_creation is called, if snap perpendicular is enabled, if not enabled, the usual routine.

within rs_creation, it's needed to implement new methods to create an entity based on info passed from action classes. For example, in the draw line case, it receives the first point from the drawLine action. rs_creation can search through entityContainer and find all perpendicular points, choose the one closest to mouse pointer which is also passed from action classes.

Basically, for each drawing method, there should be one rs_creation. You may first play with the simplest case of "Draw line 2 points".

Regards,

Dongxu


On Mon, Mar 5, 2012 at 7:58 PM, Fernando [via LibreCAD] <[hidden email]> wrote:
Ive been strggling tring to implement snapPerpendicular, and the chief made me realize that there must be some way of passing data of the entity that is beeing created, and that goes far beyond messing with the snaping system. So i propose a method like ->inCreation in the main container, that goes deep into the main engine, so i think is up to the main guys to discuss this.
I also believe that this will benefit future features.


If you reply to this email, your message will be added to the discussion below:
http://forum.librecad.org/Add-entities-beeing-created-to-main-container-tp5539557p5539557.html
To start a new topic under LibreCAD-dev, email [hidden email]
To unsubscribe from LibreCAD-dev, click here.
NAML



--
Dongxu Li, Ph.D.
www.librecad.org




If you reply to this email, your message will be added to the discussion below:
http://forum.librecad.org/Add-entities-beeing-created-to-main-container-tp5539557p5541008.html
To start a new topic under LibreCAD-dev, email [hidden email]
To unsubscribe from LibreCAD-dev, click here.
NAML



--
Fernando da Motta Hildebrand