summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-03-26 23:01:44 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-03-26 23:01:44 +0000
commitedc48d93d2b528c20b9adb0f7d074c73c46f03eb (patch)
treef97fd9fb2682f2d844a54ebc84d796ffb7dc25f2 /src
parentupdate to trunk (diff)
downloadinkscape-edc48d93d2b528c20b9adb0f7d074c73c46f03eb.tar.gz
inkscape-edc48d93d2b528c20b9adb0f7d074c73c46f03eb.zip
adding append mode
(bzr r13645.1.54)
Diffstat (limited to 'src')
-rw-r--r--src/2geom/pointwise.cpp31
-rw-r--r--src/2geom/pointwise.h4
-rw-r--r--src/live_effects/lpe-fillet-chamfer.cpp4
-rw-r--r--src/ui/tool/path-manipulator.cpp1
4 files changed, 22 insertions, 18 deletions
diff --git a/src/2geom/pointwise.cpp b/src/2geom/pointwise.cpp
index 9669c20b8..b97f8749f 100644
--- a/src/2geom/pointwise.cpp
+++ b/src/2geom/pointwise.cpp
@@ -183,45 +183,48 @@ void
Pointwise::recalculate_for_new_pwd2(Piecewise<D2<SBasis> > A)
{
if( _pwd2.size() > A.size()){
- new_pwd_sustract(A);
+ std::cout << "bbbbbbbbbbbbbbbbbbbbbbbbb\n";
+ pwd2_sustract(A);
} else if ( _pwd2.size() < A.size()){
- new_pwd_append(A);
+ pwd2_append(A);
+ std::cout << "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n";
}
+ std::cout << "cccccccccccccccccccccccccccccccccc\n";
}
void
-Pointwise::new_pwd_append(Piecewise<D2<SBasis> > A)
+Pointwise::pwd2_append(Piecewise<D2<SBasis> > A)
{
size_t counter = 0;
std::vector<std::pair<size_t,Satellite> > sats;
- for(size_t i = 0; i < _satellites.size(); i++){
- if(_satellites[i].second.getIsEndOpen()){
- _satellites.erase(_satellites.begin() + i);
- }
- }
+ Piecewise<D2<SBasis> > pwd2 = _pwd2;
+ setPwd2(A);
+ std::cout << A.size() << "ASIZE\n";
+ std::cout << pwd2.size() << "PWD2SIZE\n";
for(size_t i = 0; i < A.size(); i++){
- if(!are_near(_pwd2[i-counter].at0(),A[i].at0(),0.001)){
+ std::cout << i << "indes\n";
+ std::cout << counter << "counter\n";
+ if(pwd2.size() <= i-counter || !are_near(pwd2[i-counter].at0(),A[i].at0(),0.001)){
counter++;
bool isEndOpen = false;
bool active = true;
bool hidden = false;
- bool isTime = sats[0].second.getIsTime();
- bool mirror_knots = sats[0].second.getHasMirror();
+ bool isTime = _satellites[0].second.getIsTime();
+ bool mirror_knots = _satellites[0].second.getHasMirror();
double amount = 0.0;
double degrees = 0.0;
int steps = 0;
- Satellite sat(sats[0].second.getSatelliteType(), isTime, isEndOpen, active, mirror_knots, hidden, amount, degrees, steps);
+ Satellite sat(_satellites[0].second.getSatelliteType(), isTime, isEndOpen, active, mirror_knots, hidden, amount, degrees, steps);
sats.push_back(std::make_pair(i,sat));
} else {
sats.push_back(std::make_pair(i,_satellites[i-counter].second));
}
}
- setPwd2(A);
setSatellites(sats);
}
void
-Pointwise::new_pwd_sustract(Piecewise<D2<SBasis> > A)
+Pointwise::pwd2_sustract(Piecewise<D2<SBasis> > A)
{
size_t counter = 0;
std::vector<std::pair<size_t,Satellite> > sats;
diff --git a/src/2geom/pointwise.h b/src/2geom/pointwise.h
index a7cbcfec4..296eb6ca6 100644
--- a/src/2geom/pointwise.h
+++ b/src/2geom/pointwise.h
@@ -74,8 +74,8 @@ class Pointwise
Piecewise<D2<SBasis> > getPwd2() const;
void setPwd2(Piecewise<D2<SBasis> > pwd2_in);
void recalculate_for_new_pwd2(Piecewise<D2<SBasis> > A);
- void new_pwd_append(Piecewise<D2<SBasis> > A);
- void new_pwd_sustract(Piecewise<D2<SBasis> > A);
+ void pwd2_append(Piecewise<D2<SBasis> > A);
+ void pwd2_sustract(Piecewise<D2<SBasis> > A);
void set_extremes(bool endOpenSat, bool active, bool hidden, double amount = -1, double angle = -1);
void reverse(size_t start,size_t end);
void setPathInfo();
diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp
index 6b388b0f6..55e1f93aa 100644
--- a/src/live_effects/lpe-fillet-chamfer.cpp
+++ b/src/live_effects/lpe-fillet-chamfer.cpp
@@ -421,8 +421,10 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem)
void
LPEFilletChamfer::adjustForNewPath(std::vector<Geom::Path> const &path_in)
{
+ std::cout << "1111111111111111111111111111111111111111\n";
if (!path_in.empty() && pointwise) {
- pointwise->recalculate_for_new_pwd2(remove_short_cuts(paths_to_pw(pathv_to_linear_and_cubic_beziers(path_in)),0.01));
+ std::cout << "222222222222222222222222222222222222222222222\n";
+ pointwise->recalculate_for_new_pwd2(pathv_to_linear_and_cubic_beziers(path_in)[0].toPwSb());
pointwise->set_extremes(true, false, true, 0.0, 0.0);
satellitepairarrayparam_values.set_pointwise(pointwise);
}
diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp
index d2bdd9384..ccf75dcde 100644
--- a/src/ui/tool/path-manipulator.cpp
+++ b/src/ui/tool/path-manipulator.cpp
@@ -34,7 +34,6 @@
#include "live_effects/lpeobject.h"
#include "live_effects/lpeobject-reference.h"
#include "live_effects/parameter/path.h"
-
#include "sp-path.h"
#include "helper/geom.h"
#include "preferences.h"