From 6949543912ab3974bc65f3ece28f173f33052dd2 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Wed, 17 Jul 2019 18:10:08 +0200 Subject: [PATCH] Fixes after merge with master. --- src/libslic3r/Model.cpp | 2 +- src/libslic3r/Model.hpp | 20 ++++++++++++++------ src/slic3r/GUI/GLCanvas3D.cpp | 4 ++-- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/libslic3r/Model.cpp b/src/libslic3r/Model.cpp index ed1c1bc00..ed8be8ce5 100644 --- a/src/libslic3r/Model.cpp +++ b/src/libslic3r/Model.cpp @@ -1992,4 +1992,4 @@ CEREAL_REGISTER_POLYMORPHIC_RELATION(Slic3r::ObjectBase, Slic3r::ModelObject) CEREAL_REGISTER_POLYMORPHIC_RELATION(Slic3r::ObjectBase, Slic3r::ModelVolume) CEREAL_REGISTER_POLYMORPHIC_RELATION(Slic3r::ObjectBase, Slic3r::ModelInstance) CEREAL_REGISTER_POLYMORPHIC_RELATION(Slic3r::ObjectBase, Slic3r::Model) -#endif \ No newline at end of file +#endif diff --git a/src/libslic3r/Model.hpp b/src/libslic3r/Model.hpp index 463d7b58e..f5786812f 100644 --- a/src/libslic3r/Model.hpp +++ b/src/libslic3r/Model.hpp @@ -623,10 +623,18 @@ private: ModelObject* object; // Constructor, which assigns a new unique ID. - explicit ModelInstance(ModelObject *object) : object(object), print_volume_state(PVS_Inside) { assert(this->id().valid()); } + explicit ModelInstance(ModelObject *object) : print_volume_state(PVS_Inside), object(object) + { + assert(this->id().valid()); + get_arrange_polygon(); // initialize the cache + } // Constructor, which assigns a new unique ID. explicit ModelInstance(ModelObject *object, const ModelInstance &other) : - m_transformation(other.m_transformation), object(object), print_volume_state(PVS_Inside) { assert(this->id().valid() && this->id() != other.id()); } + m_transformation(other.m_transformation), print_volume_state(PVS_Inside), object(object) + { + assert(this->id().valid() && this->id() != other.id()); + get_arrange_polygon(); // initialize the cache + } explicit ModelInstance(ModelInstance &&rhs) = delete; ModelInstance& operator=(const ModelInstance &rhs) = delete; @@ -641,10 +649,10 @@ private: } // Warning! This object is not guarded against concurrency. - // mutable struct ArrangeCache { - // bool valid = false; - // ExPolygon poly; - // } m_arrange_cache; + mutable struct ArrangeCache { + bool valid = false; + ExPolygon poly; + } m_arrange_cache; }; // The print bed content. diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 77a727108..3823f944a 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -3410,9 +3410,9 @@ GLCanvas3D::WipeTowerInfo GLCanvas3D::get_wipe_tower_info() const if (vol->is_wipe_tower) { wti.m_pos = Vec2d(m_config->opt_float("wipe_tower_x"), m_config->opt_float("wipe_tower_y")); - wti.rotation = (M_PI/180.) * m_config->opt_float("wipe_tower_rotation_angle"); + wti.m_rotation = (M_PI/180.) * m_config->opt_float("wipe_tower_rotation_angle"); const BoundingBoxf3& bb = vol->bounding_box(); - wti.bb_size = Vec2d(bb.size()(0), bb.size()(1)); + wti.m_bb_size = Vec2d(bb.size().x(), bb.size().y()); break; } }