diff --git a/src/libslic3r/SLA/SLAConcurrency.hpp b/src/libslic3r/SLA/SLAConcurrency.hpp index cd45ce83e..4beb2aead 100644 --- a/src/libslic3r/SLA/SLAConcurrency.hpp +++ b/src/libslic3r/SLA/SLAConcurrency.hpp @@ -10,7 +10,7 @@ namespace sla { // Set this to true to enable full parallelism in this module. // Only the well tested parts will be concurrent if this is set to false. -const constexpr bool USE_FULL_CONCURRENCY = false; +const constexpr bool USE_FULL_CONCURRENCY = true; template struct _ccr {}; diff --git a/src/libslic3r/SLA/SLASupportTreeBuilder.cpp b/src/libslic3r/SLA/SLASupportTreeBuilder.cpp index 9e1f8c1da..3fa9f3b98 100644 --- a/src/libslic3r/SLA/SLASupportTreeBuilder.cpp +++ b/src/libslic3r/SLA/SLASupportTreeBuilder.cpp @@ -360,6 +360,66 @@ const TriangleMesh &SupportTreeBuilder::add_pad(const ExPolygons &modelbase, return m_pad.tmesh; } +SupportTreeBuilder::SupportTreeBuilder(SupportTreeBuilder &&o) + : m_heads(std::move(o.m_heads)) + , m_head_indices{std::move(o.m_head_indices)} + , m_pillars{std::move(o.m_pillars)} + , m_bridges{std::move(o.m_bridges)} + , m_crossbridges{std::move(o.m_crossbridges)} + , m_compact_bridges{std::move(o.m_compact_bridges)} + , m_pad{std::move(o.m_pad)} + , m_meshcache{std::move(o.m_meshcache)} + , m_meshcache_valid{o.m_meshcache_valid} + , m_model_height{o.m_model_height} + , ground_level{o.ground_level} +{} + +SupportTreeBuilder::SupportTreeBuilder(const SupportTreeBuilder &o) + : m_heads(o.m_heads) + , m_head_indices{o.m_head_indices} + , m_pillars{o.m_pillars} + , m_bridges{o.m_bridges} + , m_crossbridges{o.m_crossbridges} + , m_compact_bridges{o.m_compact_bridges} + , m_pad{o.m_pad} + , m_meshcache{o.m_meshcache} + , m_meshcache_valid{o.m_meshcache_valid} + , m_model_height{o.m_model_height} + , ground_level{o.ground_level} +{} + +SupportTreeBuilder &SupportTreeBuilder::operator=(SupportTreeBuilder &&o) +{ + m_heads = std::move(o.m_heads); + m_head_indices = std::move(o.m_head_indices); + m_pillars = std::move(o.m_pillars); + m_bridges = std::move(o.m_bridges); + m_crossbridges = std::move(o.m_crossbridges); + m_compact_bridges = std::move(o.m_compact_bridges); + m_pad = std::move(o.m_pad); + m_meshcache = std::move(o.m_meshcache); + m_meshcache_valid = o.m_meshcache_valid; + m_model_height = o.m_model_height; + ground_level = o.ground_level; + return *this; +} + +SupportTreeBuilder &SupportTreeBuilder::operator=(const SupportTreeBuilder &o) +{ + m_heads = o.m_heads; + m_head_indices = o.m_head_indices; + m_pillars = o.m_pillars; + m_bridges = o.m_bridges; + m_crossbridges = o.m_crossbridges; + m_compact_bridges = o.m_compact_bridges; + m_pad = o.m_pad; + m_meshcache = o.m_meshcache; + m_meshcache_valid = o.m_meshcache_valid; + m_model_height = o.m_model_height; + ground_level = o.ground_level; + return *this; +} + const TriangleMesh &SupportTreeBuilder::merged_mesh() const { if (m_meshcache_valid) return m_meshcache; diff --git a/src/libslic3r/SLA/SLASupportTreeBuilder.hpp b/src/libslic3r/SLA/SLASupportTreeBuilder.hpp index 7f38cf280..e967f5ea7 100644 --- a/src/libslic3r/SLA/SLASupportTreeBuilder.hpp +++ b/src/libslic3r/SLA/SLASupportTreeBuilder.hpp @@ -287,7 +287,11 @@ public: double ground_level = 0; SupportTreeBuilder() = default; - + SupportTreeBuilder(SupportTreeBuilder &&o); + SupportTreeBuilder(const SupportTreeBuilder &o); + SupportTreeBuilder& operator=(SupportTreeBuilder &&o); + SupportTreeBuilder& operator=(const SupportTreeBuilder &o); + template Head& add_head(unsigned id, Args&&... args) { std::lock_guard lk(m_mutex); diff --git a/src/libslic3r/SLA/SLASupportTreeBuildsteps.cpp b/src/libslic3r/SLA/SLASupportTreeBuildsteps.cpp index 72673babf..0ff26b3ac 100644 --- a/src/libslic3r/SLA/SLASupportTreeBuildsteps.cpp +++ b/src/libslic3r/SLA/SLASupportTreeBuildsteps.cpp @@ -213,7 +213,7 @@ EigenMesh3D::hit_result SupportTreeBuildsteps::pinhead_mesh_intersect( // Now a and b vectors are perpendicular to v and to each other. // Together they define the plane where we have to iterate with the // given angles in the 'phis' vector - ccr_par::enumerate( + ccr::enumerate( phis.begin(), phis.end(), [&hits, &m, sd, r_pin, r_back, s, a, b, c](double phi, size_t i) { double sinphi = std::sin(phi); @@ -310,7 +310,7 @@ EigenMesh3D::hit_result SupportTreeBuildsteps::bridge_mesh_intersect( // Hit results std::array hits; - ccr_par::enumerate( + ccr::enumerate( phis.begin(), phis.end(), [&m, a, b, sd, dir, r, s, ins_check, &hits] (double phi, size_t i) { double sinphi = std::sin(phi);