Page 1 of 1

Spline Event Handler

Posted: Fri Aug 30, 2013 9:16 am
by luckyChris
Hi,

I´m new in QCAD - want to extend the spline so that on the line circles within a constant spacing are drawn. While drawing the line, I found some functions where these points can be placed, but my question is: after drawing, when the user moves a control point, which function in SplineControlPoints is called so I can update the position of my circles on the line?

Thanks for anny suggestion!

Chris

Re: Spline Event Handler

Posted: Tue Sep 03, 2013 2:50 pm
by andrew
The only way I can think of is to install a transaction listener to get notified whenever something changes in your drawing. Based on the IDs of the object that were affected by the change you would then have to figure out each time which circles belong to which spline. This might work for the lifetime of a drawing and as long as the whole construction is not duplicated, but once the drawing is stored and reloaded from a file, the IDs change and the spline / circle relationship would be lost or would have to be reestablished.

Note that there are many pitfalls to keep in mind: what happens if the spline is deleted, copied to the clipboard, duplicated, etc.