Fix finish job

Fix initial position
This commit is contained in:
Filip Sykala 2021-11-23 10:34:04 +01:00
parent 081a398cee
commit d624940b7a
4 changed files with 19 additions and 3 deletions

View File

@ -41,8 +41,9 @@ Slic3r::Polygon CameraUtils::create_hull2d(const Camera & camera,
const GLVolume &volume) const GLVolume &volume)
{ {
const indexed_triangle_set &its = volume.convex_hull()->its; const indexed_triangle_set &its = volume.convex_hull()->its;
const Transform3d &trafoMat = volume.get_instance_transformation() const Transform3d & trafoMat =
.get_matrix(); volume.get_instance_transformation().get_matrix() *
volume.get_volume_transformation().get_matrix();
std::vector<Vec3d> vertices; std::vector<Vec3d> vertices;
vertices.reserve(its.vertices.size()); vertices.reserve(its.vertices.size());
for (const Vec3f &vertex : its.vertices) for (const Vec3f &vertex : its.vertices)

View File

@ -336,6 +336,7 @@ void GLGizmoEmboss::on_set_state()
remove_notification_not_valid_font(); remove_notification_not_valid_font();
} else if (GLGizmoBase::m_state == GLGizmoBase::On) { } else if (GLGizmoBase::m_state == GLGizmoBase::On) {
if (!m_is_initialized) initialize(); if (!m_is_initialized) initialize();
set_fine_position();
// When add Text on empty plate, Create new object with volume // When add Text on empty plate, Create new object with volume
if (m_parent.get_selection().is_empty()) { if (m_parent.get_selection().is_empty()) {

View File

@ -16,6 +16,11 @@ using namespace GUI;
//EmbossJob::EmbossJob(): Job(std::make_shared<NotificationProgressIndicator>(wxGetApp().plater()->get_notification_manager())){} //EmbossJob::EmbossJob(): Job(std::make_shared<NotificationProgressIndicator>(wxGetApp().plater()->get_notification_manager())){}
EmbossJob::EmbossJob() : Job(std::make_shared<EmbossJob::Progress>()) {} EmbossJob::EmbossJob() : Job(std::make_shared<EmbossJob::Progress>()) {}
EmbossJob::~EmbossJob() {
Job::cancel();
Job::join();
}
void EmbossJob::restart(const Data &data) void EmbossJob::restart(const Data &data)
{ {
if (Job::is_running()) { if (Job::is_running()) {
@ -40,6 +45,7 @@ void EmbossJob::restart(const Data &data)
Job::start(); Job::start();
} }
} }
void EmbossJob::prepare() {} void EmbossJob::prepare() {}
void EmbossJob::process() { void EmbossJob::process() {

View File

@ -33,8 +33,16 @@ public:
// when volume_ptr == nullptr && object_idx < 0 than new object will be created // when volume_ptr == nullptr && object_idx < 0 than new object will be created
int object_idx; int object_idx;
}; };
EmbossJob(); EmbossJob();
~EmbossJob();// cancel work and join
void restart(const Data &data); void restart(const Data &data);
// do not allow Job::start
bool join(int timeout_ms = 0) { return Job::join(timeout_ms); };
bool is_running() const { return Job::is_running(); }
void cancel() { Job::cancel(); }
protected: 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() override; virtual void prepare() override;