mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-24 09:11:23 -06:00
Fixed conflicts after merge with master
This commit is contained in:
commit
efe29b3c2d
13 changed files with 1581 additions and 1934 deletions
|
|
@ -2047,7 +2047,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
|
|||
if (it->new_geometry())
|
||||
instances[istep].emplace_back(std::pair<size_t, size_t>(instance_idx, print_instance_idx));
|
||||
else
|
||||
// Recycling an old GLVolume. Update the Object/Instance indices into the current Model.
|
||||
// Recycling an old GLVolume. Update the Object/Instance indices into the current Model.
|
||||
m_volumes.volumes[it->volume_idx]->composite_id = GLVolume::CompositeID(object_idx, m_volumes.volumes[it->volume_idx]->volume_idx(), instance_idx);
|
||||
}
|
||||
}
|
||||
|
|
@ -5523,6 +5523,7 @@ void GLCanvas3D::_load_sla_shells()
|
|||
v.set_instance_offset(unscale(instance.shift(0), instance.shift(1), 0));
|
||||
v.set_instance_rotation(Vec3d(0.0, 0.0, (double)instance.rotation));
|
||||
v.set_instance_mirror(X, object.is_left_handed() ? -1. : 1.);
|
||||
v.set_convex_hull(new TriangleMesh(std::move(mesh.convex_hull_3d())), true);
|
||||
};
|
||||
|
||||
// adds objects' volumes
|
||||
|
|
@ -5537,7 +5538,7 @@ void GLCanvas3D::_load_sla_shells()
|
|||
if (obj->is_step_done(slaposSupportTree) && obj->has_mesh(slaposSupportTree))
|
||||
add_volume(*obj, -int(slaposSupportTree), instance, obj->support_mesh(), GLVolume::SLA_SUPPORT_COLOR, true);
|
||||
if (obj->is_step_done(slaposBasePool) && obj->has_mesh(slaposBasePool))
|
||||
add_volume(*obj, -int(slaposBasePool), instance, obj->pad_mesh(), GLVolume::SLA_PAD_COLOR, true);
|
||||
add_volume(*obj, -int(slaposBasePool), instance, obj->pad_mesh(), GLVolume::SLA_PAD_COLOR, false);
|
||||
}
|
||||
double shift_z = obj->get_current_elevation();
|
||||
for (unsigned int i = initial_volumes_count; i < m_volumes.volumes.size(); ++ i) {
|
||||
|
|
@ -5660,7 +5661,7 @@ void GLCanvas3D::_update_sla_shells_outside_state()
|
|||
|
||||
for (GLVolume* volume : m_volumes.volumes)
|
||||
{
|
||||
volume->is_outside = ((print_volume.radius() > 0.0) && volume->is_sla_support()) ? !print_volume.contains(volume->transformed_convex_hull_bounding_box()) : false;
|
||||
volume->is_outside = ((print_volume.radius() > 0.0) && volume->shader_outside_printer_detection_enabled) ? !print_volume.contains(volume->transformed_convex_hull_bounding_box()) : false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1284,13 +1284,11 @@ void ObjectList::append_menu_item_delete(wxMenu* menu)
|
|||
[this](wxCommandEvent&) { remove(); }, "", menu);
|
||||
}
|
||||
|
||||
#if ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
void ObjectList::append_menu_item_scale_selection_to_fit_print_volume(wxMenu* menu)
|
||||
{
|
||||
append_menu_item(menu, wxID_ANY, _(L("Scale to print volume")), _(L("Scale the selected object to fit the print volume")),
|
||||
[this](wxCommandEvent&) { wxGetApp().plater()->scale_selection_to_fit_print_volume(); }, "", menu);
|
||||
}
|
||||
#endif // ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
|
||||
void ObjectList::create_object_popupmenu(wxMenu *menu)
|
||||
{
|
||||
|
|
@ -1300,9 +1298,7 @@ void ObjectList::create_object_popupmenu(wxMenu *menu)
|
|||
|
||||
append_menu_item_export_stl(menu);
|
||||
append_menu_item_fix_through_netfabb(menu);
|
||||
#if ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
append_menu_item_scale_selection_to_fit_print_volume(menu);
|
||||
#endif // ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
|
||||
// Split object to parts
|
||||
m_menu_item_split = append_menu_item_split(menu);
|
||||
|
|
|
|||
|
|
@ -207,9 +207,7 @@ public:
|
|||
void append_menu_item_export_stl(wxMenu* menu) const ;
|
||||
void append_menu_item_change_extruder(wxMenu* menu) const;
|
||||
void append_menu_item_delete(wxMenu* menu);
|
||||
#if ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
void append_menu_item_scale_selection_to_fit_print_volume(wxMenu* menu);
|
||||
#endif // ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
void create_object_popupmenu(wxMenu *menu);
|
||||
void create_sla_object_popupmenu(wxMenu*menu);
|
||||
void create_part_popupmenu(wxMenu*menu);
|
||||
|
|
|
|||
|
|
@ -847,7 +847,6 @@ bool GLGizmosManager::on_char(wxKeyEvent& evt, GLCanvas3D& canvas)
|
|||
|
||||
break;
|
||||
}
|
||||
#if ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
case 'F':
|
||||
case 'f':
|
||||
{
|
||||
|
|
@ -861,7 +860,6 @@ bool GLGizmosManager::on_char(wxKeyEvent& evt, GLCanvas3D& canvas)
|
|||
|
||||
break;
|
||||
}
|
||||
#endif // ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1302,9 +1302,7 @@ struct Plater::priv
|
|||
void sla_optimize_rotation();
|
||||
void split_object();
|
||||
void split_volume();
|
||||
#if ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
void scale_selection_to_fit_print_volume();
|
||||
#endif // ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
bool background_processing_enabled() const { return this->get_config("background_processing") == "1"; }
|
||||
void update_print_volume_state();
|
||||
void schedule_background_process();
|
||||
|
|
@ -2367,12 +2365,10 @@ void Plater::priv::split_volume()
|
|||
wxGetApp().obj_list()->split();
|
||||
}
|
||||
|
||||
#if ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
void Plater::priv::scale_selection_to_fit_print_volume()
|
||||
{
|
||||
this->view3D->get_canvas3d()->get_selection().scale_to_fit_print_volume(*config);
|
||||
}
|
||||
#endif // ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
|
||||
void Plater::priv::schedule_background_process()
|
||||
{
|
||||
|
|
@ -3036,9 +3032,7 @@ bool Plater::priv::init_common_menu(wxMenu* menu, const bool is_part/* = false*/
|
|||
|
||||
sidebar->obj_list()->append_menu_item_fix_through_netfabb(menu);
|
||||
|
||||
#if ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
sidebar->obj_list()->append_menu_item_scale_selection_to_fit_print_volume(menu);
|
||||
#endif // ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
|
||||
wxMenu* mirror_menu = new wxMenu();
|
||||
if (mirror_menu == nullptr)
|
||||
|
|
@ -3479,12 +3473,10 @@ bool Plater::is_selection_empty() const
|
|||
return p->get_selection().is_empty() || p->get_selection().is_wipe_tower();
|
||||
}
|
||||
|
||||
#if ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
void Plater::scale_selection_to_fit_print_volume()
|
||||
{
|
||||
p->scale_selection_to_fit_print_volume();
|
||||
}
|
||||
#endif // ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
|
||||
void Plater::cut(size_t obj_idx, size_t instance_idx, coordf_t z, bool keep_upper, bool keep_lower, bool rotate_lower)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -162,9 +162,7 @@ public:
|
|||
void decrease_instances(size_t num = 1);
|
||||
void set_number_of_copies(/*size_t num*/);
|
||||
bool is_selection_empty() const;
|
||||
#if ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
void scale_selection_to_fit_print_volume();
|
||||
#endif // ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
|
||||
void cut(size_t obj_idx, size_t instance_idx, coordf_t z, bool keep_upper = true, bool keep_lower = true, bool rotate_lower = false);
|
||||
|
||||
|
|
|
|||
|
|
@ -662,7 +662,6 @@ void Selection::scale(const Vec3d& scale, TransformationType transformation_type
|
|||
{
|
||||
GLVolume &volume = *(*m_volumes)[i];
|
||||
if (is_single_full_instance()) {
|
||||
#if ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
if (transformation_type.relative())
|
||||
{
|
||||
Transform3d m = Geometry::assemble_transform(Vec3d::Zero(), Vec3d::Zero(), scale);
|
||||
|
|
@ -676,9 +675,6 @@ void Selection::scale(const Vec3d& scale, TransformationType transformation_type
|
|||
}
|
||||
else
|
||||
{
|
||||
#else
|
||||
assert(transformation_type.absolute());
|
||||
#endif // ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
if (transformation_type.world() && (std::abs(scale.x() - scale.y()) > EPSILON || std::abs(scale.x() - scale.z()) > EPSILON)) {
|
||||
// Non-uniform scaling. Transform the scaling factors into the local coordinate system.
|
||||
// This is only possible, if the instance rotation is mulitples of ninety degrees.
|
||||
|
|
@ -687,9 +683,7 @@ void Selection::scale(const Vec3d& scale, TransformationType transformation_type
|
|||
}
|
||||
else
|
||||
volume.set_instance_scaling_factor(scale);
|
||||
#if ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
}
|
||||
#endif // ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
}
|
||||
else if (is_single_volume() || is_single_modifier())
|
||||
volume.set_volume_scaling_factor(scale);
|
||||
|
|
@ -733,7 +727,6 @@ void Selection::scale(const Vec3d& scale, TransformationType transformation_type
|
|||
this->set_bounding_boxes_dirty();
|
||||
}
|
||||
|
||||
#if ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
void Selection::scale_to_fit_print_volume(const DynamicPrintConfig& config)
|
||||
{
|
||||
if (is_empty() || (m_mode == Volume))
|
||||
|
|
@ -776,7 +769,6 @@ void Selection::scale_to_fit_print_volume(const DynamicPrintConfig& config)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif // ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
|
||||
void Selection::mirror(Axis axis)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -287,9 +287,7 @@ public:
|
|||
void rotate(const Vec3d& rotation, TransformationType transformation_type);
|
||||
void flattening_rotate(const Vec3d& normal);
|
||||
void scale(const Vec3d& scale, TransformationType transformation_type);
|
||||
#if ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
void scale_to_fit_print_volume(const DynamicPrintConfig& config);
|
||||
#endif // ENABLE_SCALE_TO_FIT_PRINT_VOLUME
|
||||
void mirror(Axis axis);
|
||||
|
||||
void translate(unsigned int object_idx, const Vec3d& displacement);
|
||||
|
|
|
|||
|
|
@ -2234,6 +2234,18 @@ void TabPrinter::build_unregular_pages()
|
|||
* */
|
||||
Freeze();
|
||||
|
||||
#ifdef __WXMSW__
|
||||
/* Workaround for correct layout of controls inside the created page:
|
||||
* In some _strange_ way we should we should imitate page resizing.
|
||||
*/
|
||||
auto layout_page = [this](PageShp page)
|
||||
{
|
||||
const wxSize& sz = page->GetSize();
|
||||
page->SetSize(sz.x + 1, sz.y + 1);
|
||||
page->SetSize(sz);
|
||||
};
|
||||
#endif //__WXMSW__
|
||||
|
||||
// Add/delete Kinematics page according to is_marlin_flavor
|
||||
size_t existed_page = 0;
|
||||
for (int i = n_before_extruders; i < m_pages.size(); ++i) // first make sure it's not there already
|
||||
|
|
@ -2247,6 +2259,9 @@ void TabPrinter::build_unregular_pages()
|
|||
|
||||
if (existed_page < n_before_extruders && is_marlin_flavor) {
|
||||
auto page = build_kinematics_page();
|
||||
#ifdef __WXMSW__
|
||||
layout_page(page);
|
||||
#endif
|
||||
m_pages.insert(m_pages.begin() + n_before_extruders, page);
|
||||
}
|
||||
|
||||
|
|
@ -2318,6 +2333,10 @@ void TabPrinter::build_unregular_pages()
|
|||
|
||||
optgroup = page->new_optgroup(_(L("Preview")));
|
||||
optgroup->append_single_option_line("extruder_colour", extruder_idx);
|
||||
|
||||
#ifdef __WXMSW__
|
||||
layout_page(page);
|
||||
#endif
|
||||
}
|
||||
|
||||
// # remove extra pages
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue