summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-03-19 23:14:47 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-03-19 23:14:47 +0000
commitf3e7b51b1d2497cda7a66e13f4f50da145ece19c (patch)
tree21b2586ac55dca8bee4ca0bc6ed4cef050ae51fc /src
parentupdate to trunk (diff)
downloadinkscape-f3e7b51b1d2497cda7a66e13f4f50da145ece19c.tar.gz
inkscape-f3e7b51b1d2497cda7a66e13f4f50da145ece19c.zip
Added delete nodes/satellites
(bzr r13645.1.45)
Diffstat (limited to 'src')
-rw-r--r--src/2geom/pointwise.cpp34
-rw-r--r--src/2geom/pointwise.h2
-rw-r--r--src/live_effects/lpe-fillet-chamfer.cpp7
-rw-r--r--src/live_effects/parameter/array.h2
-rw-r--r--src/ui/dialog/lpe-fillet-chamfer-properties.cpp3
5 files changed, 22 insertions, 26 deletions
diff --git a/src/2geom/pointwise.cpp b/src/2geom/pointwise.cpp
index 584e78523..8f7a0b402 100644
--- a/src/2geom/pointwise.cpp
+++ b/src/2geom/pointwise.cpp
@@ -37,7 +37,7 @@
namespace Geom {
Pointwise::Pointwise(Piecewise<D2<SBasis> > pwd2)
- : _pwd2(pwd2),_pathInfo(NULL), _satellites(NULL)
+ : _pwd2(pwd2)
{
setPathInfo();
};
@@ -273,36 +273,40 @@ Pointwise::new_pwd_sustract(Piecewise<D2<SBasis> > A)
sats.push_back(std::make_pair(_satellites[i].first-counter,_satellites[i].second));
}
}
+ set_extremes(sats,false,true,0.0,0.0);
setSatellites(sats);
}
void
-Pointwise::set_extremes(bool active, bool hidden, double amount, double angle)
+Pointwise::set_extremes(std::vector<std::pair<unsigned int,Satellite> > sats, bool active, bool hidden, double amount, double angle)
{
for(unsigned int i = 0; i < _pathInfo.size(); i++){
unsigned int firstNode = getFirst(_pathInfo[i].first);
unsigned int lastNode = getLast(_pathInfo[i].first);
- std::cout << firstNode << "FIRSTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT\n";
- std::cout << lastNode << "LASTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT\n";
if(!getIsClosed(lastNode)){
- std::cout << "CLOSSEDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD\n";
bool endOpen = false;
- for(unsigned i = 0; i < _satellites.size(); i++){
- _satellites[i].second.setIsEndOpen(false);
- if(_satellites[i].first == firstNode || _satellites[i].first == lastNode){
- _satellites[i].second.setActive(active);
- _satellites[i].second.setHidden(hidden);
- if(_satellites[i].first == lastNode){
+ for(unsigned i = 0; i < sats.size(); i++){
+ sats[i].second.setIsEndOpen(false);
+ if(sats[i].first > lastNode){
+ break;
+ }
+ if(sats[i].first == firstNode || sats[i].first == lastNode){
+ sats[i].second.setActive(active);
+ sats[i].second.setHidden(hidden);
+ if(sats[i].first == lastNode){
if(!endOpen){
endOpen = true;
} else {
endOpen = false;
- std::cout << "ENNNNNNNNNNNDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDOPEN\n";
- _satellites[i].second.setIsEndOpen(true);
- _satellites[i].second.setAmount(amount);
- _satellites[i].second.setAngle(angle);
+ sats[i].second.setIsEndOpen(true);
+ sats[i].second.setAmount(amount);
+ sats[i].second.setAngle(angle);
}
}
+ if(sats[i].first == firstNode){
+ sats[i].second.setAmount(amount);
+ sats[i].second.setAngle(angle);
+ }
}
}
}
diff --git a/src/2geom/pointwise.h b/src/2geom/pointwise.h
index eb3400877..e313722a1 100644
--- a/src/2geom/pointwise.h
+++ b/src/2geom/pointwise.h
@@ -76,7 +76,7 @@ class Pointwise
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 set_extremes(bool active, bool hidden, double amount, double angle);
+ void set_extremes(std::vector<std::pair<unsigned int,Satellite> > sats, bool active, bool hidden, double amount, double angle);
void setPathInfo();
void setPathInfo(Piecewise<D2<SBasis> >);
unsigned int getSubPathIndex(unsigned int index) const;
diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp
index 0a5d3a224..38645a943 100644
--- a/src/live_effects/lpe-fillet-chamfer.cpp
+++ b/src/live_effects/lpe-fillet-chamfer.cpp
@@ -119,7 +119,7 @@ void LPEFilletChamfer::doOnApply(SPLPEItem const *lpeItem)
Geom::Path::const_iterator curve_end = curve_endit;
--curve_end;
int counter = 0;
- unsigned int steps = 0;
+ unsigned int steps = chamfer_steps;
while (curve_it1 != curve_endit) {
if((*curve_it1).isDegenerate() || (*curve_it1).isDegenerate()){
g_warning("LPE Fillet not handle degenerate curves.");
@@ -354,7 +354,6 @@ void LPEFilletChamfer::updateSatelliteType(Geom::SatelliteType satellitetype)
void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem)
{
- std::cout << "dobeforestart\n";
SPLPEItem * splpeitem = const_cast<SPLPEItem *>(lpeItem);
SPShape * shape = dynamic_cast<SPShape *>(splpeitem);
if (shape) {
@@ -422,7 +421,6 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem)
} else {
g_warning("LPE Fillet can only be applied to shapes (not groups).");
}
- std::cout << "dobeforeend\n";
}
void
@@ -430,7 +428,6 @@ LPEFilletChamfer::adjustForNewPath(std::vector<Geom::Path> const &path_in)
{
if (!path_in.empty() && pointwise) {
pointwise->recalculate_for_new_pwd2(paths_to_pw(pathv_to_linear_and_cubic_beziers(path_in)));
- pointwise->set_extremes(false,true,0.0,0.0);
satellitepairarrayparam_values.set_pointwise(pointwise);
}
}
@@ -438,7 +435,6 @@ LPEFilletChamfer::adjustForNewPath(std::vector<Geom::Path> const &path_in)
std::vector<Geom::Path>
LPEFilletChamfer::doEffect_path(std::vector<Geom::Path> const &path_in)
{
- std::cout << "doEffect_pathstart\n";
const double gapHelper = 0.00001;
std::vector<Geom::Path> pathvector_out;
unsigned int counter = 0;
@@ -677,7 +673,6 @@ LPEFilletChamfer::doEffect_path(std::vector<Geom::Path> const &path_in)
}
pathvector_out.push_back(path_out);
}
- std::cout << "doEffect_pathendt\n";
return pathvector_out;
}
diff --git a/src/live_effects/parameter/array.h b/src/live_effects/parameter/array.h
index 5443cc3c4..7ff477ffb 100644
--- a/src/live_effects/parameter/array.h
+++ b/src/live_effects/parameter/array.h
@@ -17,7 +17,6 @@
#include <2geom/satellite.h>
#include <2geom/satellite-enum.h>
-#include <2geom/pointwise.h>
#include "svg/svg.h"
#include "svg/stringstream.h"
@@ -132,7 +131,6 @@ protected:
str << nVector.second.getAngle();
str << "*";
str << nVector.second.getSteps();
- std::cout << str.str() << "SATEEELIITE\n";
}
StorageType readsvg(const gchar * str);
diff --git a/src/ui/dialog/lpe-fillet-chamfer-properties.cpp b/src/ui/dialog/lpe-fillet-chamfer-properties.cpp
index c6959b718..aa27a1414 100644
--- a/src/ui/dialog/lpe-fillet-chamfer-properties.cpp
+++ b/src/ui/dialog/lpe-fillet-chamfer-properties.cpp
@@ -233,16 +233,15 @@ void FilletChamferPropertiesDialog::_set_satellite(Geom::Satellite satellite)
position = Inkscape::Util::Quantity::convert(position, document_unit, unit);
}
_fillet_chamfer_position_numeric.set_value(position);
+ _fillet_chamfer_chamfer_subdivisions.set_value(satellite.getSteps());
if (satellite.getSatelliteType() == Geom::F) {
_fillet_chamfer_type_fillet.set_active(true);
} else if (satellite.getSatelliteType() == Geom::IF) {
_fillet_chamfer_type_inverse_fillet.set_active(true);
} else if (satellite.getSatelliteType() == Geom::C) {
_fillet_chamfer_type_chamfer.set_active(true);
- _fillet_chamfer_chamfer_subdivisions.set_value(satellite.getSteps());
} else if (satellite.getSatelliteType() == Geom::IC) {
_fillet_chamfer_type_inverse_chamfer.set_active(true);
- _fillet_chamfer_chamfer_subdivisions.set_value(satellite.getSteps());
}
_satellite = satellite;
}