This commit is contained in:
Filip Sykala - NTB T15p 2023-01-17 15:25:06 +01:00
commit 96519bf259
12 changed files with 463 additions and 13 deletions

View file

@ -445,8 +445,11 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive:
f->angle = surface_fill.params.angle;
f->adapt_fill_octree = (surface_fill.params.pattern == ipSupportCubic) ? support_fill_octree : adaptive_fill_octree;
if (surface_fill.params.pattern == ipLightning)
dynamic_cast<FillLightning::Filler*>(f.get())->generator = lightning_generator;
if (surface_fill.params.pattern == ipLightning) {
auto *lf = dynamic_cast<FillLightning::Filler*>(f.get());
lf->generator = lightning_generator;
lf->num_raft_layers = this->object()->slicing_parameters().raft_layers();
}
if (perimeter_generator.value == PerimeterGeneratorType::Arachne && surface_fill.params.pattern == ipConcentric) {
FillConcentric *fill_concentric = dynamic_cast<FillConcentric *>(f.get());

View file

@ -13,7 +13,7 @@ void Filler::_fill_surface_single(
ExPolygon expolygon,
Polylines &polylines_out)
{
const Layer &layer = generator->getTreesForLayer(this->layer_id);
const Layer &layer = generator->getTreesForLayer(this->layer_id - this->num_raft_layers);
Polylines fill_lines = layer.convertToLines(to_polygons(expolygon), scaled<coord_t>(0.5 * this->spacing - this->overlap));
if (params.dont_connect() || fill_lines.size() <= 1) {

View file

@ -22,6 +22,7 @@ public:
~Filler() override = default;
Generator *generator { nullptr };
size_t num_raft_layers { 0 };
protected:
Fill* clone() const override { return new Filler(*this); }

View file

@ -555,8 +555,8 @@ void MenuFactory::append_menu_items_add_volume(wxMenu* menu)
menu->Destroy(range_id);
if (wxGetApp().get_mode() == comSimple) {
append_menu_item_add_text(menu, ModelVolumeType::MODEL_PART, false);
append_menu_item_add_text(menu, ModelVolumeType::NEGATIVE_VOLUME, false);
//append_menu_item_add_text(menu, ModelVolumeType::MODEL_PART, false);
//append_menu_item_add_text(menu, ModelVolumeType::NEGATIVE_VOLUME, false);
append_menu_item(menu, wxID_ANY, _(ADD_VOLUME_MENU_ITEMS[int(ModelVolumeType::SUPPORT_ENFORCER)].first), "",
[](wxCommandEvent&) { obj_list()->load_generic_subobject(L("Box"), ModelVolumeType::SUPPORT_ENFORCER); },

View file

@ -2480,6 +2480,9 @@ bool ObjectList::is_splittable(bool to_objects)
return false;
}
if (wxGetApp().get_mode() == comSimple)
return false; // suppress to split to parts for simple mode
ModelVolume* volume;
if (!get_volume_by_item(item, volume) || !volume)
return false;

View file

@ -860,6 +860,9 @@ void GLGizmoEmboss::on_set_state()
if (m_volume == nullptr) {
// reopen gizmo when new object is created
GLGizmoBase::m_state = GLGizmoBase::Off;
if (wxGetApp().get_mode() == comSimple)
// It's impossible to add a part in simple mode
return;
// start creating new object
create_volume(ModelVolumeType::MODEL_PART);
}

View file

@ -124,9 +124,14 @@ static const std::pair<unsigned int, unsigned int> THUMBNAIL_SIZE_3MF = { 256, 2
namespace Slic3r {
namespace GUI {
// Trigger Plater::schedule_background_process().
wxDEFINE_EVENT(EVT_SCHEDULE_BACKGROUND_PROCESS, SimpleEvent);
// BackgroundSlicingProcess updates UI with slicing progress: Status bar / progress bar has to be updated, possibly scene has to be refreshed,
// see PrintBase::SlicingStatus for the content of the message.
wxDEFINE_EVENT(EVT_SLICING_UPDATE, SlicingStatusEvent);
// FDM slicing finished, but G-code was not exported yet. Initial G-code preview shall be displayed by the UI.
wxDEFINE_EVENT(EVT_SLICING_COMPLETED, wxCommandEvent);
// BackgroundSlicingProcess finished either with success or error.
wxDEFINE_EVENT(EVT_PROCESS_COMPLETED, SlicingProcessCompletedEvent);
wxDEFINE_EVENT(EVT_EXPORT_BEGAN, wxCommandEvent);
@ -2636,7 +2641,6 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
}
if (model.looks_like_multipart_object()) {
//wxMessageDialog msg_dlg(q, _L(
MessageDialog msg_dlg(q, _L(
"This file contains several objects positioned at multiple heights.\n"
"Instead of considering them as multiple objects, should \n"
@ -2647,10 +2651,9 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
}
}
}
else if ((wxGetApp().get_mode() == comSimple) && (type_3mf || type_any_amf) && model_has_advanced_features(model)) {
//wxMessageDialog msg_dlg(q, _L("This file cannot be loaded in a simple mode. Do you want to switch to an advanced mode?")+"\n",
if ((wxGetApp().get_mode() == comSimple) && (type_3mf || type_any_amf) && model_has_advanced_features(model)) {
MessageDialog msg_dlg(q, _L("This file cannot be loaded in a simple mode. Do you want to switch to an advanced mode?")+"\n",
_L("Detected advanced data"), wxICON_WARNING | wxYES | wxNO);
_L("Detected advanced data"), wxICON_WARNING | wxYES | wxCANCEL);
if (msg_dlg.ShowModal() == wxID_YES) {
Slic3r::GUI::wxGetApp().save_mode(comAdvanced);
view3D->set_as_dirty();
@ -3350,10 +3353,8 @@ unsigned int Plater::priv::update_background_process(bool force_validation, bool
if (invalidated != Print::APPLY_STATUS_UNCHANGED && was_running && ! this->background_process.running() &&
(return_state & UPDATE_BACKGROUND_PROCESS_RESTART) == 0) {
// The background processing was killed and it will not be restarted.
wxCommandEvent evt(EVT_PROCESS_COMPLETED);
evt.SetInt(-1);
// Post the "canceled" callback message, so that it will be processed after any possible pending status bar update messages.
wxQueueEvent(GUI::wxGetApp().mainframe->m_plater, evt.Clone());
wxQueueEvent(GUI::wxGetApp().mainframe->m_plater, new SlicingProcessCompletedEvent(EVT_PROCESS_COMPLETED, 0, SlicingProcessCompletedEvent::Cancelled, std::exception_ptr{}));
}
if ((return_state & UPDATE_BACKGROUND_PROCESS_INVALID) != 0)
@ -6153,7 +6154,7 @@ bool Plater::load_files(const wxArrayString& filenames, bool delete_after_load/*
break;
}
case ProjectDropDialog::LoadType::LoadGeometry: {
Plater::TakeSnapshot snapshot(this, _L("Import Object"));
// Plater::TakeSnapshot snapshot(this, _L("Import Object"));
load_files({ *it }, true, false);
break;
}