diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2015-05-10 20:36:27 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2015-05-10 20:36:27 +0000 |
| commit | c7925bda67f038dd5054329c43936658ca2cae76 (patch) | |
| tree | 60fbe1aab9418446cd40ab32495747034a0b65a9 /src/live_effects/lpe-fillet-chamfer.cpp | |
| parent | Added some comments (diff) | |
| download | inkscape-c7925bda67f038dd5054329c43936658ca2cae76.tar.gz inkscape-c7925bda67f038dd5054329c43936658ca2cae76.zip | |
some comments and pointwise related refactor
(bzr r13645.1.91)
Diffstat (limited to 'src/live_effects/lpe-fillet-chamfer.cpp')
| -rw-r--r-- | src/live_effects/lpe-fillet-chamfer.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp index 16bef6a99..3e7c1d0e1 100644 --- a/src/live_effects/lpe-fillet-chamfer.cpp +++ b/src/live_effects/lpe-fillet-chamfer.cpp @@ -139,8 +139,11 @@ void LPEFilletChamfer::doOnApply(SPLPEItem const *lpeItem) global_counter++; } } - pointwise = new Pointwise(pwd2_in, satellites); + pointwise = new Pointwise(); + pointwise->setPwd2(pwd2_in); + pointwise->setSatellites(satellites); pointwise->setPathInfo(original_pathv); + pointwise->setStart(); satellites_param.setPointwise(pointwise); } else { g_warning("LPE Fillet/Chamfer can only be applied to shapes (not groups)."); @@ -278,12 +281,13 @@ void LPEFilletChamfer::updateAmount() } std::vector<Satellite> satellites = pointwise->getSatellites(); Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2 = pointwise->getPwd2(); - Pathinfo path_info(pwd2); + Pathinfo* path_info = new Pathinfo(); + path_info->set(pwd2); for (std::vector<Satellite>::iterator it = satellites.begin(); it != satellites.end(); ++it) { - if (!path_info.closed(it - satellites.begin()) && - path_info.first(it - satellites.begin()) == + if (!path_info->closed(it - satellites.begin()) && + path_info->first(it - satellites.begin()) == (unsigned)(it - satellites.begin())) { it->amount = 0; @@ -293,7 +297,7 @@ void LPEFilletChamfer::updateAmount() continue; } boost::optional<size_t> previous = - path_info.previous(it - satellites.begin()); + path_info->previous(it - satellites.begin()); if (only_selected) { Geom::Point satellite_point = pwd2.valueAt(it - satellites.begin()); if (isNodePointSelected(satellite_point)) { @@ -421,8 +425,10 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem) it->hidden = hide_knots; ++it; } - Pathinfo path_info(original_pathv); - size_t number_curves = path_info.size(); + Pathinfo* path_info = new Pathinfo(); + path_info->set(original_pathv); + size_t number_curves = path_info->size(); + //if are diferent sizes call to poinwise recalculate if (pointwise && number_curves != sats.size()) { Satellite sat(sats[0].satellite_type); sat.setIsTime(sats[0].is_time); @@ -434,9 +440,12 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem) sat.setSteps(0); pointwise->recalculateForNewPwd2(pwd2_in, original_pathv, sat); } else { - pointwise = new Pointwise(pwd2_in, sats); + pointwise = new Pointwise(); + pointwise->setPwd2(pwd2_in); + pointwise->setSatellites(sats); } pointwise->setPathInfo(original_pathv); + pointwise->setStart(); satellites_param.setPointwise(pointwise); refreshKnots(); } else { |
