mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-24 09:11:23 -06:00
Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_sinking_objects_collision
This commit is contained in:
commit
1dad3c20f7
77 changed files with 1255 additions and 1872 deletions
|
|
@ -179,6 +179,8 @@ set(SLIC3R_GUI_SOURCES
|
|||
GUI/Jobs/SLAImportJob.hpp
|
||||
GUI/Jobs/SLAImportJob.cpp
|
||||
GUI/Jobs/ProgressIndicator.hpp
|
||||
GUI/Jobs/NotificationProgressIndicator.hpp
|
||||
GUI/Jobs/NotificationProgressIndicator.cpp
|
||||
GUI/ProgressStatusBar.hpp
|
||||
GUI/ProgressStatusBar.cpp
|
||||
GUI/Mouse3DController.cpp
|
||||
|
|
|
|||
|
|
@ -313,7 +313,6 @@ void GLVolume::SinkingContours::update()
|
|||
m_shift = Vec3d::Zero();
|
||||
|
||||
const TriangleMesh& mesh = model.objects[object_idx]->volumes[m_parent.volume_idx()]->mesh();
|
||||
assert(mesh.has_shared_vertices());
|
||||
|
||||
m_model.reset();
|
||||
GUI::GLModel::InitializationData init_data;
|
||||
|
|
@ -519,7 +518,7 @@ const BoundingBoxf3& GLVolume::transformed_convex_hull_bounding_box() const
|
|||
|
||||
BoundingBoxf3 GLVolume::transformed_convex_hull_bounding_box(const Transform3d &trafo) const
|
||||
{
|
||||
return (m_convex_hull && m_convex_hull->facets_count() > 0) ?
|
||||
return (m_convex_hull && ! m_convex_hull->empty()) ?
|
||||
m_convex_hull->transformed_bounding_box(trafo) :
|
||||
bounding_box().transformed(trafo);
|
||||
}
|
||||
|
|
@ -736,21 +735,20 @@ int GLVolumeCollection::load_wipe_tower_preview(
|
|||
float min_width = 30.f;
|
||||
// We'll now create the box with jagged edge. y-coordinates of the pre-generated model
|
||||
// are shifted so that the front edge has y=0 and centerline of the back edge has y=depth:
|
||||
Pointf3s points;
|
||||
std::vector<Vec3i> facets;
|
||||
float out_points_idx[][3] = { { 0, -depth, 0 }, { 0, 0, 0 }, { 38.453f, 0, 0 }, { 61.547f, 0, 0 }, { 100.0f, 0, 0 }, { 100.0f, -depth, 0 }, { 55.7735f, -10.0f, 0 }, { 44.2265f, 10.0f, 0 },
|
||||
{ 38.453f, 0, 1 }, { 0, 0, 1 }, { 0, -depth, 1 }, { 100.0f, -depth, 1 }, { 100.0f, 0, 1 }, { 61.547f, 0, 1 }, { 55.7735f, -10.0f, 1 }, { 44.2265f, 10.0f, 1 } };
|
||||
int out_facets_idx[][3] = { { 0, 1, 2 }, { 3, 4, 5 }, { 6, 5, 0 }, { 3, 5, 6 }, { 6, 2, 7 }, { 6, 0, 2 }, { 8, 9, 10 }, { 11, 12, 13 }, { 10, 11, 14 }, { 14, 11, 13 }, { 15, 8, 14 },
|
||||
{8, 10, 14}, {3, 12, 4}, {3, 13, 12}, {6, 13, 3}, {6, 14, 13}, {7, 14, 6}, {7, 15, 14}, {2, 15, 7}, {2, 8, 15}, {1, 8, 2}, {1, 9, 8},
|
||||
{0, 9, 1}, {0, 10, 9}, {5, 10, 0}, {5, 11, 10}, {4, 11, 5}, {4, 12, 11} };
|
||||
static constexpr const int out_facets_idx[][3] = {
|
||||
{ 0, 1, 2 }, { 3, 4, 5 }, { 6, 5, 0 }, { 3, 5, 6 }, { 6, 2, 7 }, { 6, 0, 2 }, { 8, 9, 10 }, { 11, 12, 13 }, { 10, 11, 14 }, { 14, 11, 13 }, { 15, 8, 14 },
|
||||
{ 8, 10, 14 }, { 3, 12, 4 }, { 3, 13, 12 }, { 6, 13, 3 }, { 6, 14, 13 }, { 7, 14, 6 }, { 7, 15, 14 }, { 2, 15, 7 }, { 2, 8, 15 }, { 1, 8, 2 }, { 1, 9, 8 },
|
||||
{ 0, 9, 1 }, { 0, 10, 9 }, { 5, 10, 0 }, { 5, 11, 10 }, { 4, 11, 5 }, { 4, 12, 11 } };
|
||||
indexed_triangle_set its;
|
||||
for (int i = 0; i < 16; ++i)
|
||||
points.emplace_back(out_points_idx[i][0] / (100.f / min_width),
|
||||
out_points_idx[i][1] + depth, out_points_idx[i][2]);
|
||||
for (int i = 0; i < 28; ++i)
|
||||
facets.emplace_back(out_facets_idx[i][0],
|
||||
out_facets_idx[i][1],
|
||||
out_facets_idx[i][2]);
|
||||
TriangleMesh tooth_mesh(points, facets);
|
||||
its.vertices.emplace_back(out_points_idx[i][0] / (100.f / min_width),
|
||||
out_points_idx[i][1] + depth, out_points_idx[i][2]);
|
||||
its.indices.reserve(28);
|
||||
for (const int *face : out_facets_idx)
|
||||
its.indices.emplace_back(face);
|
||||
TriangleMesh tooth_mesh(std::move(its));
|
||||
|
||||
// We have the mesh ready. It has one tooth and width of min_width. We will now
|
||||
// append several of these together until we are close to the required width
|
||||
|
|
@ -761,7 +759,7 @@ int GLVolumeCollection::load_wipe_tower_preview(
|
|||
tooth_mesh.translate(min_width, 0.f, 0.f);
|
||||
}
|
||||
|
||||
mesh.scale(Vec3d(width / (n * min_width), 1.f, height)); // Scaling to proper width
|
||||
mesh.scale(Vec3f(width / (n * min_width), 1.f, height)); // Scaling to proper width
|
||||
}
|
||||
else
|
||||
mesh = make_cube(width, depth, height);
|
||||
|
|
@ -770,7 +768,6 @@ int GLVolumeCollection::load_wipe_tower_preview(
|
|||
TriangleMesh brim_mesh = make_cube(width + 2.f * brim_width, depth + 2.f * brim_width, 0.2f);
|
||||
brim_mesh.translate(-brim_width, -brim_width, 0.f);
|
||||
mesh.merge(brim_mesh);
|
||||
mesh.repair();
|
||||
|
||||
volumes.emplace_back(new GLVolume(color));
|
||||
GLVolume& v = *volumes.back();
|
||||
|
|
|
|||
|
|
@ -160,7 +160,6 @@ bool GLModel::init_from_file(const std::string& filename)
|
|||
}
|
||||
|
||||
TriangleMesh mesh = model.mesh();
|
||||
mesh.require_shared_vertices();
|
||||
init_from(mesh.its, mesh.bounding_box());
|
||||
|
||||
m_filename = filename;
|
||||
|
|
|
|||
|
|
@ -2279,7 +2279,7 @@ wxBookCtrlBase* GUI_App::tab_panel() const
|
|||
return mainframe->m_tabpanel;
|
||||
}
|
||||
|
||||
std::shared_ptr<NotificationManager> GUI_App::notification_manager()
|
||||
NotificationManager * GUI_App::notification_manager()
|
||||
{
|
||||
return plater_->get_notification_manager();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ public:
|
|||
ObjectLayers* obj_layers();
|
||||
Plater* plater();
|
||||
Model& model();
|
||||
std::shared_ptr<NotificationManager> notification_manager();
|
||||
NotificationManager * notification_manager();
|
||||
|
||||
// Parameters extracted from the command line to be passed to GUI after initialization.
|
||||
GUI_InitParams* init_params { nullptr };
|
||||
|
|
|
|||
|
|
@ -392,9 +392,9 @@ wxString ObjectList::get_mesh_errors_list(const int obj_idx, const int vol_idx /
|
|||
// Create tooltip string, if there are errors
|
||||
wxString tooltip = format_wxstr(_L_PLURAL("Auto-repaired %1$d error", "Auto-repaired %1$d errors", errors), errors) + ":\n";
|
||||
|
||||
const stl_stats& stats = vol_idx == -1 ?
|
||||
(*m_objects)[obj_idx]->get_object_stl_stats() :
|
||||
(*m_objects)[obj_idx]->volumes[vol_idx]->mesh().stats();
|
||||
const TriangleMeshStats& stats = vol_idx == -1 ?
|
||||
(*m_objects)[obj_idx]->get_object_stl_stats() :
|
||||
(*m_objects)[obj_idx]->volumes[vol_idx]->mesh().stats();
|
||||
|
||||
if (stats.degenerate_facets > 0)
|
||||
tooltip += "\t" + format_wxstr(_L_PLURAL("%1$d degenerate facet", "%1$d degenerate facets", stats.degenerate_facets), stats.degenerate_facets) + "\n";
|
||||
|
|
@ -402,8 +402,6 @@ wxString ObjectList::get_mesh_errors_list(const int obj_idx, const int vol_idx /
|
|||
tooltip += "\t" + format_wxstr(_L_PLURAL("%1$d edge fixed", "%1$d edges fixed", stats.edges_fixed), stats.edges_fixed) + "\n";
|
||||
if (stats.facets_removed > 0)
|
||||
tooltip += "\t" + format_wxstr(_L_PLURAL("%1$d facet removed", "%1$d facets removed", stats.facets_removed), stats.facets_removed) + "\n";
|
||||
if (stats.facets_added > 0)
|
||||
tooltip += "\t" + format_wxstr(_L_PLURAL("%1$d facet added", "%1$d facets added", stats.facets_added), stats.facets_added) + "\n";
|
||||
if (stats.facets_reversed > 0)
|
||||
tooltip += "\t" + format_wxstr(_L_PLURAL("%1$d facet reversed", "%1$d facets reversed", stats.facets_reversed), stats.facets_reversed) + "\n";
|
||||
if (stats.backwards_edges > 0)
|
||||
|
|
@ -1535,7 +1533,6 @@ void ObjectList::load_modifier(ModelObject& model_object, std::vector<ModelVolum
|
|||
}
|
||||
|
||||
TriangleMesh mesh = model.mesh();
|
||||
mesh.repair();
|
||||
// Mesh will be centered when loading.
|
||||
ModelVolume* new_volume = model_object.add_volume(std::move(mesh), type);
|
||||
new_volume->name = boost::filesystem::path(input_file).filename().string();
|
||||
|
|
@ -1558,27 +1555,24 @@ void ObjectList::load_modifier(ModelObject& model_object, std::vector<ModelVolum
|
|||
|
||||
static TriangleMesh create_mesh(const std::string& type_name, const BoundingBoxf3& bb)
|
||||
{
|
||||
TriangleMesh mesh;
|
||||
|
||||
const double side = wxGetApp().plater()->canvas3D()->get_size_proportional_to_max_bed_size(0.1);
|
||||
|
||||
indexed_triangle_set mesh;
|
||||
if (type_name == "Box")
|
||||
// Sitting on the print bed, left front front corner at (0, 0).
|
||||
mesh = make_cube(side, side, side);
|
||||
mesh = its_make_cube(side, side, side);
|
||||
else if (type_name == "Cylinder")
|
||||
// Centered around 0, sitting on the print bed.
|
||||
// The cylinder has the same volume as the box above.
|
||||
mesh = make_cylinder(0.564 * side, side);
|
||||
mesh = its_make_cylinder(0.564 * side, side);
|
||||
else if (type_name == "Sphere")
|
||||
// Centered around 0, half the sphere below the print bed, half above.
|
||||
// The sphere has the same volume as the box above.
|
||||
mesh = make_sphere(0.62 * side, PI / 18);
|
||||
mesh = its_make_sphere(0.62 * side, PI / 18);
|
||||
else if (type_name == "Slab")
|
||||
// Sitting on the print bed, left front front corner at (0, 0).
|
||||
mesh = make_cube(bb.size().x() * 1.5, bb.size().y() * 1.5, bb.size().z() * 0.5);
|
||||
mesh.repair();
|
||||
|
||||
return mesh;
|
||||
mesh = its_make_cube(bb.size().x() * 1.5, bb.size().y() * 1.5, bb.size().z() * 0.5);
|
||||
return TriangleMesh(mesh);
|
||||
}
|
||||
|
||||
void ObjectList::load_generic_subobject(const std::string& type_name, const ModelVolumeType type)
|
||||
|
|
|
|||
|
|
@ -725,7 +725,7 @@ void Preview::update_layers_slider(const std::vector<double>& layers_z, bool kee
|
|||
|
||||
double top_area = area(object->get_layer(int(object->layers().size()) - 1)->lslices);
|
||||
if( bottom_area - top_area > delta_area) {
|
||||
std::shared_ptr<NotificationManager> notif_mngr = wxGetApp().plater()->get_notification_manager();
|
||||
NotificationManager *notif_mngr = wxGetApp().plater()->get_notification_manager();
|
||||
notif_mngr->push_notification(
|
||||
NotificationType::SignDetected, NotificationManager::NotificationLevel::RegularNotificationLevel,
|
||||
_u8L("NOTE:") + "\n" + _u8L("Sliced object looks like the sign") + "\n",
|
||||
|
|
|
|||
|
|
@ -282,10 +282,8 @@ void GLGizmoCut::update_contours()
|
|||
if (m_cut_contours.cut_z != m_cut_z || m_cut_contours.object_id != model_object->id() || m_cut_contours.instance_idx != instance_idx) {
|
||||
m_cut_contours.cut_z = m_cut_z;
|
||||
|
||||
if (m_cut_contours.object_id != model_object->id()) {
|
||||
if (m_cut_contours.object_id != model_object->id())
|
||||
m_cut_contours.mesh = model_object->raw_mesh();
|
||||
m_cut_contours.mesh.repair();
|
||||
}
|
||||
|
||||
m_cut_contours.position = box.center();
|
||||
m_cut_contours.shift = Vec3d::Zero();
|
||||
|
|
|
|||
|
|
@ -313,9 +313,8 @@ void GLGizmoSimplify::process()
|
|||
}
|
||||
|
||||
void GLGizmoSimplify::set_its(indexed_triangle_set &its) {
|
||||
auto tm = std::make_unique<TriangleMesh>(its);
|
||||
tm->repair();
|
||||
m_volume->set_mesh(std::move(tm));
|
||||
m_volume->set_mesh(its);
|
||||
m_volume->calculate_convex_hull();
|
||||
m_volume->set_new_unique_id();
|
||||
m_volume->get_object()->invalidate_bounding_box();
|
||||
m_need_reload = true;
|
||||
|
|
|
|||
|
|
@ -270,11 +270,10 @@ void HollowedMesh::on_update()
|
|||
m_drainholes = print_object->model_object()->sla_drain_holes;
|
||||
m_old_hollowing_timestamp = timestamp;
|
||||
|
||||
const indexed_triangle_set &interior = print_object->hollowed_interior_mesh();
|
||||
indexed_triangle_set interior = print_object->hollowed_interior_mesh();
|
||||
if (!interior.empty()) {
|
||||
m_hollowed_interior_transformed = std::make_unique<TriangleMesh>(interior);
|
||||
m_hollowed_interior_transformed->repaired = false;
|
||||
m_hollowed_interior_transformed->repair(true);
|
||||
its_flip_triangles(interior);
|
||||
m_hollowed_interior_transformed = std::make_unique<TriangleMesh>(std::move(interior));
|
||||
m_hollowed_interior_transformed->transform(trafo_inv);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ namespace Slic3r {
|
|||
class ModelInstance;
|
||||
|
||||
namespace GUI {
|
||||
class NotificationManager;
|
||||
|
||||
class ArrangeJob : public PlaterJob
|
||||
{
|
||||
|
|
@ -18,21 +17,21 @@ class ArrangeJob : public PlaterJob
|
|||
|
||||
ArrangePolygons m_selected, m_unselected, m_unprintable;
|
||||
std::vector<ModelInstance*> m_unarranged;
|
||||
|
||||
|
||||
// clear m_selected and m_unselected, reserve space for next usage
|
||||
void clear_input();
|
||||
|
||||
// Prepare all objects on the bed regardless of the selection
|
||||
void prepare_all();
|
||||
|
||||
|
||||
// Prepare the selected and unselected items separately. If nothing is
|
||||
// selected, behaves as if everything would be selected.
|
||||
void prepare_selected();
|
||||
|
||||
ArrangePolygon get_arrange_poly_(ModelInstance *mi);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
void prepare() override;
|
||||
|
||||
void on_exception(const std::exception_ptr &) override;
|
||||
|
|
@ -40,15 +39,15 @@ protected:
|
|||
void process() override;
|
||||
|
||||
public:
|
||||
ArrangeJob(std::shared_ptr<NotificationManager> nm, Plater *plater)
|
||||
: PlaterJob{nm, plater}
|
||||
ArrangeJob(std::shared_ptr<ProgressIndicator> pri, Plater *plater)
|
||||
: PlaterJob{std::move(pri), plater}
|
||||
{}
|
||||
|
||||
|
||||
int status_range() const override
|
||||
{
|
||||
return int(m_selected.size() + m_unprintable.size());
|
||||
}
|
||||
|
||||
|
||||
void finalize() override;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
namespace Slic3r { namespace GUI {
|
||||
|
||||
class Plater;
|
||||
class NotificationManager;
|
||||
|
||||
class FillBedJob : public PlaterJob
|
||||
{
|
||||
|
|
@ -28,8 +27,8 @@ protected:
|
|||
void process() override;
|
||||
|
||||
public:
|
||||
FillBedJob(std::shared_ptr<NotificationManager> nm, Plater *plater)
|
||||
: PlaterJob{nm, plater}
|
||||
FillBedJob(std::shared_ptr<ProgressIndicator> pri, Plater *plater)
|
||||
: PlaterJob{std::move(pri), plater}
|
||||
{}
|
||||
|
||||
int status_range() const override
|
||||
|
|
|
|||
|
|
@ -2,11 +2,9 @@
|
|||
#include <exception>
|
||||
|
||||
#include "Job.hpp"
|
||||
#include "../NotificationManager.hpp"
|
||||
#include <libslic3r/Thread.hpp>
|
||||
#include <boost/log/trivial.hpp>
|
||||
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
void GUI::Job::run(std::exception_ptr &eptr)
|
||||
|
|
@ -19,7 +17,7 @@ void GUI::Job::run(std::exception_ptr &eptr)
|
|||
}
|
||||
|
||||
m_running.store(false);
|
||||
|
||||
|
||||
// ensure to call the last status to finalize the job
|
||||
update_status(status_range(), "");
|
||||
}
|
||||
|
|
@ -32,8 +30,8 @@ void GUI::Job::update_status(int st, const wxString &msg)
|
|||
wxQueueEvent(this, evt);
|
||||
}
|
||||
|
||||
GUI::Job::Job(std::shared_ptr<NotificationManager> nm)
|
||||
: m_notifications(nm)
|
||||
GUI::Job::Job(std::shared_ptr<ProgressIndicator> pri)
|
||||
: m_progress(std::move(pri))
|
||||
{
|
||||
m_thread_evt_id = wxNewId();
|
||||
|
||||
|
|
@ -42,21 +40,21 @@ GUI::Job::Job(std::shared_ptr<NotificationManager> nm)
|
|||
|
||||
auto msg = evt.GetString();
|
||||
if (!msg.empty() && !m_worker_error)
|
||||
m_notifications->progress_indicator_set_status_text(msg.ToUTF8().data());
|
||||
m_progress->set_status_text(msg.ToUTF8().data());
|
||||
|
||||
if (m_finalized) return;
|
||||
|
||||
m_notifications->progress_indicator_set_progress(evt.GetInt());
|
||||
m_progress->set_progress(evt.GetInt());
|
||||
if (evt.GetInt() == status_range() || m_worker_error) {
|
||||
// set back the original range and cancel callback
|
||||
m_notifications->progress_indicator_set_range(m_range);
|
||||
m_notifications->progress_indicator_set_cancel_callback();
|
||||
m_progress->set_range(m_range);
|
||||
m_progress->set_cancel_callback();
|
||||
wxEndBusyCursor();
|
||||
|
||||
|
||||
if (m_worker_error) {
|
||||
m_finalized = true;
|
||||
m_notifications->progress_indicator_set_status_text("");
|
||||
m_notifications->progress_indicator_set_progress(m_range);
|
||||
m_progress->set_status_text("");
|
||||
m_progress->set_progress(m_range);
|
||||
on_exception(m_worker_error);
|
||||
}
|
||||
else {
|
||||
|
|
@ -86,22 +84,22 @@ void GUI::Job::start()
|
|||
{ // Start the job. No effect if the job is already running
|
||||
if (!m_running.load()) {
|
||||
prepare();
|
||||
|
||||
|
||||
// Save the current status indicatior range and push the new one
|
||||
m_range = m_notifications->progress_indicator_get_range();
|
||||
m_notifications->progress_indicator_set_range(status_range());
|
||||
|
||||
m_range = m_progress->get_range();
|
||||
m_progress->set_range(status_range());
|
||||
|
||||
// init cancellation flag and set the cancel callback
|
||||
m_canceled.store(false);
|
||||
m_notifications->progress_indicator_set_cancel_callback(
|
||||
m_progress->set_cancel_callback(
|
||||
[this]() { m_canceled.store(true); });
|
||||
|
||||
|
||||
m_finalized = false;
|
||||
m_finalizing = false;
|
||||
|
||||
|
||||
// Changing cursor to busy
|
||||
wxBeginBusyCursor();
|
||||
|
||||
|
||||
try { // Execute the job
|
||||
m_worker_error = nullptr;
|
||||
m_thread = create_thread([this] { this->run(m_worker_error); });
|
||||
|
|
@ -110,7 +108,7 @@ void GUI::Job::start()
|
|||
_(L("ERROR: not enough resources to "
|
||||
"execute a new job.")));
|
||||
}
|
||||
|
||||
|
||||
// The state changes will be undone when the process hits the
|
||||
// last status value, in the status update handler (see ctor)
|
||||
}
|
||||
|
|
@ -119,12 +117,12 @@ void GUI::Job::start()
|
|||
bool GUI::Job::join(int timeout_ms)
|
||||
{
|
||||
if (!m_thread.joinable()) return true;
|
||||
|
||||
|
||||
if (timeout_ms <= 0)
|
||||
m_thread.join();
|
||||
else if (!m_thread.try_join_for(boost::chrono::milliseconds(timeout_ms)))
|
||||
return false;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -137,10 +135,10 @@ void GUI::ExclusiveJobGroup::start(size_t jid) {
|
|||
void GUI::ExclusiveJobGroup::join_all(int wait_ms)
|
||||
{
|
||||
std::vector<bool> aborted(m_jobs.size(), false);
|
||||
|
||||
|
||||
for (size_t jid = 0; jid < m_jobs.size(); ++jid)
|
||||
aborted[jid] = m_jobs[jid]->join(wait_ms);
|
||||
|
||||
|
||||
if (!std::all_of(aborted.begin(), aborted.end(), [](bool t) { return t; }))
|
||||
BOOST_LOG_TRIVIAL(error) << "Could not abort a job!";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,13 +8,14 @@
|
|||
|
||||
#include <slic3r/GUI/I18N.hpp>
|
||||
|
||||
#include "ProgressIndicator.hpp"
|
||||
|
||||
#include <wx/event.h>
|
||||
|
||||
#include <boost/thread.hpp>
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
class NotificationManager;
|
||||
// A class to handle UI jobs like arranging and optimizing rotation.
|
||||
// These are not instant jobs, the user has to be informed about their
|
||||
// state in the status progress indicator. On the other hand they are
|
||||
|
|
@ -32,7 +33,7 @@ class Job : public wxEvtHandler
|
|||
boost::thread m_thread;
|
||||
std::atomic<bool> m_running{false}, m_canceled{false};
|
||||
bool m_finalized = false, m_finalizing = false;
|
||||
std::shared_ptr<NotificationManager> m_notifications;
|
||||
std::shared_ptr<ProgressIndicator> m_progress;
|
||||
std::exception_ptr m_worker_error = nullptr;
|
||||
|
||||
void run(std::exception_ptr &);
|
||||
|
|
@ -64,7 +65,7 @@ protected:
|
|||
}
|
||||
|
||||
public:
|
||||
Job(std::shared_ptr<NotificationManager> nm);
|
||||
Job(std::shared_ptr<ProgressIndicator> pri);
|
||||
|
||||
bool is_finalized() const { return m_finalized; }
|
||||
|
||||
|
|
|
|||
33
src/slic3r/GUI/Jobs/NotificationProgressIndicator.cpp
Normal file
33
src/slic3r/GUI/Jobs/NotificationProgressIndicator.cpp
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#include "NotificationProgressIndicator.hpp"
|
||||
#include "slic3r/GUI/NotificationManager.hpp"
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
NotificationProgressIndicator::NotificationProgressIndicator(NotificationManager *nm): m_nm{nm} {}
|
||||
|
||||
void NotificationProgressIndicator::set_range(int range)
|
||||
{
|
||||
m_nm->progress_indicator_set_range(range);
|
||||
}
|
||||
|
||||
void NotificationProgressIndicator::set_cancel_callback(CancelFn fn)
|
||||
{
|
||||
m_nm->progress_indicator_set_cancel_callback(std::move(fn));
|
||||
}
|
||||
|
||||
void NotificationProgressIndicator::set_progress(int pr)
|
||||
{
|
||||
m_nm->progress_indicator_set_progress(pr);
|
||||
}
|
||||
|
||||
void NotificationProgressIndicator::set_status_text(const char *msg)
|
||||
{
|
||||
m_nm->progress_indicator_set_status_text(msg);
|
||||
}
|
||||
|
||||
int NotificationProgressIndicator::get_range() const
|
||||
{
|
||||
return m_nm->progress_indicator_get_range();
|
||||
}
|
||||
|
||||
}} // namespace Slic3r::GUI
|
||||
26
src/slic3r/GUI/Jobs/NotificationProgressIndicator.hpp
Normal file
26
src/slic3r/GUI/Jobs/NotificationProgressIndicator.hpp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#ifndef NOTIFICATIONPROGRESSINDICATOR_HPP
|
||||
#define NOTIFICATIONPROGRESSINDICATOR_HPP
|
||||
|
||||
#include "ProgressIndicator.hpp"
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
class NotificationManager;
|
||||
|
||||
class NotificationProgressIndicator: public ProgressIndicator {
|
||||
NotificationManager *m_nm = nullptr;
|
||||
|
||||
public:
|
||||
|
||||
explicit NotificationProgressIndicator(NotificationManager *nm);
|
||||
|
||||
void set_range(int range) override;
|
||||
void set_cancel_callback(CancelFn = CancelFn()) override;
|
||||
void set_progress(int pr) override;
|
||||
void set_status_text(const char *) override; // utf8 char array
|
||||
int get_range() const override;
|
||||
};
|
||||
|
||||
}} // namespace Slic3r::GUI
|
||||
|
||||
#endif // NOTIFICATIONPROGRESSINDICATOR_HPP
|
||||
|
|
@ -6,7 +6,6 @@
|
|||
namespace Slic3r { namespace GUI {
|
||||
|
||||
class Plater;
|
||||
class NotificationManager;
|
||||
|
||||
class PlaterJob : public Job {
|
||||
protected:
|
||||
|
|
@ -16,8 +15,8 @@ protected:
|
|||
|
||||
public:
|
||||
|
||||
PlaterJob(std::shared_ptr<NotificationManager> nm, Plater *plater):
|
||||
Job{nm}, m_plater{plater} {}
|
||||
PlaterJob(std::shared_ptr<ProgressIndicator> pri, Plater *plater):
|
||||
Job{std::move(pri)}, m_plater{plater} {}
|
||||
};
|
||||
|
||||
}} // namespace Slic3r::GUI
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ namespace Slic3r {
|
|||
|
||||
namespace GUI {
|
||||
|
||||
class NotificationManager;
|
||||
|
||||
class RotoptimizeJob : public PlaterJob
|
||||
{
|
||||
using FindFn = std::function<Vec2d(const ModelObject & mo,
|
||||
|
|
@ -54,8 +52,8 @@ protected:
|
|||
|
||||
public:
|
||||
|
||||
RotoptimizeJob(std::shared_ptr<NotificationManager> nm, Plater *plater)
|
||||
: PlaterJob{nm, plater}
|
||||
RotoptimizeJob(std::shared_ptr<ProgressIndicator> pri, Plater *plater)
|
||||
: PlaterJob{std::move(pri), plater}
|
||||
{}
|
||||
|
||||
void finalize() override;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
#include "slic3r/GUI/GUI_App.hpp"
|
||||
#include "slic3r/GUI/Plater.hpp"
|
||||
#include "slic3r/GUI/GUI_ObjectList.hpp"
|
||||
#include "slic3r/GUI/NotificationManager.hpp"
|
||||
|
||||
#include "libslic3r/Model.hpp"
|
||||
#include "libslic3r/PresetBundle.hpp"
|
||||
|
|
@ -20,79 +19,79 @@
|
|||
namespace Slic3r { namespace GUI {
|
||||
|
||||
enum class Sel { modelAndProfile, profileOnly, modelOnly};
|
||||
|
||||
|
||||
class ImportDlg: public wxDialog {
|
||||
wxFilePickerCtrl *m_filepicker;
|
||||
wxComboBox *m_import_dropdown, *m_quality_dropdown;
|
||||
|
||||
|
||||
public:
|
||||
ImportDlg(Plater *plater)
|
||||
: wxDialog{plater, wxID_ANY, "Import SLA archive"}
|
||||
{
|
||||
auto szvert = new wxBoxSizer{wxVERTICAL};
|
||||
auto szfilepck = new wxBoxSizer{wxHORIZONTAL};
|
||||
|
||||
|
||||
m_filepicker = new wxFilePickerCtrl(this, wxID_ANY,
|
||||
from_u8(wxGetApp().app_config->get_last_dir()), _(L("Choose SLA archive:")),
|
||||
"SL1 / SL1S archive files (*.sl1, *.sl1s, *.zip)|*.sl1;*.SL1;*.sl1s;*.SL1S;*.zip;*.ZIP",
|
||||
wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE | wxFD_OPEN | wxFD_FILE_MUST_EXIST);
|
||||
|
||||
|
||||
szfilepck->Add(new wxStaticText(this, wxID_ANY, _L("Import file") + ": "), 0, wxALIGN_CENTER);
|
||||
szfilepck->Add(m_filepicker, 1);
|
||||
szvert->Add(szfilepck, 0, wxALL | wxEXPAND, 5);
|
||||
|
||||
|
||||
auto szchoices = new wxBoxSizer{wxHORIZONTAL};
|
||||
|
||||
|
||||
static const std::vector<wxString> inp_choices = {
|
||||
_(L("Import model and profile")),
|
||||
_(L("Import profile only")),
|
||||
_(L("Import model only"))
|
||||
};
|
||||
|
||||
|
||||
m_import_dropdown = new wxComboBox(
|
||||
this, wxID_ANY, inp_choices[0], wxDefaultPosition, wxDefaultSize,
|
||||
inp_choices.size(), inp_choices.data(), wxCB_READONLY | wxCB_DROPDOWN);
|
||||
|
||||
|
||||
szchoices->Add(m_import_dropdown);
|
||||
szchoices->Add(new wxStaticText(this, wxID_ANY, _L("Quality") + ": "), 0, wxALIGN_CENTER | wxALL, 5);
|
||||
|
||||
|
||||
static const std::vector<wxString> qual_choices = {
|
||||
_(L("Accurate")),
|
||||
_(L("Balanced")),
|
||||
_(L("Quick"))
|
||||
};
|
||||
|
||||
|
||||
m_quality_dropdown = new wxComboBox(
|
||||
this, wxID_ANY, qual_choices[0], wxDefaultPosition, wxDefaultSize,
|
||||
qual_choices.size(), qual_choices.data(), wxCB_READONLY | wxCB_DROPDOWN);
|
||||
szchoices->Add(m_quality_dropdown);
|
||||
|
||||
|
||||
m_import_dropdown->Bind(wxEVT_COMBOBOX, [this](wxCommandEvent &) {
|
||||
if (get_selection() == Sel::profileOnly)
|
||||
m_quality_dropdown->Disable();
|
||||
else m_quality_dropdown->Enable();
|
||||
});
|
||||
|
||||
|
||||
szvert->Add(szchoices, 0, wxALL, 5);
|
||||
szvert->AddStretchSpacer(1);
|
||||
auto szbtn = new wxBoxSizer(wxHORIZONTAL);
|
||||
szbtn->Add(new wxButton{this, wxID_CANCEL});
|
||||
szbtn->Add(new wxButton{this, wxID_OK});
|
||||
szvert->Add(szbtn, 0, wxALIGN_RIGHT | wxALL, 5);
|
||||
|
||||
|
||||
SetSizerAndFit(szvert);
|
||||
}
|
||||
|
||||
|
||||
Sel get_selection() const
|
||||
{
|
||||
int sel = m_import_dropdown->GetSelection();
|
||||
return Sel(std::min(int(Sel::modelOnly), std::max(0, sel)));
|
||||
}
|
||||
|
||||
|
||||
Vec2i get_marchsq_windowsize() const
|
||||
{
|
||||
enum { Accurate, Balanced, Fast};
|
||||
|
||||
|
||||
switch(m_quality_dropdown->GetSelection())
|
||||
{
|
||||
case Fast: return {8, 8};
|
||||
|
|
@ -102,7 +101,7 @@ public:
|
|||
return {2, 2};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
wxString get_path() const
|
||||
{
|
||||
return m_filepicker->GetPath();
|
||||
|
|
@ -112,7 +111,7 @@ public:
|
|||
class SLAImportJob::priv {
|
||||
public:
|
||||
Plater *plater;
|
||||
|
||||
|
||||
Sel sel = Sel::modelAndProfile;
|
||||
|
||||
indexed_triangle_set mesh;
|
||||
|
|
@ -125,8 +124,8 @@ public:
|
|||
priv(Plater *plt) : plater{plt} {}
|
||||
};
|
||||
|
||||
SLAImportJob::SLAImportJob(std::shared_ptr<NotificationManager> nm, Plater *plater)
|
||||
: PlaterJob{nm, plater}, p{std::make_unique<priv>(plater)}
|
||||
SLAImportJob::SLAImportJob(std::shared_ptr<ProgressIndicator> pri, Plater *plater)
|
||||
: PlaterJob{std::move(pri), plater}, p{std::make_unique<priv>(plater)}
|
||||
{}
|
||||
|
||||
SLAImportJob::~SLAImportJob() = default;
|
||||
|
|
@ -138,9 +137,9 @@ void SLAImportJob::process()
|
|||
update_status(int(s), _(L("Importing SLA archive")));
|
||||
return !was_canceled();
|
||||
};
|
||||
|
||||
|
||||
if (p->path.empty()) return;
|
||||
|
||||
|
||||
std::string path = p->path.ToUTF8().data();
|
||||
try {
|
||||
switch (p->sel) {
|
||||
|
|
@ -154,11 +153,11 @@ void SLAImportJob::process()
|
|||
p->config_substitutions = import_sla_archive(path, p->profile);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
} catch (std::exception &ex) {
|
||||
p->err = ex.what();
|
||||
}
|
||||
|
||||
|
||||
update_status(100, was_canceled() ? _(L("Importing canceled.")) :
|
||||
_(L("Importing done.")));
|
||||
}
|
||||
|
|
@ -175,9 +174,9 @@ void SLAImportJob::reset()
|
|||
void SLAImportJob::prepare()
|
||||
{
|
||||
reset();
|
||||
|
||||
|
||||
ImportDlg dlg{p->plater};
|
||||
|
||||
|
||||
if (dlg.ShowModal() == wxID_OK) {
|
||||
auto path = dlg.get_path();
|
||||
auto nm = wxFileName(path);
|
||||
|
|
@ -194,15 +193,15 @@ void SLAImportJob::finalize()
|
|||
{
|
||||
// Ignore the arrange result if aborted.
|
||||
if (was_canceled()) return;
|
||||
|
||||
|
||||
if (!p->err.empty()) {
|
||||
show_error(p->plater, p->err);
|
||||
p->err = "";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
std::string name = wxFileName(p->path).GetName().ToUTF8().data();
|
||||
|
||||
|
||||
if (!p->profile.empty()) {
|
||||
const ModelObjectPtrs& objects = p->plater->model().objects;
|
||||
for (auto object : objects)
|
||||
|
|
@ -214,15 +213,15 @@ void SLAImportJob::finalize()
|
|||
_(L("Attention!")) );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
DynamicPrintConfig config = {};
|
||||
config.apply(SLAFullPrintConfig::defaults());
|
||||
config += std::move(p->profile);
|
||||
|
||||
|
||||
wxGetApp().preset_bundle->load_config_model(name, std::move(config));
|
||||
wxGetApp().load_current_presets();
|
||||
}
|
||||
|
||||
|
||||
if (!p->mesh.empty()) {
|
||||
bool is_centered = false;
|
||||
p->plater->sidebar().obj_list()->load_mesh_object(TriangleMesh{p->mesh},
|
||||
|
|
|
|||
|
|
@ -5,20 +5,18 @@
|
|||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
class NotificationManager;
|
||||
|
||||
class SLAImportJob : public PlaterJob {
|
||||
class priv;
|
||||
|
||||
|
||||
std::unique_ptr<priv> p;
|
||||
|
||||
|
||||
protected:
|
||||
void prepare() override;
|
||||
void process() override;
|
||||
void finalize() override;
|
||||
|
||||
public:
|
||||
SLAImportJob(std::shared_ptr<NotificationManager> nm, Plater *plater);
|
||||
SLAImportJob(std::shared_ptr<ProgressIndicator> pri, Plater *plater);
|
||||
~SLAImportJob();
|
||||
|
||||
void reset();
|
||||
|
|
|
|||
|
|
@ -1740,7 +1740,6 @@ void MainFrame::repair_stl()
|
|||
|
||||
Slic3r::TriangleMesh tmesh;
|
||||
tmesh.ReadSTLFile(input_file.ToUTF8().data());
|
||||
tmesh.repair();
|
||||
tmesh.WriteOBJFile(output_file.ToUTF8().data());
|
||||
Slic3r::GUI::show_info(this, L("Your file was repaired."), L("Repair"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,11 +91,9 @@ void MeshClipper::recalculate_triangles()
|
|||
MeshSlicingParams slicing_params;
|
||||
slicing_params.trafo.rotate(Eigen::Quaternion<double, Eigen::DontAlign>::FromTwoVectors(up, Vec3d::UnitZ()));
|
||||
|
||||
assert(m_mesh->has_shared_vertices());
|
||||
ExPolygons expolys = union_ex(slice_mesh(m_mesh->its, height_mesh, slicing_params));
|
||||
|
||||
if (m_negative_mesh && !m_negative_mesh->empty()) {
|
||||
assert(m_negative_mesh->has_shared_vertices());
|
||||
ExPolygons neg_expolys = union_ex(slice_mesh(m_negative_mesh->its, height_mesh, slicing_params));
|
||||
expolys = diff_ex(expolys, neg_expolys);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -532,9 +532,9 @@ void PhysicalPrinterDialog::update_host_type(bool printer_change)
|
|||
const std::vector<VendorProfile::PrinterModel>& models = preset->vendor->models;
|
||||
auto it = std::find_if(models.begin(), models.end(),
|
||||
[model_id](const VendorProfile::PrinterModel& model) { return model.id == model_id; });
|
||||
if (it != models.end() && it->family == "MK3")
|
||||
if (it != models.end() && (it->family == "MK3" || it->family == "MINI"))
|
||||
continue;
|
||||
} else if (!preset->vendor && model_id.rfind("MK3", 0) == 0) {
|
||||
} else if (!preset->vendor && (boost::ends_with(model_id, "MK3") || boost::ends_with(model_id, "MINI"))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,8 +67,8 @@
|
|||
#include "Jobs/FillBedJob.hpp"
|
||||
#include "Jobs/RotoptimizeJob.hpp"
|
||||
#include "Jobs/SLAImportJob.hpp"
|
||||
#include "Jobs/NotificationProgressIndicator.hpp"
|
||||
#include "BackgroundSlicingProcess.hpp"
|
||||
#include "ProgressStatusBar.hpp"
|
||||
#include "PrintHostDialogs.hpp"
|
||||
#include "ConfigWizard.hpp"
|
||||
#include "../Utils/ASCIIFolding.hpp"
|
||||
|
|
@ -1135,7 +1135,7 @@ void Sidebar::show_info_sizer()
|
|||
static_cast<int>(model_object->facets_count()), stats.number_of_parts));
|
||||
|
||||
int errors = stats.degenerate_facets + stats.edges_fixed + stats.facets_removed +
|
||||
stats.facets_added + stats.facets_reversed + stats.backwards_edges;
|
||||
stats.facets_reversed + stats.backwards_edges;
|
||||
if (errors > 0) {
|
||||
wxString tooltip = format_wxstr(_L_PLURAL("Auto-repaired %1$d error", "Auto-repaired %1$d errors", errors), errors);
|
||||
p->object_info->info_manifold->SetLabel(tooltip);
|
||||
|
|
@ -1147,8 +1147,6 @@ void Sidebar::show_info_sizer()
|
|||
tooltip += format_wxstr(_L_PLURAL("%1$d edge fixed", "%1$d edges fixed", stats.edges_fixed), stats.edges_fixed) + ", ";
|
||||
if (stats.facets_removed > 0)
|
||||
tooltip += format_wxstr(_L_PLURAL("%1$d facet removed", "%1$d facets removed", stats.facets_removed), stats.facets_removed) + ", ";
|
||||
if (stats.facets_added > 0)
|
||||
tooltip += format_wxstr(_L_PLURAL("%1$d facet added", "%1$d facets added", stats.facets_added), stats.facets_added) + ", ";
|
||||
if (stats.facets_reversed > 0)
|
||||
tooltip += format_wxstr(_L_PLURAL("%1$d facet reversed", "%1$d facets reversed", stats.facets_reversed), stats.facets_reversed) + ", ";
|
||||
if (stats.backwards_edges > 0)
|
||||
|
|
@ -1501,7 +1499,7 @@ struct Plater::priv
|
|||
GLToolbar view_toolbar;
|
||||
GLToolbar collapse_toolbar;
|
||||
Preview *preview;
|
||||
std::shared_ptr<NotificationManager> notification_manager;
|
||||
std::unique_ptr<NotificationManager> notification_manager;
|
||||
|
||||
ProjectDirtyStateManager dirty_state;
|
||||
|
||||
|
|
@ -1516,16 +1514,19 @@ struct Plater::priv
|
|||
{
|
||||
priv *m;
|
||||
size_t m_arrange_id, m_fill_bed_id, m_rotoptimize_id, m_sla_import_id;
|
||||
std::shared_ptr<NotificationProgressIndicator> m_pri;
|
||||
|
||||
void before_start() override { m->background_process.stop(); }
|
||||
|
||||
public:
|
||||
Jobs(priv *_m) : m(_m)
|
||||
Jobs(priv *_m) :
|
||||
m(_m),
|
||||
m_pri{std::make_shared<NotificationProgressIndicator>(m->notification_manager.get())}
|
||||
{
|
||||
m_arrange_id = add_job(std::make_unique<ArrangeJob>(m->notification_manager, m->q));
|
||||
m_fill_bed_id = add_job(std::make_unique<FillBedJob>(m->notification_manager, m->q));
|
||||
m_rotoptimize_id = add_job(std::make_unique<RotoptimizeJob>(m->notification_manager, m->q));
|
||||
m_sla_import_id = add_job(std::make_unique<SLAImportJob>(m->notification_manager, m->q));
|
||||
m_arrange_id = add_job(std::make_unique<ArrangeJob>(m_pri, m->q));
|
||||
m_fill_bed_id = add_job(std::make_unique<FillBedJob>(m_pri, m->q));
|
||||
m_rotoptimize_id = add_job(std::make_unique<RotoptimizeJob>(m_pri, m->q));
|
||||
m_sla_import_id = add_job(std::make_unique<SLAImportJob>(m_pri, m->q));
|
||||
}
|
||||
|
||||
void arrange()
|
||||
|
|
@ -1849,7 +1850,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
|||
"support_material_contact_distance", "support_material_bottom_contact_distance", "raft_layers"
|
||||
}))
|
||||
, sidebar(new Sidebar(q))
|
||||
, notification_manager(std::make_shared<NotificationManager>(q))
|
||||
, notification_manager(std::make_unique<NotificationManager>(q))
|
||||
, m_ui_jobs(this)
|
||||
, delayed_scene_refresh(false)
|
||||
, view_toolbar(GLToolbar::Radio, "View")
|
||||
|
|
@ -2544,16 +2545,14 @@ std::vector<size_t> Plater::priv::load_model_objects(const ModelObjectPtrs& mode
|
|||
if (max_ratio > 10000) {
|
||||
// the size of the object is too big -> this could lead to overflow when moving to clipper coordinates,
|
||||
// so scale down the mesh
|
||||
double inv = 1. / max_ratio;
|
||||
object->scale_mesh_after_creation(inv * Vec3d::Ones());
|
||||
object->scale_mesh_after_creation(1. / max_ratio);
|
||||
object->origin_translation = Vec3d::Zero();
|
||||
object->center_around_origin();
|
||||
scaled_down = true;
|
||||
break;
|
||||
}
|
||||
else if (max_ratio > 5) {
|
||||
const Vec3d inverse = 1.0 / max_ratio * Vec3d::Ones();
|
||||
instance->set_scaling_factor(inverse.cwiseProduct(instance->get_scaling_factor()));
|
||||
instance->set_scaling_factor(instance->get_scaling_factor() / max_ratio);
|
||||
scaled_down = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -5587,11 +5586,9 @@ void Plater::export_stl(bool extended, bool selection_only)
|
|||
for (const ModelVolume *v : mo->volumes)
|
||||
if (v->is_model_part()) {
|
||||
TriangleMesh vol_mesh(v->mesh());
|
||||
vol_mesh.repair();
|
||||
vol_mesh.transform(v->get_matrix(), true);
|
||||
mesh.merge(vol_mesh);
|
||||
}
|
||||
mesh.repair();
|
||||
if (instances) {
|
||||
TriangleMesh vols_mesh(mesh);
|
||||
mesh = TriangleMesh();
|
||||
|
|
@ -5601,7 +5598,6 @@ void Plater::export_stl(bool extended, bool selection_only)
|
|||
mesh.merge(m);
|
||||
}
|
||||
}
|
||||
mesh.repair();
|
||||
return mesh;
|
||||
};
|
||||
|
||||
|
|
@ -6647,9 +6643,14 @@ Mouse3DController& Plater::get_mouse3d_controller()
|
|||
return p->mouse3d_controller;
|
||||
}
|
||||
|
||||
std::shared_ptr<NotificationManager> Plater::get_notification_manager()
|
||||
NotificationManager * Plater::get_notification_manager()
|
||||
{
|
||||
return p->notification_manager;
|
||||
return p->notification_manager.get();
|
||||
}
|
||||
|
||||
const NotificationManager * Plater::get_notification_manager() const
|
||||
{
|
||||
return p->notification_manager.get();
|
||||
}
|
||||
|
||||
void Plater::init_notification_manager()
|
||||
|
|
|
|||
|
|
@ -358,7 +358,9 @@ public:
|
|||
void set_bed_shape() const;
|
||||
void set_bed_shape(const Pointfs& shape, const std::string& custom_texture, const std::string& custom_model, bool force_as_custom = false) const;
|
||||
|
||||
std::shared_ptr<NotificationManager> get_notification_manager();
|
||||
NotificationManager * get_notification_manager();
|
||||
const NotificationManager * get_notification_manager() const;
|
||||
|
||||
void init_notification_manager();
|
||||
|
||||
void bring_instance_forward();
|
||||
|
|
|
|||
|
|
@ -402,6 +402,7 @@ bool fix_model_by_win10_sdk_gui(ModelObject &model_object, int volume_idx, wxPro
|
|||
}
|
||||
for (size_t i = 0; i < volumes.size(); ++ i) {
|
||||
volumes[i]->set_mesh(std::move(meshes_repaired[i]));
|
||||
volumes[i]->calculate_convex_hull();
|
||||
volumes[i]->set_new_unique_id();
|
||||
}
|
||||
model_object.invalidate_bounding_box();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue