summaryrefslogtreecommitdiffstats
path: root/src/helper/geom-pointwise.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-08-23 21:03:12 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-08-23 21:03:12 +0000
commit4f78e3e4289b52ba4b7a3fbe24fd0d6fcb6f2250 (patch)
tree80a9350590d7ef0ccbde1f1826a9c9f905e12772 /src/helper/geom-pointwise.cpp
parentremove couts (diff)
downloadinkscape-4f78e3e4289b52ba4b7a3fbe24fd0d6fcb6f2250.tar.gz
inkscape-4f78e3e4289b52ba4b7a3fbe24fd0d6fcb6f2250.zip
satellites in curves
(bzr r13645.1.110)
Diffstat (limited to 'src/helper/geom-pointwise.cpp')
-rw-r--r--src/helper/geom-pointwise.cpp61
1 files changed, 5 insertions, 56 deletions
diff --git a/src/helper/geom-pointwise.cpp b/src/helper/geom-pointwise.cpp
index 8a0db6258..8ae2125a4 100644
--- a/src/helper/geom-pointwise.cpp
+++ b/src/helper/geom-pointwise.cpp
@@ -23,76 +23,25 @@ pwd2sb Pointwise::getPwd2() const
void Pointwise::setPwd2(pwd2sb const &pwd2_in)
{
+ _pathvector = path_from_piecewise(Geom::remove_short_cuts(_pwd2,0.01),0.01);
_pwd2 = pwd2_in;
}
-std::vector<Satellite> Pointwise::getSatellites(bool curve_based)
+std::vector<Satellite> Pointwise::getSatellites(e)
{
- if(curve_based){
- size_t global_counter = 0;
- size_t satellite_gap = 0;
- Geom::PathVector pathvector = path_from_piecewise(Geom::remove_short_cuts(_pwd2,0.01),0.01);
- for (Geom::PathVector::const_iterator path_it = pathvector.begin();
- path_it != pathvector.end(); ++path_it) {
- if (path_it->empty()) {
- continue;
- }
- size_t counter = 0;
- for (Geom::Path::const_iterator curve_it = path_it->begin();
- curve_it != path_it->end_closed(); ++curve_it) {
- if(!path_it->closed()){
- if(path_it->size_closed()-1 == counter){
- _satellites.erase(_satellites.begin() + (global_counter - 1 - satellite_gap));
- satellite_gap++;
- }
- }
- counter++;
- global_counter++;
- }
- }
- }
return _satellites;
}
-void Pointwise::setSatellites(std::vector<Satellite> const &sats, bool curve_based)
+void Pointwise::setSatellites(std::vector<Satellite> const &sats)
{
_satellites = sats;
- if(curve_based){
- size_t global_counter = 0;
- Geom::PathVector pathvector = path_from_piecewise(Geom::remove_short_cuts(_pwd2,0.01),0.01);
- for (Geom::PathVector::const_iterator path_it = pathvector.begin();
- path_it != pathvector.end(); ++path_it) {
- if (path_it->empty()) {
- continue;
- }
- size_t counter = 0;
- size_t start = global_counter;
- for (Geom::Path::const_iterator curve_it = path_it->begin();
- curve_it != path_it->end_closed(); ++curve_it) {
- if(!path_it->closed()){
- if(path_it->size_closed()-1 == counter){
- if(global_counter == _satellites.size()){
- _satellites.push_back(_satellites[start]);
- } else {
- _satellites.insert(_satellites.begin() + global_counter + 1,_satellites[start]);
- }
- }
- }
- counter++;
- global_counter++;
- }
- }
- }
}
-
-
void Pointwise::setStart()
{
- Geom::PathVector pointwise_pv = path_from_piecewise(Geom::remove_short_cuts(_pwd2,0.01),0.01);
int counter = 0;
- for (Geom::PathVector::const_iterator path_it = pointwise_pv.begin();
- path_it != pointwise_pv.end(); ++path_it) {
+ for (Geom::PathVector::const_iterator path_it = _pathvector.begin();
+ path_it != _pathvector.end(); ++path_it) {
if (path_it->empty()) {
continue;
}