summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-bspline.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-04-10 20:13:49 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-04-10 20:13:49 +0000
commitfa68fdb0ddb24cf72b56d2fc895e784b8cfcbc9a (patch)
treef5416fe697de60e3dd284e44e40ec285834ee34b /src/live_effects/lpe-bspline.cpp
parentRename a variable to current coding style (diff)
parentadded info about multiple pen feature in gui (diff)
downloadinkscape-fa68fdb0ddb24cf72b56d2fc895e784b8cfcbc9a.tar.gz
inkscape-fa68fdb0ddb24cf72b56d2fc895e784b8cfcbc9a.zip
update to trunk
(bzr r12588.1.42)
Diffstat (limited to 'src/live_effects/lpe-bspline.cpp')
-rw-r--r--src/live_effects/lpe-bspline.cpp320
1 files changed, 160 insertions, 160 deletions
diff --git a/src/live_effects/lpe-bspline.cpp b/src/live_effects/lpe-bspline.cpp
index 5d5a6e616..ecbfef76a 100644
--- a/src/live_effects/lpe-bspline.cpp
+++ b/src/live_effects/lpe-bspline.cpp
@@ -15,26 +15,26 @@
namespace Inkscape {
namespace LivePathEffect {
-const double handleCubicGap = 0.01;
-const double noPower = 0.0;
-const double defaultStartPower = 0.3334;
-const double defaultEndPower = 0.6667;
+const double HANDLE_CUBIC_GAP = 0.01;
+const double NO_POWER = 0.0;
+const double DEFAULT_START_POWER = 0.3334;
+const double DEFAULT_END_POWER = 0.6667;
LPEBSpline::LPEBSpline(LivePathEffectObject *lpeobject)
: Effect(lpeobject),
steps(_("Steps with CTRL:"), _("Change number of steps with CTRL pressed"), "steps", &wr, this, 2),
helper_size(_("Helper size:"), _("Helper size"), "helper_size", &wr, this, 0),
- ignoreCusp(_("Ignore cusp nodes"), _("Change ignoring cusp nodes"), "ignoreCusp", &wr, this, true),
- onlySelected(_("Change only selected nodes"), _("Change only selected nodes"), "onlySelected", &wr, this, false),
- weight(_("Change weight:"), _("Change weight of the effect"), "weight", &wr, this, defaultStartPower)
+ ignore_cusp(_("Ignore cusp nodes"), _("Change ignoring cusp nodes"), "ignore_cusp", &wr, this, true),
+ only_selected(_("Change only selected nodes"), _("Change only selected nodes"), "only_selected", &wr, this, false),
+ weight(_("Change weight:"), _("Change weight of the effect"), "weight", &wr, this, DEFAULT_START_POWER)
{
registerParameter(&weight);
registerParameter(&steps);
registerParameter(&helper_size);
- registerParameter(&ignoreCusp);
- registerParameter(&onlySelected);
+ registerParameter(&ignore_cusp);
+ registerParameter(&only_selected);
- weight.param_set_range(noPower, 1);
+ weight.param_set_range(NO_POWER, 1);
weight.param_set_increments(0.1, 0.1);
weight.param_set_digits(4);
@@ -51,7 +51,7 @@ LPEBSpline::~LPEBSpline() {}
void LPEBSpline::doBeforeEffect (SPLPEItem const* /*lpeitem*/)
{
- if(!hp.empty()){
+ if(!hp.empty()) {
hp.clear();
}
}
@@ -69,7 +69,7 @@ void LPEBSpline::doOnApply(SPLPEItem const* lpeitem)
void LPEBSpline::doEffect(SPCurve *curve)
{
- if (curve->get_segment_count() < 1){
+ if (curve->get_segment_count() < 1) {
return;
}
// Make copy of old path as it is changed during processing
@@ -79,22 +79,22 @@ void LPEBSpline::doEffect(SPCurve *curve)
for (Geom::PathVector::const_iterator path_it = original_pathv.begin();
path_it != original_pathv.end(); ++path_it) {
- if (path_it->empty()){
+ if (path_it->empty()) {
continue;
}
hp.push_back(*path_it);
Geom::Path::const_iterator curve_it1 = path_it->begin();
Geom::Path::const_iterator curve_it2 = ++(path_it->begin());
Geom::Path::const_iterator curve_endit = path_it->end_default();
- SPCurve *nCurve = new SPCurve();
+ SPCurve *curve_n = new SPCurve();
Geom::Point previousNode(0, 0);
Geom::Point node(0, 0);
- Geom::Point pointAt1(0, 0);
- Geom::Point pointAt2(0, 0);
- Geom::Point nextPointAt1(0, 0);
- Geom::D2<Geom::SBasis> SBasisIn;
- Geom::D2<Geom::SBasis> SBasisOut;
- Geom::D2<Geom::SBasis> SBasisHelper;
+ Geom::Point point_at1(0, 0);
+ Geom::Point point_at2(0, 0);
+ Geom::Point next_point_at1(0, 0);
+ Geom::D2<Geom::SBasis> sbasis_in;
+ Geom::D2<Geom::SBasis> sbasis_out;
+ Geom::D2<Geom::SBasis> sbasis_helper;
Geom::CubicBezier const *cubic = NULL;
if (path_it->closed()) {
// if the path is closed, maybe we have to stop a bit earlier because the
@@ -110,27 +110,27 @@ void LPEBSpline::doEffect(SPCurve *curve)
curve_endit = path_it->end_open();
}
}
- nCurve->moveto(curve_it1->initialPoint());
+ curve_n->moveto(curve_it1->initialPoint());
while (curve_it1 != curve_endit) {
SPCurve *in = new SPCurve();
in->moveto(curve_it1->initialPoint());
in->lineto(curve_it1->finalPoint());
cubic = dynamic_cast<Geom::CubicBezier const *>(&*curve_it1);
if (cubic) {
- SBasisIn = in->first_segment()->toSBasis();
+ sbasis_in = in->first_segment()->toSBasis();
if(are_near((*cubic)[1],(*cubic)[0]) && !are_near((*cubic)[2],(*cubic)[3])) {
- pointAt1 = SBasisIn.valueAt(defaultStartPower);
+ point_at1 = sbasis_in.valueAt(DEFAULT_START_POWER);
} else {
- pointAt1 = SBasisIn.valueAt(Geom::nearest_point((*cubic)[1], *in->first_segment()));
+ point_at1 = sbasis_in.valueAt(Geom::nearest_point((*cubic)[1], *in->first_segment()));
}
if(are_near((*cubic)[2],(*cubic)[3]) && !are_near((*cubic)[1],(*cubic)[0])) {
- pointAt2 = SBasisIn.valueAt(defaultEndPower);
+ point_at2 = sbasis_in.valueAt(DEFAULT_END_POWER);
} else {
- pointAt2 = SBasisIn.valueAt(Geom::nearest_point((*cubic)[2], *in->first_segment()));
+ point_at2 = sbasis_in.valueAt(Geom::nearest_point((*cubic)[2], *in->first_segment()));
}
} else {
- pointAt1 = in->first_segment()->initialPoint();
- pointAt2 = in->first_segment()->finalPoint();
+ point_at1 = in->first_segment()->initialPoint();
+ point_at2 = in->first_segment()->finalPoint();
}
in->reset();
delete in;
@@ -140,14 +140,14 @@ void LPEBSpline::doEffect(SPCurve *curve)
out->lineto(curve_it2->finalPoint());
cubic = dynamic_cast<Geom::CubicBezier const *>(&*curve_it2);
if (cubic) {
- SBasisOut = out->first_segment()->toSBasis();
+ sbasis_out = out->first_segment()->toSBasis();
if(are_near((*cubic)[1],(*cubic)[0]) && !are_near((*cubic)[2],(*cubic)[3])) {
- nextPointAt1 = SBasisIn.valueAt(defaultStartPower);
+ next_point_at1 = sbasis_in.valueAt(DEFAULT_START_POWER);
} else {
- nextPointAt1 = SBasisOut.valueAt(Geom::nearest_point((*cubic)[1], *out->first_segment()));
+ next_point_at1 = sbasis_out.valueAt(Geom::nearest_point((*cubic)[1], *out->first_segment()));
}
} else {
- nextPointAt1 = out->first_segment()->initialPoint();
+ next_point_at1 = out->first_segment()->initialPoint();
}
out->reset();
delete out;
@@ -156,14 +156,14 @@ void LPEBSpline::doEffect(SPCurve *curve)
SPCurve *start = new SPCurve();
start->moveto(path_it->begin()->initialPoint());
start->lineto(path_it->begin()->finalPoint());
- Geom::D2<Geom::SBasis> SBasisStart = start->first_segment()->toSBasis();
- SPCurve *lineHelper = new SPCurve();
+ Geom::D2<Geom::SBasis> sbasis_start = start->first_segment()->toSBasis();
+ SPCurve *line_helper = new SPCurve();
cubic = dynamic_cast<Geom::CubicBezier const *>(&*path_it->begin());
if (cubic) {
- lineHelper->moveto(SBasisStart.valueAt(
+ line_helper->moveto(sbasis_start.valueAt(
Geom::nearest_point((*cubic)[1], *start->first_segment())));
} else {
- lineHelper->moveto(start->first_segment()->initialPoint());
+ line_helper->moveto(start->first_segment()->initialPoint());
}
start->reset();
delete start;
@@ -171,41 +171,41 @@ void LPEBSpline::doEffect(SPCurve *curve)
SPCurve *end = new SPCurve();
end->moveto(curve_it1->initialPoint());
end->lineto(curve_it1->finalPoint());
- Geom::D2<Geom::SBasis> SBasisEnd = end->first_segment()->toSBasis();
+ Geom::D2<Geom::SBasis> sbasis_end = end->first_segment()->toSBasis();
cubic = dynamic_cast<Geom::CubicBezier const *>(&*curve_it1);
if (cubic) {
- lineHelper->lineto(SBasisEnd.valueAt(
+ line_helper->lineto(sbasis_end.valueAt(
Geom::nearest_point((*cubic)[2], *end->first_segment())));
} else {
- lineHelper->lineto(end->first_segment()->finalPoint());
+ line_helper->lineto(end->first_segment()->finalPoint());
}
end->reset();
delete end;
- SBasisHelper = lineHelper->first_segment()->toSBasis();
- lineHelper->reset();
- delete lineHelper;
- node = SBasisHelper.valueAt(0.5);
- nCurve->curveto(pointAt1, pointAt2, node);
- nCurve->move_endpoints(node, node);
+ sbasis_helper = line_helper->first_segment()->toSBasis();
+ line_helper->reset();
+ delete line_helper;
+ node = sbasis_helper.valueAt(0.5);
+ curve_n->curveto(point_at1, point_at2, node);
+ curve_n->move_endpoints(node, node);
} else if ( curve_it2 == curve_endit) {
- nCurve->curveto(pointAt1, pointAt2, curve_it1->finalPoint());
- nCurve->move_endpoints(path_it->begin()->initialPoint(), curve_it1->finalPoint());
+ curve_n->curveto(point_at1, point_at2, curve_it1->finalPoint());
+ curve_n->move_endpoints(path_it->begin()->initialPoint(), curve_it1->finalPoint());
} else {
- SPCurve *lineHelper = new SPCurve();
- lineHelper->moveto(pointAt2);
- lineHelper->lineto(nextPointAt1);
- SBasisHelper = lineHelper->first_segment()->toSBasis();
- lineHelper->reset();
- delete lineHelper;
+ SPCurve *line_helper = new SPCurve();
+ line_helper->moveto(point_at2);
+ line_helper->lineto(next_point_at1);
+ sbasis_helper = line_helper->first_segment()->toSBasis();
+ line_helper->reset();
+ delete line_helper;
previousNode = node;
- node = SBasisHelper.valueAt(0.5);
+ node = sbasis_helper.valueAt(0.5);
Geom::CubicBezier const *cubic2 = dynamic_cast<Geom::CubicBezier const *>(&*curve_it1);
if((cubic && are_near((*cubic)[0],(*cubic)[1])) || (cubic2 && are_near((*cubic2)[2],(*cubic2)[3]))) {
node = curve_it1->finalPoint();
}
- nCurve->curveto(pointAt1, pointAt2, node);
+ curve_n->curveto(point_at1, point_at2, node);
}
- if(!are_near(node,curve_it1->finalPoint()) && helper_size > 0.0){
+ if(!are_near(node,curve_it1->finalPoint()) && helper_size > 0.0) {
drawHandle(node, helper_size);
}
++curve_it1;
@@ -213,15 +213,15 @@ void LPEBSpline::doEffect(SPCurve *curve)
}
//y cerramos la curva
if (path_it->closed()) {
- nCurve->closepath_current();
+ curve_n->closepath_current();
}
- curve->append(nCurve, false);
- nCurve->reset();
- delete nCurve;
+ curve->append(curve_n, false);
+ curve_n->reset();
+ delete curve_n;
}
- if(helper_size > 0.0){
+ if(helper_size > 0.0) {
Geom::PathVector const pathv = curve->get_pathvector();
- hp.push_back(pathv[0]);
+ hp.push_back(pathv[0]);
}
}
@@ -256,40 +256,40 @@ Gtk::Widget *LPEBSpline::newWidget()
Gtk::Widget *widg = dynamic_cast<Gtk::Widget *>(param->param_newWidget());
if (param->param_key == "weight") {
Gtk::HBox * buttons = Gtk::manage(new Gtk::HBox(true,0));
- Gtk::Button *defaultWeight =
+ Gtk::Button *default_weight =
Gtk::manage(new Gtk::Button(Glib::ustring(_("Default weight"))));
- defaultWeight->signal_clicked()
+ default_weight->signal_clicked()
.connect(sigc::mem_fun(*this, &LPEBSpline::toDefaultWeight));
- buttons->pack_start(*defaultWeight, true, true, 2);
- Gtk::Button *makeCusp =
+ buttons->pack_start(*default_weight, true, true, 2);
+ Gtk::Button *make_cusp =
Gtk::manage(new Gtk::Button(Glib::ustring(_("Make cusp"))));
- makeCusp->signal_clicked()
+ make_cusp->signal_clicked()
.connect(sigc::mem_fun(*this, &LPEBSpline::toMakeCusp));
- buttons->pack_start(*makeCusp, true, true, 2);
+ buttons->pack_start(*make_cusp, true, true, 2);
vbox->pack_start(*buttons, true, true, 2);
}
if (param->param_key == "weight" || param->param_key == "steps") {
- Inkscape::UI::Widget::Scalar *widgRegistered =
+ Inkscape::UI::Widget::Scalar *widg_registered =
Gtk::manage(dynamic_cast<Inkscape::UI::Widget::Scalar *>(widg));
- widgRegistered->signal_value_changed()
+ widg_registered->signal_value_changed()
.connect(sigc::mem_fun(*this, &LPEBSpline::toWeight));
- widg = dynamic_cast<Gtk::Widget *>(widgRegistered);
+ widg = dynamic_cast<Gtk::Widget *>(widg_registered);
if (widg) {
- Gtk::HBox * scalarParameter = dynamic_cast<Gtk::HBox *>(widg);
- std::vector< Gtk::Widget* > childList = scalarParameter->get_children();
- Gtk::Entry* entryWidg = dynamic_cast<Gtk::Entry *>(childList[1]);
- entryWidg->set_width_chars(6);
+ Gtk::HBox * hbox_weight_steps = dynamic_cast<Gtk::HBox *>(widg);
+ std::vector< Gtk::Widget* > childList = hbox_weight_steps->get_children();
+ Gtk::Entry* entry_widget = dynamic_cast<Gtk::Entry *>(childList[1]);
+ entry_widget->set_width_chars(6);
}
}
- if (param->param_key == "onlySelected") {
- Gtk::CheckButton *widgRegistered =
+ if (param->param_key == "only_selected") {
+ Gtk::CheckButton *widg_registered =
Gtk::manage(dynamic_cast<Gtk::CheckButton *>(widg));
- widg = dynamic_cast<Gtk::Widget *>(widgRegistered);
+ widg = dynamic_cast<Gtk::Widget *>(widg_registered);
}
- if (param->param_key == "ignoreCusp") {
- Gtk::CheckButton *widgRegistered =
+ if (param->param_key == "ignore_cusp") {
+ Gtk::CheckButton *widg_registered =
Gtk::manage(dynamic_cast<Gtk::CheckButton *>(widg));
- widg = dynamic_cast<Gtk::Widget *>(widgRegistered);
+ widg = dynamic_cast<Gtk::Widget *>(widg_registered);
}
Glib::ustring *tip = param->param_getTooltip();
if (widg) {
@@ -310,12 +310,12 @@ Gtk::Widget *LPEBSpline::newWidget()
void LPEBSpline::toDefaultWeight()
{
- changeWeight(defaultStartPower);
+ changeWeight(DEFAULT_START_POWER);
}
void LPEBSpline::toMakeCusp()
{
- changeWeight(noPower);
+ changeWeight(NO_POWER);
}
void LPEBSpline::toWeight()
@@ -323,22 +323,22 @@ void LPEBSpline::toWeight()
changeWeight(weight);
}
-void LPEBSpline::changeWeight(double weightValue)
+void LPEBSpline::changeWeight(double weight_ammount)
{
SPPath *path = dynamic_cast<SPPath *>(sp_lpe_item);
- if(path){
+ if(path) {
SPCurve *curve = path->get_curve_for_edit();
- LPEBSpline::doBSplineFromWidget(curve, weightValue);
+ doBSplineFromWidget(curve, weight_ammount);
gchar *str = sp_svg_write_path(curve->get_pathvector());
path->getRepr()->setAttribute("inkscape:original-d", str);
}
}
-void LPEBSpline::doBSplineFromWidget(SPCurve *curve, double weightValue)
+void LPEBSpline::doBSplineFromWidget(SPCurve *curve, double weight_ammount)
{
using Geom::X;
using Geom::Y;
-
+
if (curve->get_segment_count() < 1)
return;
// Make copy of old path as it is changed during processing
@@ -348,20 +348,20 @@ void LPEBSpline::doBSplineFromWidget(SPCurve *curve, double weightValue)
for (Geom::PathVector::const_iterator path_it = original_pathv.begin();
path_it != original_pathv.end(); ++path_it) {
- if (path_it->empty()){
+ if (path_it->empty()) {
continue;
}
Geom::Path::const_iterator curve_it1 = path_it->begin();
Geom::Path::const_iterator curve_it2 = ++(path_it->begin());
Geom::Path::const_iterator curve_endit = path_it->end_default();
- SPCurve *nCurve = new SPCurve();
- Geom::Point pointAt0(0, 0);
- Geom::Point pointAt1(0, 0);
- Geom::Point pointAt2(0, 0);
- Geom::Point pointAt3(0, 0);
- Geom::D2<Geom::SBasis> SBasisIn;
- Geom::D2<Geom::SBasis> SBasisOut;
+ SPCurve *curve_n = new SPCurve();
+ Geom::Point point_at0(0, 0);
+ Geom::Point point_at1(0, 0);
+ Geom::Point point_at2(0, 0);
+ Geom::Point point_at3(0, 0);
+ Geom::D2<Geom::SBasis> sbasis_in;
+ Geom::D2<Geom::SBasis> sbasis_out;
Geom::CubicBezier const *cubic = NULL;
if (path_it->closed()) {
// if the path is closed, maybe we have to stop a bit earlier because the
@@ -377,120 +377,120 @@ void LPEBSpline::doBSplineFromWidget(SPCurve *curve, double weightValue)
curve_endit = path_it->end_open();
}
}
- nCurve->moveto(curve_it1->initialPoint());
+ curve_n->moveto(curve_it1->initialPoint());
while (curve_it1 != curve_endit) {
SPCurve *in = new SPCurve();
in->moveto(curve_it1->initialPoint());
in->lineto(curve_it1->finalPoint());
cubic = dynamic_cast<Geom::CubicBezier const *>(&*curve_it1);
- pointAt0 = in->first_segment()->initialPoint();
- pointAt3 = in->first_segment()->finalPoint();
- SBasisIn = in->first_segment()->toSBasis();
- if (!onlySelected) {
+ point_at0 = in->first_segment()->initialPoint();
+ point_at3 = in->first_segment()->finalPoint();
+ sbasis_in = in->first_segment()->toSBasis();
+ if (!only_selected) {
if (cubic) {
- if (!ignoreCusp || !Geom::are_near((*cubic)[1], pointAt0)) {
- pointAt1 = SBasisIn.valueAt(weightValue);
- if (weightValue != noPower) {
- pointAt1 =
- Geom::Point(pointAt1[X] + handleCubicGap, pointAt1[Y] + handleCubicGap);
+ if (!ignore_cusp || !Geom::are_near((*cubic)[1], point_at0)) {
+ point_at1 = sbasis_in.valueAt(weight_ammount);
+ if (weight_ammount != NO_POWER) {
+ point_at1 =
+ Geom::Point(point_at1[X] + HANDLE_CUBIC_GAP, point_at1[Y] + HANDLE_CUBIC_GAP);
}
} else {
- pointAt1 = in->first_segment()->initialPoint();
+ point_at1 = in->first_segment()->initialPoint();
}
- if (!ignoreCusp || !Geom::are_near((*cubic)[2], pointAt3)) {
- pointAt2 = SBasisIn.valueAt(1 - weightValue);
- if (weightValue != noPower) {
- pointAt2 =
- Geom::Point(pointAt2[X] + handleCubicGap, pointAt2[Y] + handleCubicGap);
+ if (!ignore_cusp || !Geom::are_near((*cubic)[2], point_at3)) {
+ point_at2 = sbasis_in.valueAt(1 - weight_ammount);
+ if (weight_ammount != NO_POWER) {
+ point_at2 =
+ Geom::Point(point_at2[X] + HANDLE_CUBIC_GAP, point_at2[Y] + HANDLE_CUBIC_GAP);
}
} else {
- pointAt2 = in->first_segment()->finalPoint();
+ point_at2 = in->first_segment()->finalPoint();
}
} else {
- if (!ignoreCusp && weightValue != noPower) {
- pointAt1 = SBasisIn.valueAt(weightValue);
- if (weightValue != noPower) {
- pointAt1 =
- Geom::Point(pointAt1[X] + handleCubicGap, pointAt1[Y] + handleCubicGap);
+ if (!ignore_cusp && weight_ammount != NO_POWER) {
+ point_at1 = sbasis_in.valueAt(weight_ammount);
+ if (weight_ammount != NO_POWER) {
+ point_at1 =
+ Geom::Point(point_at1[X] + HANDLE_CUBIC_GAP, point_at1[Y] + HANDLE_CUBIC_GAP);
}
- pointAt2 = SBasisIn.valueAt(1 - weightValue);
- if (weightValue != noPower) {
- pointAt2 =
- Geom::Point(pointAt2[X] + handleCubicGap, pointAt2[Y] + handleCubicGap);
+ point_at2 = sbasis_in.valueAt(1 - weight_ammount);
+ if (weight_ammount != NO_POWER) {
+ point_at2 =
+ Geom::Point(point_at2[X] + HANDLE_CUBIC_GAP, point_at2[Y] + HANDLE_CUBIC_GAP);
}
} else {
- pointAt1 = in->first_segment()->initialPoint();
- pointAt2 = in->first_segment()->finalPoint();
+ point_at1 = in->first_segment()->initialPoint();
+ point_at2 = in->first_segment()->finalPoint();
}
}
} else {
if (cubic) {
- if (!ignoreCusp || !Geom::are_near((*cubic)[1], pointAt0)) {
- if (isNodePointSelected(pointAt0)) {
- pointAt1 = SBasisIn.valueAt(weightValue);
- if (weightValue != noPower) {
- pointAt1 =
- Geom::Point(pointAt1[X] + handleCubicGap, pointAt1[Y] + handleCubicGap);
+ if (!ignore_cusp || !Geom::are_near((*cubic)[1], point_at0)) {
+ if (isNodePointSelected(point_at0)) {
+ point_at1 = sbasis_in.valueAt(weight_ammount);
+ if (weight_ammount != NO_POWER) {
+ point_at1 =
+ Geom::Point(point_at1[X] + HANDLE_CUBIC_GAP, point_at1[Y] + HANDLE_CUBIC_GAP);
}
} else {
- pointAt1 = (*cubic)[1];
+ point_at1 = (*cubic)[1];
}
} else {
- pointAt1 = in->first_segment()->initialPoint();
+ point_at1 = in->first_segment()->initialPoint();
}
- if (!ignoreCusp || !Geom::are_near((*cubic)[2], pointAt3)) {
- if (isNodePointSelected(pointAt3)) {
- pointAt2 = SBasisIn.valueAt(1 - weightValue);
- if (weightValue != noPower) {
- pointAt2 =
- Geom::Point(pointAt2[X] + handleCubicGap, pointAt2[Y] + handleCubicGap);
+ if (!ignore_cusp || !Geom::are_near((*cubic)[2], point_at3)) {
+ if (isNodePointSelected(point_at3)) {
+ point_at2 = sbasis_in.valueAt(1 - weight_ammount);
+ if (weight_ammount != NO_POWER) {
+ point_at2 =
+ Geom::Point(point_at2[X] + HANDLE_CUBIC_GAP, point_at2[Y] + HANDLE_CUBIC_GAP);
}
} else {
- pointAt2 = (*cubic)[2];
+ point_at2 = (*cubic)[2];
}
} else {
- pointAt2 = in->first_segment()->finalPoint();
+ point_at2 = in->first_segment()->finalPoint();
}
} else {
- if (!ignoreCusp && weightValue != noPower) {
- if (isNodePointSelected(pointAt0)) {
- pointAt1 = SBasisIn.valueAt(weightValue);
- pointAt1 =
- Geom::Point(pointAt1[X] + handleCubicGap, pointAt1[Y] + handleCubicGap);
+ if (!ignore_cusp && weight_ammount != NO_POWER) {
+ if (isNodePointSelected(point_at0)) {
+ point_at1 = sbasis_in.valueAt(weight_ammount);
+ point_at1 =
+ Geom::Point(point_at1[X] + HANDLE_CUBIC_GAP, point_at1[Y] + HANDLE_CUBIC_GAP);
} else {
- pointAt1 = in->first_segment()->initialPoint();
+ point_at1 = in->first_segment()->initialPoint();
}
- if (isNodePointSelected(pointAt3)) {
- pointAt2 = SBasisIn.valueAt(weightValue);
- pointAt2 =
- Geom::Point(pointAt2[X] + handleCubicGap, pointAt2[Y] + handleCubicGap);
+ if (isNodePointSelected(point_at3)) {
+ point_at2 = sbasis_in.valueAt(weight_ammount);
+ point_at2 =
+ Geom::Point(point_at2[X] + HANDLE_CUBIC_GAP, point_at2[Y] + HANDLE_CUBIC_GAP);
} else {
- pointAt2 = in->first_segment()->finalPoint();
+ point_at2 = in->first_segment()->finalPoint();
}
} else {
- pointAt1 = in->first_segment()->initialPoint();
- pointAt2 = in->first_segment()->finalPoint();
+ point_at1 = in->first_segment()->initialPoint();
+ point_at2 = in->first_segment()->finalPoint();
}
}
}
in->reset();
delete in;
- nCurve->curveto(pointAt1, pointAt2, pointAt3);
+ curve_n->curveto(point_at1, point_at2, point_at3);
++curve_it1;
++curve_it2;
}
if (path_it->closed()) {
- nCurve->move_endpoints(path_it->begin()->initialPoint(),
+ curve_n->move_endpoints(path_it->begin()->initialPoint(),
path_it->begin()->initialPoint());
} else {
- nCurve->move_endpoints(path_it->begin()->initialPoint(), pointAt3);
+ curve_n->move_endpoints(path_it->begin()->initialPoint(), point_at3);
}
if (path_it->closed()) {
- nCurve->closepath_current();
+ curve_n->closepath_current();
}
- curve->append(nCurve, false);
- nCurve->reset();
- delete nCurve;
+ curve->append(curve_n, false);
+ curve_n->reset();
+ delete curve_n;
}
}