From 227cc4dc3378c1350618f12f2f1b61437666f92b Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Mon, 3 Feb 2020 15:42:54 +0100 Subject: [PATCH] Fixed conflicts after merge slaposHollowing was divided into slaposHollowing and slaposDrillHoles on master This commit takes this into account on the code that was merged from lm_drilling_backend_rebased --- src/libslic3r/SLAPrint.cpp | 6 +++--- src/libslic3r/SLAPrint.hpp | 2 +- src/libslic3r/SLAPrintSteps.cpp | 4 ++-- src/slic3r/GUI/GLCanvas3D.cpp | 10 ++++------ src/slic3r/GUI/Gizmos/GLGizmoBase.cpp | 2 +- src/slic3r/GUI/Plater.cpp | 2 +- 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index e98e0edc4..06c4f687b 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -419,7 +419,7 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model, DynamicPrintConfig con if (model_object.sla_drain_holes != model_object_new.sla_drain_holes) { model_object.sla_drain_holes = model_object_new.sla_drain_holes; - update_apply_status(it_print_object_status->print_object->invalidate_step(slaposHollowing)); + update_apply_status(it_print_object_status->print_object->invalidate_step(slaposDrillHoles)); } // Copy the ModelObject name, input_file and instances. The instances will compared against PrintObject instances in the next step. @@ -1101,7 +1101,7 @@ const ExPolygons &SliceRecord::get_slice(SliceOrigin o) const bool SLAPrintObject::has_mesh(SLAPrintObjectStep step) const { switch (step) { - case slaposHollowing: + case slaposDrillHoles: return m_hollowing_data && !m_hollowing_data->hollow_mesh_with_holes.empty(); case slaposSupportTree: return ! this->support_mesh().empty(); @@ -1119,7 +1119,7 @@ TriangleMesh SLAPrintObject::get_mesh(SLAPrintObjectStep step) const return this->support_mesh(); case slaposPad: return this->pad_mesh(); - case slaposHollowing: + case slaposDrillHoles: if (m_hollowing_data) return m_hollowing_data->hollow_mesh_with_holes; [[fallthrough]]; diff --git a/src/libslic3r/SLAPrint.hpp b/src/libslic3r/SLAPrint.hpp index d2f121277..df052a9c7 100644 --- a/src/libslic3r/SLAPrint.hpp +++ b/src/libslic3r/SLAPrint.hpp @@ -78,7 +78,7 @@ public: // Support mesh is only valid if this->is_step_done(slaposPad) is true. const TriangleMesh& pad_mesh() const; - // Ready after this->is_step_done(slaposHollowing) is true + // Ready after this->is_step_done(slaposDrillHoles) is true const TriangleMesh& hollowed_interior_mesh() const; // Get the mesh that is going to be printed with all the modifications diff --git a/src/libslic3r/SLAPrintSteps.cpp b/src/libslic3r/SLAPrintSteps.cpp index 4bb6be7b0..4e19abd58 100644 --- a/src/libslic3r/SLAPrintSteps.cpp +++ b/src/libslic3r/SLAPrintSteps.cpp @@ -27,7 +27,7 @@ namespace { const std::array OBJ_STEP_LEVELS = { 10, // slaposHollowing, - 10, // slaposDrillHolesIfHollowed + 10, // slaposDrillHoles 10, // slaposObjectSlice, 20, // slaposSupportPoints, 10, // slaposSupportTree, @@ -39,7 +39,7 @@ std::string OBJ_STEP_LABELS(size_t idx) { switch (idx) { case slaposHollowing: return L("Hollowing model"); - case slaposDrillHoles: return L("Drilling holes into hollowed model."); + case slaposDrillHoles: return L("Drilling holes into model."); case slaposObjectSlice: return L("Slicing model"); case slaposSupportPoints: return L("Generating support points"); case slaposSupportTree: return L("Generating support tree"); diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 1e90b85c5..3d0730198 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1978,7 +1978,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re // SLA steps to pull the preview meshes for. typedef std::array SLASteps; - SLASteps sla_steps = { slaposHollowing, slaposSupportTree, slaposPad }; + SLASteps sla_steps = { slaposDrillHoles, slaposSupportTree, slaposPad }; struct SLASupportState { std::array::value> step; }; @@ -2025,7 +2025,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re // Consider the DONE step without a valid mesh as invalid for the purpose // of mesh visualization. state.step[istep].state = PrintStateBase::INVALID; - else if (sla_steps[istep] != slaposHollowing) + else if (sla_steps[istep] != slaposDrillHoles) for (const ModelInstance* model_instance : print_object->model_object()->instances) // Only the instances, which are currently printable, will have the SLA support structures kept. // The instances outside the print bed will have the GLVolumes of their support structures released. @@ -2169,7 +2169,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re assert(it != model_object->instances.end()); int instance_idx = it - model_object->instances.begin(); for (size_t istep = 0; istep < sla_steps.size(); ++ istep) - if (sla_steps[istep] == slaposHollowing) { + if (sla_steps[istep] == slaposDrillHoles) { // Hollowing is a special case, where the mesh from the backend is being loaded into the 1st volume of an instance, // not into its own GLVolume. // There shall always be such a GLVolume allocated. @@ -2182,7 +2182,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re // The backend either produced a new hollowed mesh, or it invalidated the one that the front end has seen. volume.indexed_vertex_array.release_geometry(); if (state.step[istep].state == PrintStateBase::DONE) { - TriangleMesh mesh = print_object->get_mesh(slaposHollowing); + TriangleMesh mesh = print_object->get_mesh(slaposDrillHoles); assert(! mesh.empty()); mesh.transform(sla_print->sla_trafo(*m_model->objects[volume.object_idx()]).inverse()); volume.indexed_vertex_array.load_mesh(mesh); @@ -6106,8 +6106,6 @@ void GLCanvas3D::_load_sla_shells() unsigned int initial_volumes_count = (unsigned int)m_volumes.volumes.size(); for (const SLAPrintObject::Instance& instance : obj->instances()) { add_volume(*obj, 0, instance, obj->get_mesh_to_print(), GLVolume::MODEL_COLOR[0], true); -// if (! obj->hollowed_interior_mesh().empty()) -// add_volume(*obj, -int(slaposHollowing), instance, obj->hollowed_interior_mesh(), GLVolume::MODEL_COLOR[0], false); // Set the extruder_id and volume_id to achieve the same color as in the 3D scene when // through the update_volumes_colors_by_extruder() call. m_volumes.volumes.back()->extruder_id = obj->model_object()->volumes.front()->extruder_id(); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoBase.cpp b/src/slic3r/GUI/Gizmos/GLGizmoBase.cpp index 653bfefb5..af022352e 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoBase.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoBase.cpp @@ -354,7 +354,7 @@ bool CommonGizmosData::update_from_backend(GLCanvas3D& canvas, ModelObject* mode // saved, a copy is stored as a member (FIXME) if (m_print_object_idx >=0) { const SLAPrintObject* po = canvas.sla_print()->objects()[m_print_object_idx]; - if (po->is_step_done(slaposHollowing)) { + if (po->is_step_done(slaposDrillHoles)) { m_backend_mesh_transformed = po->get_mesh_to_print(); m_backend_mesh_transformed.transform(canvas.sla_print()->sla_trafo(*m_model_object).inverse()); m_mesh = &m_backend_mesh_transformed; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 8afd98d11..57e0c787c 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -5130,7 +5130,7 @@ void Plater::reslice_SLA_supports(const ModelObject &object, bool postpone_error void Plater::reslice_SLA_hollowing(const ModelObject &object, bool postpone_error_messages) { - reslice_SLA_until_step(slaposHollowing, object, postpone_error_messages); + reslice_SLA_until_step(slaposDrillHoles, object, postpone_error_messages); } void Plater::reslice_SLA_until_step(SLAPrintObjectStep step, const ModelObject &object, bool postpone_error_messages)