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