Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_custom_bed

This commit is contained in:
Enrico Turri 2019-07-22 11:26:02 +02:00
commit c1dee0e87d
28 changed files with 2042 additions and 2063 deletions

View file

@ -3348,36 +3348,24 @@ void GLCanvas3D::update_ui_from_settings()
arr::WipeTowerInfo GLCanvas3D::get_wipe_tower_info() const
GLCanvas3D::WipeTowerInfo GLCanvas3D::get_wipe_tower_info() const
{
arr::WipeTowerInfo wti;
WipeTowerInfo wti;
for (const GLVolume* vol : m_volumes.volumes) {
if (vol->is_wipe_tower) {
wti.is_wipe_tower = true;
wti.pos = Vec2d(m_config->opt_float("wipe_tower_x"),
wti.m_pos = Vec2d(m_config->opt_float("wipe_tower_x"),
m_config->opt_float("wipe_tower_y"));
wti.rotation = (M_PI/180.) * m_config->opt_float("wipe_tower_rotation_angle");
wti.m_rotation = (M_PI/180.) * m_config->opt_float("wipe_tower_rotation_angle");
const BoundingBoxf3& bb = vol->bounding_box();
wti.bb_size = Vec2d(bb.size()(0), bb.size()(1));
wti.m_bb_size = Vec2d(bb.size().x(), bb.size().y());
break;
}
}
return wti;
}
void GLCanvas3D::arrange_wipe_tower(const arr::WipeTowerInfo& wti) const
{
if (wti.is_wipe_tower) {
DynamicPrintConfig cfg;
cfg.opt<ConfigOptionFloat>("wipe_tower_x", true)->value = wti.pos(0);
cfg.opt<ConfigOptionFloat>("wipe_tower_y", true)->value = wti.pos(1);
cfg.opt<ConfigOptionFloat>("wipe_tower_rotation_angle", true)->value = (180./M_PI) * wti.rotation;
wxGetApp().get_tab(Preset::TYPE_PRINT)->load_config(cfg);
}
}
Linef3 GLCanvas3D::mouse_ray(const Point& mouse_pos)
{
float z0 = 0.0f;
@ -5660,5 +5648,14 @@ const SLAPrint* GLCanvas3D::sla_print() const
return (m_process == nullptr) ? nullptr : m_process->sla_print();
}
void GLCanvas3D::WipeTowerInfo::apply_wipe_tower() const
{
DynamicPrintConfig cfg;
cfg.opt<ConfigOptionFloat>("wipe_tower_x", true)->value = m_pos(X);
cfg.opt<ConfigOptionFloat>("wipe_tower_y", true)->value = m_pos(Y);
cfg.opt<ConfigOptionFloat>("wipe_tower_rotation_angle", true)->value = (180./M_PI) * m_rotation;
wxGetApp().get_tab(Preset::TYPE_PRINT)->load_config(cfg);
}
} // namespace GUI
} // namespace Slic3r