Merge branch 'master' of https://github.com/Prusa3d/PrusaSlicer
This commit is contained in:
commit
27cc66eb54
@ -73,8 +73,8 @@ void AppConfig::set_defaults()
|
|||||||
if (get("custom_toolbar_size").empty())
|
if (get("custom_toolbar_size").empty())
|
||||||
set("custom_toolbar_size", "100");
|
set("custom_toolbar_size", "100");
|
||||||
|
|
||||||
if (get("camera_type").empty())
|
if (get("use_perspective_camera").empty())
|
||||||
set("camera_type", "1");
|
set("use_perspective_camera", "1");
|
||||||
|
|
||||||
// Remove legacy window positions/sizes
|
// Remove legacy window positions/sizes
|
||||||
erase("", "main_frame_maximized");
|
erase("", "main_frame_maximized");
|
||||||
|
@ -31,7 +31,7 @@ Camera::Camera()
|
|||||||
: phi(45.0f)
|
: phi(45.0f)
|
||||||
, requires_zoom_to_bed(false)
|
, requires_zoom_to_bed(false)
|
||||||
, inverted_phi(false)
|
, inverted_phi(false)
|
||||||
, m_type(Ortho)
|
, m_type(Perspective)
|
||||||
, m_target(Vec3d::Zero())
|
, m_target(Vec3d::Zero())
|
||||||
, m_theta(45.0f)
|
, m_theta(45.0f)
|
||||||
, m_zoom(1.0)
|
, m_zoom(1.0)
|
||||||
@ -61,20 +61,17 @@ void Camera::set_type(EType type)
|
|||||||
if (m_type != type)
|
if (m_type != type)
|
||||||
{
|
{
|
||||||
m_type = type;
|
m_type = type;
|
||||||
|
wxGetApp().app_config->set("use_perspective_camera", (m_type == Perspective) ? "1" : "0");
|
||||||
wxGetApp().app_config->set("camera_type", std::to_string(m_type));
|
|
||||||
wxGetApp().app_config->save();
|
wxGetApp().app_config->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Camera::set_type(const std::string& type)
|
void Camera::set_type(const std::string& type)
|
||||||
{
|
{
|
||||||
if (!type.empty() && (type != "1"))
|
if (type == "1")
|
||||||
{
|
set_type(Perspective);
|
||||||
unsigned char type_id = atoi(type.c_str());
|
else
|
||||||
if (((unsigned char)Ortho < type_id) && (type_id < (unsigned char)Num_types))
|
set_type(Ortho);
|
||||||
set_type((Camera::EType)type_id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Camera::select_next_type()
|
void Camera::select_next_type()
|
||||||
|
@ -49,6 +49,7 @@ public:
|
|||||||
EType get_type() const { return m_type; }
|
EType get_type() const { return m_type; }
|
||||||
std::string get_type_as_string() const;
|
std::string get_type_as_string() const;
|
||||||
void set_type(EType type);
|
void set_type(EType type);
|
||||||
|
// valid values for type: "0" -> ortho, "1" -> perspective
|
||||||
void set_type(const std::string& type);
|
void set_type(const std::string& type);
|
||||||
void select_next_type();
|
void select_next_type();
|
||||||
|
|
||||||
|
@ -3312,6 +3312,9 @@ void GLCanvas3D::handle_sidebar_focus_event(const std::string& opt_key, bool foc
|
|||||||
|
|
||||||
void GLCanvas3D::update_ui_from_settings()
|
void GLCanvas3D::update_ui_from_settings()
|
||||||
{
|
{
|
||||||
|
m_camera.set_type(wxGetApp().app_config->get("use_perspective_camera"));
|
||||||
|
m_dirty = true;
|
||||||
|
|
||||||
#if ENABLE_RETINA_GL
|
#if ENABLE_RETINA_GL
|
||||||
const float orig_scaling = m_retina_helper->get_scale_factor();
|
const float orig_scaling = m_retina_helper->get_scale_factor();
|
||||||
|
|
||||||
|
@ -313,6 +313,12 @@ Preview::~Preview()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Preview::set_as_dirty()
|
||||||
|
{
|
||||||
|
if (m_canvas != nullptr)
|
||||||
|
m_canvas->set_as_dirty();
|
||||||
|
}
|
||||||
|
|
||||||
void Preview::set_number_extruders(unsigned int number_extruders)
|
void Preview::set_number_extruders(unsigned int number_extruders)
|
||||||
{
|
{
|
||||||
if (m_number_extruders != number_extruders)
|
if (m_number_extruders != number_extruders)
|
||||||
|
@ -110,6 +110,8 @@ public:
|
|||||||
wxGLCanvas* get_wxglcanvas() { return m_canvas_widget; }
|
wxGLCanvas* get_wxglcanvas() { return m_canvas_widget; }
|
||||||
GLCanvas3D* get_canvas3d() { return m_canvas; }
|
GLCanvas3D* get_canvas3d() { return m_canvas; }
|
||||||
|
|
||||||
|
void set_as_dirty();
|
||||||
|
|
||||||
void set_number_extruders(unsigned int number_extruders);
|
void set_number_extruders(unsigned int number_extruders);
|
||||||
void set_canvas_as_dirty();
|
void set_canvas_as_dirty();
|
||||||
void set_enabled(bool enabled);
|
void set_enabled(bool enabled);
|
||||||
|
@ -1774,7 +1774,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
|||||||
set_current_panel(view3D);
|
set_current_panel(view3D);
|
||||||
|
|
||||||
// updates camera type from .ini file
|
// updates camera type from .ini file
|
||||||
camera.set_type(get_config("camera_type"));
|
camera.set_type(get_config("use_perspective_camera"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Plater::priv::update(bool force_full_scene_refresh)
|
void Plater::priv::update(bool force_full_scene_refresh)
|
||||||
@ -1842,10 +1842,8 @@ void Plater::priv::update_ui_from_settings()
|
|||||||
// $self->{buttons_sizer}->Layout;
|
// $self->{buttons_sizer}->Layout;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
#if ENABLE_RETINA_GL
|
|
||||||
view3D->get_canvas3d()->update_ui_from_settings();
|
view3D->get_canvas3d()->update_ui_from_settings();
|
||||||
preview->get_canvas3d()->update_ui_from_settings();
|
preview->get_canvas3d()->update_ui_from_settings();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ProgressStatusBar* Plater::priv::statusbar()
|
ProgressStatusBar* Plater::priv::statusbar()
|
||||||
|
@ -28,7 +28,7 @@ void PreferencesDialog::build()
|
|||||||
m_icon_size_sizer->ShowItems(boost::any_cast<bool>(value));
|
m_icon_size_sizer->ShowItems(boost::any_cast<bool>(value));
|
||||||
this->layout();
|
this->layout();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
// $optgroup->append_single_option_line(Slic3r::GUI::OptionsGroup::Option->new(
|
// $optgroup->append_single_option_line(Slic3r::GUI::OptionsGroup::Option->new(
|
||||||
@ -97,7 +97,7 @@ void PreferencesDialog::build()
|
|||||||
option = Option (def,"show_incompatible_presets");
|
option = Option (def,"show_incompatible_presets");
|
||||||
m_optgroup->append_single_option_line(option);
|
m_optgroup->append_single_option_line(option);
|
||||||
|
|
||||||
// TODO: remove?
|
// TODO: remove?
|
||||||
def.label = L("Use legacy OpenGL 1.1 rendering");
|
def.label = L("Use legacy OpenGL 1.1 rendering");
|
||||||
def.type = coBool;
|
def.type = coBool;
|
||||||
def.tooltip = L("If you have rendering issues caused by a buggy OpenGL 2.0 driver, "
|
def.tooltip = L("If you have rendering issues caused by a buggy OpenGL 2.0 driver, "
|
||||||
@ -117,6 +117,13 @@ void PreferencesDialog::build()
|
|||||||
m_optgroup->append_single_option_line(option);
|
m_optgroup->append_single_option_line(option);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
def.label = L("Use perspective camera");
|
||||||
|
def.type = coBool;
|
||||||
|
def.tooltip = L("If enabled, use perspective camera. If not enabled, use orthographic camera.");
|
||||||
|
def.set_default_value(new ConfigOptionBool{ app_config->get("use_perspective_camera") == "1" });
|
||||||
|
option = Option(def, "use_perspective_camera");
|
||||||
|
m_optgroup->append_single_option_line(option);
|
||||||
|
|
||||||
def.label = L("Use custom size for toolbar icons");
|
def.label = L("Use custom size for toolbar icons");
|
||||||
def.type = coBool;
|
def.type = coBool;
|
||||||
def.tooltip = L("If enabled, you can change size of toolbar icons manually.");
|
def.tooltip = L("If enabled, you can change size of toolbar icons manually.");
|
||||||
|
Loading…
Reference in New Issue
Block a user