Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2018-09-19 12:02:24 +0300
committerbubnikv <bubnikv@gmail.com>2018-09-19 12:02:24 +0300
commit0558b53493a77bae44831cf87bb0f59359828ef5 (patch)
treec3e8dbdf7d91a051c12d9ebbf7606d41047fea96 /src/libslic3r/PolylineCollection.hpp
parent3ddaccb6410478ad02d8c0e02d6d8e6eb1785b9f (diff)
WIP: Moved sources int src/, separated most of the source code from Perl.
The XS was left only for the unit / integration tests, and it links libslic3r only. No wxWidgets are allowed to be used from Perl starting from now.
Diffstat (limited to 'src/libslic3r/PolylineCollection.hpp')
-rw-r--r--src/libslic3r/PolylineCollection.hpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/libslic3r/PolylineCollection.hpp b/src/libslic3r/PolylineCollection.hpp
new file mode 100644
index 000000000..87fc1985b
--- /dev/null
+++ b/src/libslic3r/PolylineCollection.hpp
@@ -0,0 +1,47 @@
+#ifndef slic3r_PolylineCollection_hpp_
+#define slic3r_PolylineCollection_hpp_
+
+#include "libslic3r.h"
+#include "Polyline.hpp"
+
+namespace Slic3r {
+
+class PolylineCollection
+{
+ static Polylines _chained_path_from(
+ const Polylines &src,
+ Point start_near,
+ bool no_reverse,
+ bool move_from_src);
+
+public:
+ Polylines polylines;
+ void chained_path(PolylineCollection* retval, bool no_reverse = false) const
+ { retval->polylines = chained_path(this->polylines, no_reverse); }
+ void chained_path_from(Point start_near, PolylineCollection* retval, bool no_reverse = false) const
+ { retval->polylines = chained_path_from(this->polylines, start_near, no_reverse); }
+ Point leftmost_point() const
+ { return leftmost_point(polylines); }
+ void append(const Polylines &polylines)
+ { this->polylines.insert(this->polylines.end(), polylines.begin(), polylines.end()); }
+
+ static Point leftmost_point(const Polylines &polylines);
+ static Polylines chained_path(Polylines &&src, bool no_reverse = false) {
+ return (src.empty() || src.front().points.empty()) ?
+ Polylines() :
+ _chained_path_from(src, src.front().first_point(), no_reverse, true);
+ }
+ static Polylines chained_path_from(Polylines &&src, Point start_near, bool no_reverse = false)
+ { return _chained_path_from(src, start_near, no_reverse, true); }
+ static Polylines chained_path(const Polylines &src, bool no_reverse = false) {
+ return (src.empty() || src.front().points.empty()) ?
+ Polylines() :
+ _chained_path_from(src, src.front().first_point(), no_reverse, false);
+ }
+ static Polylines chained_path_from(const Polylines &src, Point start_near, bool no_reverse = false)
+ { return _chained_path_from(src, start_near, no_reverse, false); }
+};
+
+}
+
+#endif