mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-19 06:41:14 -06:00
Added mirroring factors to .amf import/export
This commit is contained in:
parent
68f77f1031
commit
126f0e5073
5 changed files with 104 additions and 21 deletions
|
@ -3432,7 +3432,6 @@ int GLCanvas3D::get_in_object_volume_id(int scene_vol_idx) const
|
|||
#if ENABLE_EXTENDED_SELECTION
|
||||
void GLCanvas3D::mirror_selection(Axis axis)
|
||||
{
|
||||
m_regenerate_volumes = false;
|
||||
m_selection.mirror(axis);
|
||||
_on_mirror();
|
||||
wxGetApp().obj_manipul()->update_settings_value(m_selection);
|
||||
|
@ -3457,7 +3456,12 @@ void GLCanvas3D::reload_scene(bool force)
|
|||
|
||||
#if ENABLE_EXTENDED_SELECTION
|
||||
if (m_regenerate_volumes)
|
||||
{
|
||||
reset_volumes();
|
||||
|
||||
// to update the toolbar
|
||||
post_event(SimpleEvent(EVT_GLCANVAS_OBJECT_SELECT));
|
||||
}
|
||||
#endif // ENABLE_EXTENDED_SELECTION
|
||||
|
||||
set_bed_shape(dynamic_cast<const ConfigOptionPoints*>(m_config->option("bed_shape"))->values);
|
||||
|
@ -3477,9 +3481,6 @@ void GLCanvas3D::reload_scene(bool force)
|
|||
{
|
||||
load_object(*m_model, obj_idx);
|
||||
}
|
||||
|
||||
// to update the toolbar
|
||||
post_event(SimpleEvent(EVT_GLCANVAS_OBJECT_SELECT));
|
||||
}
|
||||
|
||||
update_gizmos_data();
|
||||
|
@ -3858,7 +3859,6 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
|||
case Gizmos::Scale:
|
||||
{
|
||||
#if ENABLE_EXTENDED_SELECTION
|
||||
m_regenerate_volumes = false;
|
||||
m_selection.scale(m_gizmos.get_scale());
|
||||
_on_scale();
|
||||
#else
|
||||
|
@ -3875,7 +3875,6 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
|||
case Gizmos::Rotate:
|
||||
{
|
||||
#if ENABLE_EXTENDED_SELECTION
|
||||
m_regenerate_volumes = false;
|
||||
m_selection.rotate(m_gizmos.get_rotation());
|
||||
_on_rotate();
|
||||
#else
|
||||
|
@ -3958,7 +3957,6 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
|||
if (m_gizmos.get_current_type() == Gizmos::Flatten) {
|
||||
// Rotate the object so the normal points downward:
|
||||
#if ENABLE_EXTENDED_SELECTION
|
||||
m_regenerate_volumes = false;
|
||||
m_selection.rotate(m_gizmos.get_flattening_rotation());
|
||||
_on_flatten();
|
||||
wxGetApp().obj_manipul()->update_settings_value(m_selection);
|
||||
|
@ -4397,7 +4395,6 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
|||
case Gizmos::Scale:
|
||||
{
|
||||
#if ENABLE_EXTENDED_SELECTION
|
||||
m_regenerate_volumes = false;
|
||||
_on_scale();
|
||||
#endif // ENABLE_EXTENDED_SELECTION
|
||||
break;
|
||||
|
@ -4405,7 +4402,6 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
|||
case Gizmos::Rotate:
|
||||
{
|
||||
#if ENABLE_EXTENDED_SELECTION
|
||||
m_regenerate_volumes = false;
|
||||
_on_rotate();
|
||||
#else
|
||||
post_event(Vec3dEvent(EVT_GIZMO_ROTATE, m_gizmos.get_rotation()));
|
||||
|
|
|
@ -28,6 +28,7 @@ CheckboxFileDialog::ExtraPanel::ExtraPanel(wxWindow *parent)
|
|||
|
||||
auto* sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
cbox = new wxCheckBox(this, wxID_ANY, checkbox_label);
|
||||
cbox->SetValue(true);
|
||||
sizer->AddSpacer(5);
|
||||
sizer->Add(this->cbox, 0, wxEXPAND | wxALL, 5);
|
||||
SetSizer(sizer);
|
||||
|
|
|
@ -300,7 +300,7 @@ void MainFrame::init_menubar()
|
|||
append_menu_item(m_plater_menu, wxID_ANY, _(L("Export plate as STL...")), _(L("Export current plate as STL")),
|
||||
[this](wxCommandEvent&){ /*m_plater->export_stl(); */}, "brick_go.png");
|
||||
append_menu_item(m_plater_menu, wxID_ANY, _(L("Export plate as AMF...")), _(L("Export current plate as AMF")),
|
||||
[this](wxCommandEvent&){ /*m_plater->export_amf();*/ }, "brick_go.png");
|
||||
[this](wxCommandEvent&){ m_plater->export_amf(); }, "brick_go.png");
|
||||
append_menu_item(m_plater_menu, wxID_ANY, _(L("Export plate as 3MF...")), _(L("Export current plate as 3MF")),
|
||||
[this](wxCommandEvent&){ m_plater->export_3mf(); }, "brick_go.png");
|
||||
}
|
||||
|
|
|
@ -850,7 +850,9 @@ private:
|
|||
bool layers_height_allowed() const;
|
||||
bool can_delete_all() const;
|
||||
bool can_arrange() const;
|
||||
#if ENABLE_MIRROR
|
||||
bool can_mirror() const;
|
||||
#endif // ENABLE_MIRROR
|
||||
#endif // ENABLE_EXTENDED_SELECTION
|
||||
};
|
||||
|
||||
|
@ -1256,14 +1258,17 @@ std::unique_ptr<CheckboxFileDialog> Plater::priv::get_export_file(GUI::FileType
|
|||
wxString wildcard;
|
||||
switch (file_type) {
|
||||
case FT_STL:
|
||||
case FT_AMF:
|
||||
case FT_3MF:
|
||||
wildcard = file_wildcards[FT_STL];
|
||||
break;
|
||||
|
||||
break;
|
||||
case FT_AMF:
|
||||
wildcard = file_wildcards[FT_AMF];
|
||||
break;
|
||||
case FT_3MF:
|
||||
wildcard = file_wildcards[FT_3MF];
|
||||
break;
|
||||
default:
|
||||
wildcard = file_wildcards[FT_MODEL];
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
fs::path output_file(print.output_filepath(std::string()));
|
||||
|
@ -1899,6 +1904,7 @@ bool Plater::priv::init_object_menu()
|
|||
|
||||
object_menu.AppendSeparator();
|
||||
|
||||
#if ENABLE_MIRROR
|
||||
wxMenu* mirror_menu = new wxMenu();
|
||||
if (mirror_menu == nullptr)
|
||||
return false;
|
||||
|
@ -1911,6 +1917,7 @@ bool Plater::priv::init_object_menu()
|
|||
[this](wxCommandEvent&){ mirror(Z); }, "bullet_blue.png", &object_menu);
|
||||
|
||||
wxMenuItem* item_mirror = append_submenu(&object_menu, mirror_menu, wxID_ANY, _(L("Mirror")), _(L("Mirror the selected object")));
|
||||
#endif // ENABLE_MIRROR
|
||||
|
||||
wxMenuItem* item_split = append_menu_item(&object_menu, wxID_ANY, _(L("Split")), _(L("Split the selected object into individual parts")),
|
||||
[this](wxCommandEvent&){ split_object(); }, "shape_ungroup.png");
|
||||
|
@ -1919,7 +1926,9 @@ bool Plater::priv::init_object_menu()
|
|||
// ui updates needs to be binded to the parent panel
|
||||
if (q != nullptr)
|
||||
{
|
||||
#if ENABLE_MIRROR
|
||||
q->Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable(can_mirror()); }, item_mirror->GetId());
|
||||
#endif // ENABLE_MIRROR
|
||||
q->Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable(can_delete_object()); }, item_delete->GetId());
|
||||
q->Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable(can_increase_instances()); }, item_increase->GetId());
|
||||
q->Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable(can_decrease_instances()); }, item_decrease->GetId());
|
||||
|
@ -1976,10 +1985,12 @@ bool Plater::priv::can_arrange() const
|
|||
return !model.objects.empty();
|
||||
}
|
||||
|
||||
#if ENABLE_MIRROR
|
||||
bool Plater::priv::can_mirror() const
|
||||
{
|
||||
return get_selection().is_from_single_instance();
|
||||
}
|
||||
#endif // ENABLE_MIRROR
|
||||
#endif // ENABLE_EXTENDED_SELECTION
|
||||
|
||||
// Plater / Public
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue