summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2016-05-15 09:48:51 +0000
committerjabiertxof <info@marker.es>2016-05-15 09:48:51 +0000
commit159439c26042b7c69aa9c33ce9484e4dfd00372a (patch)
tree30d1a626d609369d1220db7f0d05cbb2a7fda970 /src
parentupdate to trunk (diff)
downloadinkscape-159439c26042b7c69aa9c33ce9484e4dfd00372a.tar.gz
inkscape-159439c26042b7c69aa9c33ce9484e4dfd00372a.zip
Fixing pointwise
(bzr r13645.1.137)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/lpe-fillet-chamfer.cpp6
-rw-r--r--src/live_effects/parameter/array.h32
-rw-r--r--src/live_effects/parameter/satellitesarray.cpp10
-rw-r--r--src/live_effects/parameter/satellitesarray.h5
-rw-r--r--src/ui/tool/multi-path-manipulator.cpp10
5 files changed, 39 insertions, 24 deletions
diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp
index f8f17fccf..9c633ea57 100644
--- a/src/live_effects/lpe-fillet-chamfer.cpp
+++ b/src/live_effects/lpe-fillet-chamfer.cpp
@@ -363,6 +363,7 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem)
satellites_param.setUseDistance(use_knot_distance);
//mandatory call
satellites_param.setEffectType(effectType());
+ satellites_param.setPathUpdate(false);
Geom::PathVector const pathv = pathv_to_linear_and_cubic_beziers(c->get_pathvector());
Satellites satellites = satellites_param.data();
@@ -402,8 +403,11 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem)
//if are diferent sizes call to poinwise recalculate
//TODO: Update the satellite data in paths modified, Goal 0.93
size_t satellites_counter = pointwise.getTotalSatellites();
+ if (satellites_counter != 0 ){
+ std::cout << number_nodes << "aaaaa" << pointwise.getTotalSatellites() << "\n";
+ }
if (satellites_counter != 0 && number_nodes != satellites_counter) {
- pointwise.setSatellites(satellites);
+ satellites_param.setPathUpdate(true);
Satellite satellite(satellites[0][0].satellite_type);
satellite.setIsTime(satellites[0][0].is_time);
satellite.setHasMirror(mirror_knots);
diff --git a/src/live_effects/parameter/array.h b/src/live_effects/parameter/array.h
index 8a9d72fe3..9802abc2e 100644
--- a/src/live_effects/parameter/array.h
+++ b/src/live_effects/parameter/array.h
@@ -89,7 +89,7 @@ protected:
size_t _default_size;
void writesvg(SVGOStringStream &str, std::vector<StorageType> const &vector) const {
- for (size_t i = 0; i < vector.size(); ++i) {
+ for (unsigned int i = 0; i < vector.size(); ++i) {
if (i != 0) {
// separate items with pipe symbol
str << " | ";
@@ -98,37 +98,37 @@ protected:
}
}
- void writesvgData(SVGOStringStream &str, float const &nVector) const {
- str << nVector;
+ void writesvgData(SVGOStringStream &str, float const &vector_data) const {
+ str << vector_data;
}
- void writesvgData(SVGOStringStream &str, double const &nVector) const {
- str << nVector;
+ void writesvgData(SVGOStringStream &str, double const &vector_data) const {
+ str << vector_data;
}
- void writesvgData(SVGOStringStream &str, Geom::Point const &nVector) const {
- str << nVector;
+ void writesvgData(SVGOStringStream &str, Geom::Point const &vector_data) const {
+ str << vector_data;
}
- void writesvgData(SVGOStringStream &str, std::vector<Satellite> const &nVector) const {
- for (size_t i = 0; i < nVector.size(); ++i) {
+ void writesvgData(SVGOStringStream &str, std::vector<Satellite> const &vector_data) const {
+ for (size_t i = 0; i < vector_data.size(); ++i) {
if (i != 0) {
// separate items with @ symbol ¿Any other?
str << " @ ";
}
- str << nVector[i].getSatelliteTypeGchar();
+ str << vector_data[i].getSatelliteTypeGchar();
str << ",";
- str << nVector[i].is_time;
+ str << vector_data[i].is_time;
str << ",";
- str << nVector[i].has_mirror;
+ str << vector_data[i].has_mirror;
str << ",";
- str << nVector[i].hidden;
+ str << vector_data[i].hidden;
str << ",";
- str << nVector[i].amount;
+ str << vector_data[i].amount;
str << ",";
- str << nVector[i].angle;
+ str << vector_data[i].angle;
str << ",";
- str << nVector[i].steps;
+ str << vector_data[i].steps;
}
}
diff --git a/src/live_effects/parameter/satellitesarray.cpp b/src/live_effects/parameter/satellitesarray.cpp
index be4eb6732..14660acc4 100644
--- a/src/live_effects/parameter/satellitesarray.cpp
+++ b/src/live_effects/parameter/satellitesarray.cpp
@@ -48,6 +48,7 @@ void SatellitesArrayParam::setPointwise(Pointwise pointwise)
{
_last_pointwise = pointwise;
param_set_and_write_new_value(_last_pointwise.getSatellites());
+
}
void SatellitesArrayParam::setUseDistance(bool use_knot_distance)
@@ -60,6 +61,11 @@ void SatellitesArrayParam::setEffectType(EffectType et)
_effectType = et;
}
+void SatellitesArrayParam::setPathUpdate(bool path_update)
+{
+ _path_update = path_update;
+}
+
void SatellitesArrayParam::setHelperSize(int hs)
{
_helper_size = hs;
@@ -67,6 +73,7 @@ void SatellitesArrayParam::setHelperSize(int hs)
}
bool SatellitesArrayParam::validData()
{
+ if (_path_update) { return false;}
return _last_pointwise.getPathVector().nodes().size() == _last_pointwise.getTotalSatellites();
}
void SatellitesArrayParam::updateCanvasIndicators(bool mirror)
@@ -323,6 +330,7 @@ void FilletChamferKnotHolderEntity::knot_set(Geom::Point const &p,
Geom::Point FilletChamferKnotHolderEntity::knot_get() const
{
if (! _pparam->validData() || !valid_index(_index)) {
+ this->knot->hide();
return Geom::Point(Geom::infinity(), Geom::infinity());
}
Geom::Point tmp_point;
@@ -336,10 +344,12 @@ Geom::Point FilletChamferKnotHolderEntity::knot_get() const
!pathv[_index].closed() && subindex == 0 ||//ignore first satellites on open paths
pathv[_index].size() == subindex) //ignore last satellite in open paths with fillet chamfer effect
{
+ this->knot->hide();
_pparam->_vector[_index][subindex].hidden = true;
return Geom::Point(Geom::infinity(), Geom::infinity());
}
this->knot->show();
+ std::cout << subindex << pathv[_index].size() << "----" << _pparam->_vector[_index].size() << "fgdgsdgsdgsdsdsgd\n";
if (subindex != _subindex) {
tmp_point = satellite.getPosition(pathv[_index][subindex]);
size_t previous_index = subindex - 1;
diff --git a/src/live_effects/parameter/satellitesarray.h b/src/live_effects/parameter/satellitesarray.h
index dcd82ada5..0cebb9cb4 100644
--- a/src/live_effects/parameter/satellitesarray.h
+++ b/src/live_effects/parameter/satellitesarray.h
@@ -55,6 +55,7 @@ public:
}
void param_transform_multiply(Geom::Affine const &postmul, bool /*set*/);
void setUseDistance(bool use_knot_distance);
+ void setPathUpdate(bool path_update);
void setEffectType(EffectType et);
void setPointwise(Pointwise pointwise);
bool validData();
@@ -76,6 +77,7 @@ private:
Geom::PathVector _hp;
int _helper_size;
bool _use_distance;
+ bool _path_update;
EffectType _effectType;
Pointwise _last_pointwise;
@@ -99,8 +101,7 @@ public:
bool valid_index(size_t index) const
{
return (_pparam->_vector.size() > index);
- }
- ;
+ };
private:
SatellitesArrayParam *_pparam;
diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp
index 857f954ce..9ec6f733f 100644
--- a/src/ui/tool/multi-path-manipulator.cpp
+++ b/src/ui/tool/multi-path-manipulator.cpp
@@ -330,13 +330,13 @@ void MultiPathManipulator::insertNodes()
{
if (_selection.empty()) return;
invokeForAll(&PathManipulator::insertNodes);
- _done(_("Add nodes"), true);
+ _done(_("Add nodes"));
}
void MultiPathManipulator::insertNodesAtExtrema(ExtremumType extremum)
{
if (_selection.empty()) return;
invokeForAll(&PathManipulator::insertNodeAtExtremum, extremum);
- _done(_("Add extremum nodes"), true);
+ _done(_("Add extremum nodes"));
}
void MultiPathManipulator::insertNode(Geom::Point pt)
@@ -351,7 +351,7 @@ void MultiPathManipulator::duplicateNodes()
{
if (_selection.empty()) return;
invokeForAll(&PathManipulator::duplicateNodes);
- _done(_("Duplicate nodes"), true);
+ _done(_("Duplicate nodes"));
}
void MultiPathManipulator::joinNodes()
@@ -491,10 +491,10 @@ void MultiPathManipulator::reverseSubpaths()
{
if (_selection.empty()) {
invokeForAll(&PathManipulator::reverseSubpaths, false);
- _done("Reverse subpaths", true);
+ _done("Reverse subpaths");
} else {
invokeForAll(&PathManipulator::reverseSubpaths, true);
- _done("Reverse selected subpaths", true);
+ _done("Reverse selected subpaths");
}
}