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
This commit is contained in:
Lukas Matena 2020-02-03 15:42:54 +01:00
parent a1d4dab999
commit 227cc4dc33
6 changed files with 12 additions and 14 deletions

View File

@ -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) if (model_object.sla_drain_holes != model_object_new.sla_drain_holes)
{ {
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. // 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 bool SLAPrintObject::has_mesh(SLAPrintObjectStep step) const
{ {
switch (step) { switch (step) {
case slaposHollowing: case slaposDrillHoles:
return m_hollowing_data && !m_hollowing_data->hollow_mesh_with_holes.empty(); return m_hollowing_data && !m_hollowing_data->hollow_mesh_with_holes.empty();
case slaposSupportTree: case slaposSupportTree:
return ! this->support_mesh().empty(); return ! this->support_mesh().empty();
@ -1119,7 +1119,7 @@ TriangleMesh SLAPrintObject::get_mesh(SLAPrintObjectStep step) const
return this->support_mesh(); return this->support_mesh();
case slaposPad: case slaposPad:
return this->pad_mesh(); return this->pad_mesh();
case slaposHollowing: case slaposDrillHoles:
if (m_hollowing_data) if (m_hollowing_data)
return m_hollowing_data->hollow_mesh_with_holes; return m_hollowing_data->hollow_mesh_with_holes;
[[fallthrough]]; [[fallthrough]];

View File

@ -78,7 +78,7 @@ public:
// Support mesh is only valid if this->is_step_done(slaposPad) is true. // Support mesh is only valid if this->is_step_done(slaposPad) is true.
const TriangleMesh& pad_mesh() const; 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; const TriangleMesh& hollowed_interior_mesh() const;
// Get the mesh that is going to be printed with all the modifications // Get the mesh that is going to be printed with all the modifications

View File

@ -27,7 +27,7 @@ namespace {
const std::array<unsigned, slaposCount> OBJ_STEP_LEVELS = { const std::array<unsigned, slaposCount> OBJ_STEP_LEVELS = {
10, // slaposHollowing, 10, // slaposHollowing,
10, // slaposDrillHolesIfHollowed 10, // slaposDrillHoles
10, // slaposObjectSlice, 10, // slaposObjectSlice,
20, // slaposSupportPoints, 20, // slaposSupportPoints,
10, // slaposSupportTree, 10, // slaposSupportTree,
@ -39,7 +39,7 @@ std::string OBJ_STEP_LABELS(size_t idx)
{ {
switch (idx) { switch (idx) {
case slaposHollowing: return L("Hollowing model"); 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 slaposObjectSlice: return L("Slicing model");
case slaposSupportPoints: return L("Generating support points"); case slaposSupportPoints: return L("Generating support points");
case slaposSupportTree: return L("Generating support tree"); case slaposSupportTree: return L("Generating support tree");

View File

@ -1978,7 +1978,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
// SLA steps to pull the preview meshes for. // SLA steps to pull the preview meshes for.
typedef std::array<SLAPrintObjectStep, 3> SLASteps; typedef std::array<SLAPrintObjectStep, 3> SLASteps;
SLASteps sla_steps = { slaposHollowing, slaposSupportTree, slaposPad }; SLASteps sla_steps = { slaposDrillHoles, slaposSupportTree, slaposPad };
struct SLASupportState { struct SLASupportState {
std::array<PrintStateBase::StateWithTimeStamp, std::tuple_size<SLASteps>::value> step; std::array<PrintStateBase::StateWithTimeStamp, std::tuple_size<SLASteps>::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 // Consider the DONE step without a valid mesh as invalid for the purpose
// of mesh visualization. // of mesh visualization.
state.step[istep].state = PrintStateBase::INVALID; 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) for (const ModelInstance* model_instance : print_object->model_object()->instances)
// Only the instances, which are currently printable, will have the SLA support structures kept. // 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. // 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()); assert(it != model_object->instances.end());
int instance_idx = it - model_object->instances.begin(); int instance_idx = it - model_object->instances.begin();
for (size_t istep = 0; istep < sla_steps.size(); ++ istep) 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, // 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. // not into its own GLVolume.
// There shall always be such a GLVolume allocated. // 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. // 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(); volume.indexed_vertex_array.release_geometry();
if (state.step[istep].state == PrintStateBase::DONE) { if (state.step[istep].state == PrintStateBase::DONE) {
TriangleMesh mesh = print_object->get_mesh(slaposHollowing); TriangleMesh mesh = print_object->get_mesh(slaposDrillHoles);
assert(! mesh.empty()); assert(! mesh.empty());
mesh.transform(sla_print->sla_trafo(*m_model->objects[volume.object_idx()]).inverse()); mesh.transform(sla_print->sla_trafo(*m_model->objects[volume.object_idx()]).inverse());
volume.indexed_vertex_array.load_mesh(mesh); 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(); unsigned int initial_volumes_count = (unsigned int)m_volumes.volumes.size();
for (const SLAPrintObject::Instance& instance : obj->instances()) { for (const SLAPrintObject::Instance& instance : obj->instances()) {
add_volume(*obj, 0, instance, obj->get_mesh_to_print(), GLVolume::MODEL_COLOR[0], true); 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 // 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. // through the update_volumes_colors_by_extruder() call.
m_volumes.volumes.back()->extruder_id = obj->model_object()->volumes.front()->extruder_id(); m_volumes.volumes.back()->extruder_id = obj->model_object()->volumes.front()->extruder_id();

View File

@ -354,7 +354,7 @@ bool CommonGizmosData::update_from_backend(GLCanvas3D& canvas, ModelObject* mode
// saved, a copy is stored as a member (FIXME) // saved, a copy is stored as a member (FIXME)
if (m_print_object_idx >=0) { if (m_print_object_idx >=0) {
const SLAPrintObject* po = canvas.sla_print()->objects()[m_print_object_idx]; 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 = po->get_mesh_to_print();
m_backend_mesh_transformed.transform(canvas.sla_print()->sla_trafo(*m_model_object).inverse()); m_backend_mesh_transformed.transform(canvas.sla_print()->sla_trafo(*m_model_object).inverse());
m_mesh = &m_backend_mesh_transformed; m_mesh = &m_backend_mesh_transformed;

View File

@ -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) 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) void Plater::reslice_SLA_until_step(SLAPrintObjectStep step, const ModelObject &object, bool postpone_error_messages)