mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Merge branch 'master' of https://github.com/prusa3d/Slic3r into objects_centering
This commit is contained in:
commit
9a5d7a98a6
9 changed files with 130 additions and 32 deletions
|
@ -856,6 +856,14 @@ bool GLCanvas3D::LayersEditing::init(const std::string& vertex_shader_filename,
|
|||
return true;
|
||||
}
|
||||
|
||||
void GLCanvas3D::LayersEditing::set_config(const DynamicPrintConfig* config)
|
||||
{
|
||||
m_config = config;
|
||||
delete m_slicing_parameters;
|
||||
m_slicing_parameters = nullptr;
|
||||
m_layers_texture.valid = false;
|
||||
}
|
||||
|
||||
void GLCanvas3D::LayersEditing::select_object(const Model &model, int object_id)
|
||||
{
|
||||
const ModelObject *model_object_new = (object_id >= 0) ? model.objects[object_id] : nullptr;
|
||||
|
@ -864,6 +872,7 @@ void GLCanvas3D::LayersEditing::select_object(const Model &model, int object_id)
|
|||
m_layer_height_profile_modified = false;
|
||||
delete m_slicing_parameters;
|
||||
m_slicing_parameters = nullptr;
|
||||
m_layers_texture.valid = false;
|
||||
}
|
||||
this->last_object_id = object_id;
|
||||
m_model_object = model_object_new;
|
||||
|
@ -1167,6 +1176,13 @@ void GLCanvas3D::LayersEditing::adjust_layer_height_profile()
|
|||
m_layers_texture.valid = false;
|
||||
}
|
||||
|
||||
void GLCanvas3D::LayersEditing::reset_layer_height_profile()
|
||||
{
|
||||
const_cast<ModelObject*>(m_model_object)->layer_height_profile.clear();
|
||||
m_layer_height_profile.clear();
|
||||
m_layers_texture.valid = false;
|
||||
}
|
||||
|
||||
void GLCanvas3D::LayersEditing::generate_layer_height_texture()
|
||||
{
|
||||
this->update_slicing_parameters();
|
||||
|
@ -5024,7 +5040,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
|||
if (evt.LeftDown())
|
||||
{
|
||||
// A volume is selected and the mouse is inside the reset button. Reset the ModelObject's layer height profile.
|
||||
m_model->objects[layer_editing_object_idx]->layer_height_profile.clear();
|
||||
m_layers_editing.reset_layer_height_profile();
|
||||
// Index 2 means no editing, just wait for mouse up event.
|
||||
m_layers_editing.state = LayersEditing::Completed;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue