Merge branch 'master' into tm_colldetection_upgr

This commit is contained in:
tamasmeszaros 2019-03-07 17:19:01 +01:00
commit e0b1551790
3 changed files with 32 additions and 7 deletions

View File

@ -15,7 +15,7 @@ void FillPlanePath::_fill_surface_single(
{
expolygon.rotate(- direction.first);
coord_t distance_between_lines = scale_(this->spacing) / params.density;
coord_t distance_between_lines = coord_t(scale_(this->spacing) / params.density);
// align infill across layers using the object's bounding box
// Rotated bounding box of the whole object.
@ -89,7 +89,8 @@ Pointfs FillArchimedeanChords::_generate(coord_t min_x, coord_t min_y, coord_t m
out.push_back(Vec2d(0, 0));
out.push_back(Vec2d(1, 0));
while (r < rmax) {
theta += 1. / r;
// Discretization angle to achieve a discretization error lower than RESOLUTION.
theta += 2. * acos(1. - RESOLUTION / r);
r = a + b * theta;
out.push_back(Vec2d(r * cos(theta), r * sin(theta)));
}

View File

@ -940,7 +940,9 @@ wxMenuItem* ObjectList::append_menu_item_settings(wxMenu* menu_)
// Create new items for settings popupmenu
menu->m_separator_frst = menu->AppendSeparator();
if (printer_technology() == ptFFF ||
menu->GetMenuItems().size() > 0 && !menu->GetMenuItems().back()->IsSeparator())
menu->m_separator_frst = menu->AppendSeparator();
// Add frequently settings
create_freq_settings_popupmenu(menu);
@ -992,12 +994,20 @@ void ObjectList::append_menu_item_fix_through_netfabb(wxMenu* menu)
menu->AppendSeparator();
}
void ObjectList::append_menu_item_export_stl(wxMenu* menu) const
{
append_menu_item(menu, wxID_ANY, _(L("Export object as STL")) + dots, "",
[](wxCommandEvent&) { wxGetApp().plater()->export_stl(true); }, "", menu);
menu->AppendSeparator();
}
void ObjectList::create_object_popupmenu(wxMenu *menu)
{
#ifdef __WXOSX__
append_menu_item_rename(menu);
#endif // __WXOSX__
append_menu_item_export_stl(menu);
append_menu_item_fix_through_netfabb(menu);
// Split object to parts
@ -1017,7 +1027,8 @@ void ObjectList::create_sla_object_popupmenu(wxMenu *menu)
#ifdef __WXOSX__
append_menu_item_rename(menu);
#endif // __WXOSX__
append_menu_item_export_stl(menu);
append_menu_item_fix_through_netfabb(menu);
// rest of a object_sla_menu will be added later in:
// - append_menu_item_settings() -> for "Add (settings)"
@ -1917,11 +1928,23 @@ void ObjectList::update_selections()
select_items(sels);
/* Because of ScrollLines() and GetItemRect() functions are implemented
* only for GENERIC DataViewCtrl in current version of wxWidgets,
* use this part of code only for MSW
*/
#if defined(wxUSE_GENERICDATAVIEWCTRL)
// Scroll selected Item in the middle of an object list
if (GetSelection()) {
const int sel_item_row = m_objects_model->GetRowByItem(GetSelection());
ScrollLines(sel_item_row - m_selected_row);
m_selected_row = sel_item_row;
const wxRect& sel_rc = GetItemRect(GetSelection());
const wxRect& main_rc = GetClientRect();
if (sel_rc.GetBottom() <= main_rc.GetTop()+sel_rc.height ||
sel_rc.GetTop() >= main_rc.GetBottom() )
{
const wxRect& top_rc = GetItemRect(GetTopItem());
ScrollLines(int((sel_rc.y - top_rc.y) / top_rc.GetHeight()) - 0.5*GetCountPerPage());
}
}
#endif
}
void ObjectList::update_selections_on_canvas()

View File

@ -186,6 +186,7 @@ public:
wxMenuItem* append_menu_item_instance_to_object(wxMenu* menu);
void append_menu_item_rename(wxMenu* menu);
void append_menu_item_fix_through_netfabb(wxMenu* menu);
void append_menu_item_export_stl(wxMenu* menu) const ;
void create_object_popupmenu(wxMenu *menu);
void create_sla_object_popupmenu(wxMenu*menu);
void create_part_popupmenu(wxMenu*menu);