From ceb72da6328c1748897997a7f4701ac43ae12d52 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Wed, 30 Nov 2016 19:47:45 +0100 Subject: [PATCH] Implement clone() for Fill classes --- xs/MANIFEST | 1 + xs/src/libslic3r/Fill/Fill3DHoneycomb.hpp | 1 + xs/src/libslic3r/Fill/FillConcentric.hpp | 1 + xs/src/libslic3r/Fill/FillHoneycomb.hpp | 1 + xs/src/libslic3r/Fill/FillPlanePath.hpp | 3 +++ xs/src/libslic3r/Fill/FillRectilinear.hpp | 1 + xs/src/libslic3r/Fill/FillRectilinear2.hpp | 5 +++++ 7 files changed, 13 insertions(+) diff --git a/xs/MANIFEST b/xs/MANIFEST index 03e52ae50..2be8934c7 100644 --- a/xs/MANIFEST +++ b/xs/MANIFEST @@ -67,6 +67,7 @@ src/libslic3r/Geometry.hpp src/libslic3r/Layer.cpp src/libslic3r/Layer.hpp src/libslic3r/LayerRegion.cpp +src/libslic3r/LayerRegionFill.cpp src/libslic3r/libslic3r.h src/libslic3r/Line.cpp src/libslic3r/Line.hpp diff --git a/xs/src/libslic3r/Fill/Fill3DHoneycomb.hpp b/xs/src/libslic3r/Fill/Fill3DHoneycomb.hpp index fae5b3c60..52b792251 100644 --- a/xs/src/libslic3r/Fill/Fill3DHoneycomb.hpp +++ b/xs/src/libslic3r/Fill/Fill3DHoneycomb.hpp @@ -12,6 +12,7 @@ namespace Slic3r { class Fill3DHoneycomb : public Fill { public: + virtual Fill* clone() const { return new Fill3DHoneycomb(*this); }; virtual ~Fill3DHoneycomb() {} // require bridge flow since most of this pattern hangs in air diff --git a/xs/src/libslic3r/Fill/FillConcentric.hpp b/xs/src/libslic3r/Fill/FillConcentric.hpp index 91f14908a..1286858ea 100644 --- a/xs/src/libslic3r/Fill/FillConcentric.hpp +++ b/xs/src/libslic3r/Fill/FillConcentric.hpp @@ -11,6 +11,7 @@ public: virtual ~FillConcentric() {} protected: + virtual Fill* clone() const { return new FillConcentric(*this); }; virtual void _fill_surface_single( const FillParams ¶ms, unsigned int thickness_layers, diff --git a/xs/src/libslic3r/Fill/FillHoneycomb.hpp b/xs/src/libslic3r/Fill/FillHoneycomb.hpp index b4a987115..4717602d4 100644 --- a/xs/src/libslic3r/Fill/FillHoneycomb.hpp +++ b/xs/src/libslic3r/Fill/FillHoneycomb.hpp @@ -15,6 +15,7 @@ public: virtual ~FillHoneycomb() {} protected: + virtual Fill* clone() const { return new FillHoneycomb(*this); }; virtual void _fill_surface_single( const FillParams ¶ms, unsigned int thickness_layers, diff --git a/xs/src/libslic3r/Fill/FillPlanePath.hpp b/xs/src/libslic3r/Fill/FillPlanePath.hpp index 6e9f45616..49fb2b387 100644 --- a/xs/src/libslic3r/Fill/FillPlanePath.hpp +++ b/xs/src/libslic3r/Fill/FillPlanePath.hpp @@ -34,6 +34,7 @@ protected: class FillArchimedeanChords : public FillPlanePath { public: + virtual Fill* clone() const { return new FillArchimedeanChords(*this); }; virtual ~FillArchimedeanChords() {} protected: @@ -44,6 +45,7 @@ protected: class FillHilbertCurve : public FillPlanePath { public: + virtual Fill* clone() const { return new FillHilbertCurve(*this); }; virtual ~FillHilbertCurve() {} protected: @@ -54,6 +56,7 @@ protected: class FillOctagramSpiral : public FillPlanePath { public: + virtual Fill* clone() const { return new FillOctagramSpiral(*this); }; virtual ~FillOctagramSpiral() {} protected: diff --git a/xs/src/libslic3r/Fill/FillRectilinear.hpp b/xs/src/libslic3r/Fill/FillRectilinear.hpp index 2971a90a3..1be85f755 100644 --- a/xs/src/libslic3r/Fill/FillRectilinear.hpp +++ b/xs/src/libslic3r/Fill/FillRectilinear.hpp @@ -12,6 +12,7 @@ class Surface; class FillRectilinear : public Fill { public: + virtual Fill* clone() const { return new FillRectilinear(*this); }; virtual ~FillRectilinear() {} protected: diff --git a/xs/src/libslic3r/Fill/FillRectilinear2.hpp b/xs/src/libslic3r/Fill/FillRectilinear2.hpp index b8e56f90c..4459919b0 100644 --- a/xs/src/libslic3r/Fill/FillRectilinear2.hpp +++ b/xs/src/libslic3r/Fill/FillRectilinear2.hpp @@ -12,6 +12,7 @@ class Surface; class FillRectilinear2 : public Fill { public: + virtual Fill* clone() const { return new FillRectilinear2(*this); }; virtual ~FillRectilinear2() {} virtual Polylines fill_surface(const Surface *surface, const FillParams ¶ms); @@ -22,6 +23,7 @@ protected: class FillGrid2 : public FillRectilinear2 { public: + virtual Fill* clone() const { return new FillGrid2(*this); }; virtual ~FillGrid2() {} virtual Polylines fill_surface(const Surface *surface, const FillParams ¶ms); @@ -33,6 +35,7 @@ protected: class FillTriangles : public FillRectilinear2 { public: + virtual Fill* clone() const { return new FillTriangles(*this); }; virtual ~FillTriangles() {} virtual Polylines fill_surface(const Surface *surface, const FillParams ¶ms); @@ -44,6 +47,7 @@ protected: class FillStars : public FillRectilinear2 { public: + virtual Fill* clone() const { return new FillStars(*this); }; virtual ~FillStars() {} virtual Polylines fill_surface(const Surface *surface, const FillParams ¶ms); @@ -55,6 +59,7 @@ protected: class FillCubic : public FillRectilinear2 { public: + virtual Fill* clone() const { return new FillCubic(*this); }; virtual ~FillCubic() {} virtual Polylines fill_surface(const Surface *surface, const FillParams ¶ms);