Use Plater's existing background_process() accessor

It was already public and used elsewhere, so the new get_background_process()
and its duplicate forward declaration were redundant; Plater.hpp is now untouched.
This commit is contained in:
SoftFever
2026-08-29 18:52:15 +08:00
parent bbd1989e1e
commit 937437907d
3 changed files with 3 additions and 14 deletions
+3 -4
View File
@@ -39,10 +39,9 @@ DesignCanvas::DesignCanvas(wxWindow* parent)
m_canvas->allow_multisample(OpenGLManager::can_multisample());
m_canvas->set_config(wxGetApp().plater()->config());
m_canvas->set_model(&m_model);
// Reuse the editor's shared slicing process: GLCanvas3D::render() (via
// _max_bounding_box) dereferences the process when canvas type == View3D.
// Passing nullptr segfaults; this mirrors View3D/Preview/AssembleView.
m_canvas->set_process(wxGetApp().plater()->get_background_process());
// Nothing to slice here, but GLCanvas3D derefs the process unguarded every frame, so it
// cannot be null. Borrow the plater's, as the editor canvases do.
m_canvas->set_process(&wxGetApp().plater()->background_process());
m_canvas->set_type(GLCanvas3D::ECanvasType::CanvasView3D);
// CAD navigation, this canvas only: left-drag sweeps a selection rubber band, so orbit
-5
View File
@@ -20649,11 +20649,6 @@ PartPlateList& Plater::get_partplate_list()
return p->partplate_list;
}
BackgroundSlicingProcess* Plater::get_background_process()
{
return &p->background_process;
}
void Plater::apply_background_progress()
{
PartPlate* part_plate = p->partplate_list.get_curr_plate();
-5
View File
@@ -47,7 +47,6 @@ class Model;
class ModelObject;
class ModelInstance;
class Print;
class BackgroundSlicingProcess;
class SLAPrint;
//BBS: add partplatelist and SlicingStatusEvent
class PartPlateList;
@@ -750,10 +749,6 @@ public:
//BBS: partplate list related functions
PartPlateList& get_partplate_list();
// Shared background slicing process (same instance View3D/Preview/AssembleView
// use). Exposed so the Design tab's native GLCanvas3D can be wired exactly like
// the editor canvases (GLCanvas3D::render() dereferences the process).
BackgroundSlicingProcess* get_background_process();
void validate_current_plate(bool& model_fits, bool& validate_error);
// Rebuild the missing-plugin sets from the active presets and (re)show/close their notifications.
// Returns true when slicing must be blocked (a referenced plugin is still missing); sets