From f77b5496f69a5391bc548be95c85659539a92fe9 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sun, 1 Mar 2015 23:23:56 +0100 Subject: added mirror knots (bzr r13645.1.26) --- src/2geom/pointwise.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src/2geom/pointwise.cpp') diff --git a/src/2geom/pointwise.cpp b/src/2geom/pointwise.cpp index bc468343c..3c359eddc 100644 --- a/src/2geom/pointwise.cpp +++ b/src/2geom/pointwise.cpp @@ -123,6 +123,41 @@ Pointwise::findSatellites(int A, int B) const return ret; } +std::vector +Pointwise::findClosingSatellites(int A, int B) const +{ + std::vector ret; + bool finded = false; + for(unsigned i = 0; i < _satellites.size(); i++){ + if(finded && _satellites[i].second.getIsStart()){ + return ret; + } + if(finded && _satellites[i].second.getIsClosing()){ + ret.push_back(_satellites[i].second); + } + if(_satellites[i].first == A){ + finded = true; + } + } + return ret; +} + +std::vector +Pointwise::findPeviousSatellites(int A, int B) const +{ + std::vector ret; + for(unsigned i = 0; i < _satellites.size(); i++){ + if(_satellites[i].first == A){ + if(!_satellites[i].second.getIsStart()){ + ret = findSatellites(_satellites[i-1].first, B); + } else { + ret = findClosingSatellites(_satellites[i].first, B); + } + } + } + return ret; +} + } /* Local Variables: -- cgit v1.2.3