This commit is contained in:
Vojtech Bubnik 2021-08-20 14:21:33 +02:00
commit c821b0a3ad
17 changed files with 36 additions and 30 deletions

View File

@ -56,4 +56,4 @@ FIND_PATH(DBUS_ARCH_INCLUDE_DIR
SET(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR}) SET(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR})
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DBUS REQUIRED_VARS DBUS_INCLUDE_DIRS DBUS_LIBRARIES) FIND_PACKAGE_HANDLE_STANDARD_ARGS(DBus REQUIRED_VARS DBUS_INCLUDE_DIRS DBUS_LIBRARIES)

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.8.12)
project(Shiny) project(Shiny)
cmake_minimum_required(VERSION 2.6)
add_library(Shiny STATIC add_library(Shiny STATIC
Shiny.h Shiny.h

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.8.12)
project(admesh) project(admesh)
cmake_minimum_required(VERSION 2.6)
add_library(admesh STATIC add_library(admesh STATIC
connect.cpp connect.cpp

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.8.12)
project(nowide) project(nowide)
cmake_minimum_required(VERSION 2.6)
add_library(nowide STATIC add_library(nowide STATIC
nowide/args.hpp nowide/args.hpp

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.8.12)
project(clipper) project(clipper)
cmake_minimum_required(VERSION 2.6)
add_library(clipper STATIC add_library(clipper STATIC
# We are using ClipperLib compiled as part of the libslic3r project using Slic3r::Point as its base type. # We are using ClipperLib compiled as part of the libslic3r project using Slic3r::Point as its base type.

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.8.12)
project(glu-libtess) project(glu-libtess)
cmake_minimum_required(VERSION 2.6)
add_library(glu-libtess STATIC add_library(glu-libtess STATIC
src/dict-list.h src/dict-list.h

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.8.12)
project(imgui) project(imgui)
cmake_minimum_required(VERSION 2.6)
add_library(imgui STATIC add_library(imgui STATIC
imconfig.h imconfig.h

View File

@ -1,5 +1,5 @@
project(libigl)
cmake_minimum_required(VERSION 3.0) cmake_minimum_required(VERSION 3.0)
project(libigl)
add_library(libigl INTERFACE) add_library(libigl INTERFACE)

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.8.12)
project(miniz) project(miniz)
cmake_minimum_required(VERSION 2.6)
add_library(miniz INTERFACE) add_library(miniz INTERFACE)

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.8.12)
project(semver) project(semver)
cmake_minimum_required(VERSION 2.6)
add_library(semver STATIC add_library(semver STATIC
semver.c semver.c

View File

@ -36,6 +36,8 @@ protected:
void on_exception(const std::exception_ptr &) override; void on_exception(const std::exception_ptr &) override;
void process() override;
public: public:
ArrangeJob(std::shared_ptr<ProgressIndicator> pri, Plater *plater) ArrangeJob(std::shared_ptr<ProgressIndicator> pri, Plater *plater)
: PlaterJob{std::move(pri), plater} : PlaterJob{std::move(pri), plater}
@ -46,8 +48,6 @@ public:
return int(m_selected.size() + m_unprintable.size()); return int(m_selected.size() + m_unprintable.size());
} }
void process() override;
void finalize() override; void finalize() override;
}; };

View File

@ -24,6 +24,7 @@ class FillBedJob : public PlaterJob
protected: protected:
void prepare() override; void prepare() override;
void process() override;
public: public:
FillBedJob(std::shared_ptr<ProgressIndicator> pri, Plater *plater) FillBedJob(std::shared_ptr<ProgressIndicator> pri, Plater *plater)
@ -35,8 +36,6 @@ public:
return m_status_range; return m_status_range;
} }
void process() override;
void finalize() override; void finalize() override;
}; };

View File

@ -50,10 +50,19 @@ protected:
// Launched just before start(), a job can use it to prepare internals // Launched just before start(), a job can use it to prepare internals
virtual void prepare() {} virtual void prepare() {}
// The method where the actual work of the job should be defined.
virtual void process() = 0;
// Launched when the job is finished. It refreshes the 3Dscene by def. // Launched when the job is finished. It refreshes the 3Dscene by def.
virtual void finalize() { m_finalized = true; } virtual void finalize() { m_finalized = true; }
virtual void on_exception(const std::exception_ptr &) {} // Exceptions occuring in process() are redirected from the worker thread
// into the main (UI) thread. This method is called from the main thread and
// can be overriden to handle these exceptions.
virtual void on_exception(const std::exception_ptr &eptr)
{
if (eptr) std::rethrow_exception(eptr);
}
public: public:
Job(std::shared_ptr<ProgressIndicator> pri); Job(std::shared_ptr<ProgressIndicator> pri);
@ -65,8 +74,6 @@ public:
Job &operator=(const Job &) = delete; Job &operator=(const Job &) = delete;
Job &operator=(Job &&) = delete; Job &operator=(Job &&) = delete;
virtual void process() = 0;
void start(); void start();
// To wait for the running job and join the threads. False is // To wait for the running job and join the threads. False is

View File

@ -48,6 +48,7 @@ class RotoptimizeJob : public PlaterJob
protected: protected:
void prepare() override; void prepare() override;
void process() override;
public: public:
@ -55,7 +56,6 @@ public:
: PlaterJob{std::move(pri), plater} : PlaterJob{std::move(pri), plater}
{} {}
void process() override;
void finalize() override; void finalize() override;
static constexpr size_t get_methods_count() { return std::size(Methods); } static constexpr size_t get_methods_count() { return std::size(Methods); }

View File

@ -10,18 +10,16 @@ class SLAImportJob : public PlaterJob {
std::unique_ptr<priv> p; std::unique_ptr<priv> p;
protected:
void prepare() override;
void process() override;
void finalize() override;
public: public:
SLAImportJob(std::shared_ptr<ProgressIndicator> pri, Plater *plater); SLAImportJob(std::shared_ptr<ProgressIndicator> pri, Plater *plater);
~SLAImportJob(); ~SLAImportJob();
void process() override;
void reset(); void reset();
protected:
void prepare() override;
void finalize() override;
}; };
}} // namespace Slic3r::GUI }} // namespace Slic3r::GUI

View File

@ -2334,7 +2334,9 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
else { else {
model = Slic3r::Model::read_from_file(path.string(), nullptr, nullptr, only_if(load_config, Model::LoadAttribute::CheckVersion)); model = Slic3r::Model::read_from_file(path.string(), nullptr, nullptr, only_if(load_config, Model::LoadAttribute::CheckVersion));
for (auto obj : model.objects) for (auto obj : model.objects)
if (obj->name.empty()) if (obj->name.empty() ||
obj->name.find_first_of("/") != std::string::npos) // When file is imported from Fusion360 the path containes "/" instead of "\\" (see https://github.com/prusa3d/PrusaSlicer/issues/6803)
// But read_from_file doesn't support that direction separator and as a result object name containes full path
obj->name = fs::path(obj->input_file).filename().string(); obj->name = fs::path(obj->input_file).filename().string();
} }
} catch (const ConfigurationError &e) { } catch (const ConfigurationError &e) {

View File

@ -1518,11 +1518,11 @@ void TabPrint::build()
optgroup->append_single_option_line("support_material_auto", category_path + "auto-generated-supports"); optgroup->append_single_option_line("support_material_auto", category_path + "auto-generated-supports");
optgroup->append_single_option_line("support_material_threshold", category_path + "overhang-threshold"); optgroup->append_single_option_line("support_material_threshold", category_path + "overhang-threshold");
optgroup->append_single_option_line("support_material_enforce_layers", category_path + "enforce-support-for-the-first"); optgroup->append_single_option_line("support_material_enforce_layers", category_path + "enforce-support-for-the-first");
optgroup->append_single_option_line("raft_first_layer_density", category_path + "raft-first-layer-density");
optgroup->append_single_option_line("raft_first_layer_expansion", category_path + "raft-first-layer-expansion");
optgroup = page->new_optgroup(L("Raft")); optgroup = page->new_optgroup(L("Raft"));
optgroup->append_single_option_line("raft_layers", category_path + "raft-layers"); optgroup->append_single_option_line("raft_layers", category_path + "raft-layers");
optgroup->append_single_option_line("raft_first_layer_density", category_path + "raft-first-layer-density");
optgroup->append_single_option_line("raft_first_layer_expansion", category_path + "raft-first-layer-expansion");
optgroup->append_single_option_line("raft_contact_distance"); optgroup->append_single_option_line("raft_contact_distance");
optgroup->append_single_option_line("raft_expansion"); optgroup->append_single_option_line("raft_expansion");