diff options
author | bubnikv <bubnikv@gmail.com> | 2019-09-27 19:17:21 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2019-09-27 19:17:21 +0300 |
commit | 331c187b39e9a800eb826267eae09994ca17278d (patch) | |
tree | a9742d6b136a98f399eab024468314e186fae4b7 /xs | |
parent | 4b35ebe6e5adfb05621e712eabc46e0e426b7bc6 (diff) |
Rest of the path chaining has been replaced with the new algorithm.
PolylineCollection.cpp/hpp was removed, use Polylines instead.
Various first_point() / last_point() now return references, not copies.
Diffstat (limited to 'xs')
-rw-r--r-- | xs/xsp/ExtrusionEntityCollection.xsp | 8 | ||||
-rw-r--r-- | xs/xsp/Filler.xsp | 1 | ||||
-rw-r--r-- | xs/xsp/Layer.xsp | 2 | ||||
-rw-r--r-- | xs/xsp/PolylineCollection.xsp | 11 |
4 files changed, 13 insertions, 9 deletions
diff --git a/xs/xsp/ExtrusionEntityCollection.xsp b/xs/xsp/ExtrusionEntityCollection.xsp index 1f16ae3d4..a01788c56 100644 --- a/xs/xsp/ExtrusionEntityCollection.xsp +++ b/xs/xsp/ExtrusionEntityCollection.xsp @@ -14,13 +14,17 @@ void clear(); ExtrusionEntityCollection* chained_path(bool no_reverse, ExtrusionRole role = erMixed) %code{% + if (no_reverse) + croak("no_reverse must be false"); RETVAL = new ExtrusionEntityCollection(); - THIS->chained_path(RETVAL, no_reverse, role); + *RETVAL = THIS->chained_path_from(THIS->entities.front()->first_point()); %}; ExtrusionEntityCollection* chained_path_from(Point* start_near, bool no_reverse, ExtrusionRole role = erMixed) %code{% + if (no_reverse) + croak("no_reverse must be false"); RETVAL = new ExtrusionEntityCollection(); - THIS->chained_path_from(*start_near, RETVAL, no_reverse, role); + *RETVAL = THIS->chained_path_from(*start_near, role); %}; Clone<Point> first_point(); Clone<Point> last_point(); diff --git a/xs/xsp/Filler.xsp b/xs/xsp/Filler.xsp index 34a6d33be..647d851eb 100644 --- a/xs/xsp/Filler.xsp +++ b/xs/xsp/Filler.xsp @@ -3,7 +3,6 @@ %{ #include <xsinit.h> #include "libslic3r/Fill/Fill.hpp" -#include "libslic3r/PolylineCollection.hpp" #include "libslic3r/ExtrusionEntity.hpp" #include "libslic3r/ExtrusionEntityCollection.hpp" %} diff --git a/xs/xsp/Layer.xsp b/xs/xsp/Layer.xsp index efd6c9ae6..fc94d5115 100644 --- a/xs/xsp/Layer.xsp +++ b/xs/xsp/Layer.xsp @@ -19,8 +19,6 @@ %code%{ RETVAL = &THIS->fill_surfaces; %}; Polygons bridged() %code%{ RETVAL = THIS->bridged; %}; - Ref<PolylineCollection> unsupported_bridge_edges() - %code%{ RETVAL = &THIS->unsupported_bridge_edges; %}; Ref<ExtrusionEntityCollection> perimeters() %code%{ RETVAL = &THIS->perimeters; %}; Ref<ExtrusionEntityCollection> fills() diff --git a/xs/xsp/PolylineCollection.xsp b/xs/xsp/PolylineCollection.xsp index 7237be5bb..d8bb41b49 100644 --- a/xs/xsp/PolylineCollection.xsp +++ b/xs/xsp/PolylineCollection.xsp @@ -2,7 +2,11 @@ %{ #include <xsinit.h> -#include "libslic3r/PolylineCollection.hpp" + +#include "libslic3r.h" +#include "Polyline.hpp" +#include "ShortestPath.hpp" + %} %name{Slic3r::Polyline::Collection} class PolylineCollection { @@ -14,16 +18,15 @@ PolylineCollection* chained_path(bool no_reverse) %code{% RETVAL = new PolylineCollection(); - THIS->chained_path(RETVAL, no_reverse); + RETVAL->polylines = chain_polylines(THIS->polylines, &THIS->polylines.front().first_point()); %}; PolylineCollection* chained_path_from(Point* start_near, bool no_reverse) %code{% RETVAL = new PolylineCollection(); - THIS->chained_path_from(*start_near, RETVAL, no_reverse); + RETVAL->polylines = chain_polylines(THIS->polylines, start_near); %}; int count() %code{% RETVAL = THIS->polylines.size(); %}; - Clone<Point> leftmost_point(); %{ PolylineCollection* |