Hello Johan. Thanks for your help, I have a working code fot testing that create a new custom widget in the BSpline live effect of this branch: lp:~jabiertxof/inkscape/0.49.x+SpiroLive+BSpline.
Thanks to you, and ~suv poining, i undertand a little bit more about c++ and inkscape!
@~suv: Any sugestion/feedback more? Another branch testing?
Hi, Jabier.
-----Mensaje original----- De: Johan Engelen <jbc.engelen@...2592...> Para: jabier.arraiza@...2893... Cc: inkscape-devel@lists.sourceforge.net Asunto: Re: [Inkscape-devel] Manipulate original paths from a livepatheffect Fecha: Thu, 14 Mar 2013 00:12:51 +0100
On 13-3-2013 19:40, Jabier Arraiza wrote:
Hi Joan.
Is for lpe-bspline. I want to update the handles of original path for reset all handles to a fixed position. Need it because the bspline lpe use the values of the handles to generate ths BSpline, so if I move handles width the node tool the bspline update too. I need if is posibol to do it whith the LPE widget this otherwise, whithout the node tool.
I think it is a good idea to be able to use the handles for LPE calculations! You could make the change to the handles upon applying the effect, using Effect::doOnApply(SPLPEItem const* lpeitem). However, as you can see, that method is now defined using const, meaning you are not allowed to change the path. It is safe to change the path (the method that calls doOnApply disables LPE calculation), but perhaps it is better to add it to the effect's LPE dialog buttons (so that one can reset the handles also after modifying them).
It is some work to add a button to the LPE widget, but not impossible. Upon pressing the button, it can take the desktop selection, and modify the path accordingly as you wish. To add a button, your LPE has to define its own virtual Gtk::Widget * newWidget(); and call Effect::newWidget() first, like so:
Gtk::Widget * YourLPE::newWidget() { Gtk::VBox * vbox = dynamic_castGtk::VBox*( Effect::newWidget() );
// create your button widget .......... vbox->pack_start(*widget, true, true, 2);
return dynamic_cast<Gtk::Widget *>(vbox); }
ciao, Johan