Changed the object context menu in the object list for SLA print technology

+ changed list of the options for "Add settings"
This commit is contained in:
YuSanka 2018-11-22 10:33:16 +01:00
parent 343335dbc3
commit 7b9f498410
4 changed files with 53 additions and 10 deletions

View File

@ -2447,6 +2447,7 @@ void PrintConfigDef::init_sla_params()
def = this->add("support_head_front_radius", coFloat); def = this->add("support_head_front_radius", coFloat);
def->label = L("Support head front radius"); def->label = L("Support head front radius");
def->category = L("Supports");
def->tooltip = L("Radius of the pointing side of the head"); def->tooltip = L("Radius of the pointing side of the head");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->cli = ""; def->cli = "";
@ -2455,6 +2456,7 @@ void PrintConfigDef::init_sla_params()
def = this->add("support_head_penetration", coFloat); def = this->add("support_head_penetration", coFloat);
def->label = L("Support head penetration"); def->label = L("Support head penetration");
def->category = L("Supports");
def->tooltip = L("How much the pinhead has to penetrate the model surface"); def->tooltip = L("How much the pinhead has to penetrate the model surface");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->cli = ""; def->cli = "";
@ -2463,6 +2465,7 @@ void PrintConfigDef::init_sla_params()
def = this->add("support_head_back_radius", coFloat); def = this->add("support_head_back_radius", coFloat);
def->label = L("Support head back radius"); def->label = L("Support head back radius");
def->category = L("Supports");
def->tooltip = L("Radius of the back side of the 3d arrow"); def->tooltip = L("Radius of the back side of the 3d arrow");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->cli = ""; def->cli = "";
@ -2471,6 +2474,7 @@ void PrintConfigDef::init_sla_params()
def = this->add("support_head_width", coFloat); def = this->add("support_head_width", coFloat);
def->label = L("Support head width"); def->label = L("Support head width");
def->category = L("Supports");
def->tooltip = L("Width from the back sphere center to the front sphere center"); def->tooltip = L("Width from the back sphere center to the front sphere center");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->cli = ""; def->cli = "";
@ -2479,6 +2483,7 @@ void PrintConfigDef::init_sla_params()
def = this->add("support_pillar_radius", coFloat); def = this->add("support_pillar_radius", coFloat);
def->label = L("Support pillar radius"); def->label = L("Support pillar radius");
def->category = L("Supports");
def->tooltip = L("Radius in mm of the support pillars"); def->tooltip = L("Radius in mm of the support pillars");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->cli = ""; def->cli = "";
@ -2487,6 +2492,7 @@ void PrintConfigDef::init_sla_params()
def = this->add("support_base_radius", coFloat); def = this->add("support_base_radius", coFloat);
def->label = L("Support base radius"); def->label = L("Support base radius");
def->category = L("Supports");
def->tooltip = L("Radius in mm of the pillar base"); def->tooltip = L("Radius in mm of the pillar base");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->cli = ""; def->cli = "";
@ -2495,6 +2501,7 @@ void PrintConfigDef::init_sla_params()
def = this->add("support_base_height", coFloat); def = this->add("support_base_height", coFloat);
def->label = L("Support base height"); def->label = L("Support base height");
def->category = L("Supports");
def->tooltip = L("The height of the pillar base cone"); def->tooltip = L("The height of the pillar base cone");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->cli = ""; def->cli = "";
@ -2503,6 +2510,7 @@ void PrintConfigDef::init_sla_params()
def = this->add("support_critical_angle", coFloat); def = this->add("support_critical_angle", coFloat);
def->label = L("Critical angle"); def->label = L("Critical angle");
def->category = L("Supports");
def->tooltip = L("The default angle for connecting support sticks and junctions."); def->tooltip = L("The default angle for connecting support sticks and junctions.");
def->sidetext = L("°"); def->sidetext = L("°");
def->cli = ""; def->cli = "";
@ -2511,6 +2519,7 @@ void PrintConfigDef::init_sla_params()
def = this->add("support_max_bridge_length", coFloat); def = this->add("support_max_bridge_length", coFloat);
def->label = L("Max bridge length"); def->label = L("Max bridge length");
def->category = L("Supports");
def->tooltip = L("The max length of a bridge"); def->tooltip = L("The max length of a bridge");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->cli = ""; def->cli = "";
@ -2519,6 +2528,7 @@ void PrintConfigDef::init_sla_params()
def = this->add("support_object_elevation", coFloat); def = this->add("support_object_elevation", coFloat);
def->label = L("Object elevation"); def->label = L("Object elevation");
def->category = L("Supports");
def->tooltip = L("How much the supports should lift up the supported object."); def->tooltip = L("How much the supports should lift up the supported object.");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->cli = ""; def->cli = "";
@ -2527,6 +2537,7 @@ void PrintConfigDef::init_sla_params()
def = this->add("pad_enable", coBool); def = this->add("pad_enable", coBool);
def->label = L("Use pad"); def->label = L("Use pad");
def->category = L("Pad");
def->tooltip = L("Add a pad underneath the supported model"); def->tooltip = L("Add a pad underneath the supported model");
def->sidetext = L(""); def->sidetext = L("");
def->cli = ""; def->cli = "";
@ -2534,6 +2545,7 @@ void PrintConfigDef::init_sla_params()
def = this->add("pad_wall_thickness", coFloat); def = this->add("pad_wall_thickness", coFloat);
def->label = L("Pad wall thickness"); def->label = L("Pad wall thickness");
def->category = L("Pad");
def->tooltip = L(""); def->tooltip = L("");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->cli = ""; def->cli = "";
@ -2542,6 +2554,7 @@ void PrintConfigDef::init_sla_params()
def = this->add("pad_wall_height", coFloat); def = this->add("pad_wall_height", coFloat);
def->label = L("Pad wall height"); def->label = L("Pad wall height");
def->category = L("Pad");
def->tooltip = L(""); def->tooltip = L("");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->cli = ""; def->cli = "";
@ -2550,6 +2563,7 @@ void PrintConfigDef::init_sla_params()
def = this->add("pad_max_merge_distance", coFloat); def = this->add("pad_max_merge_distance", coFloat);
def->label = L("Max merge distance"); def->label = L("Max merge distance");
def->category = L("Pad");
def->tooltip = L(""); def->tooltip = L("");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->cli = ""; def->cli = "";
@ -2558,6 +2572,7 @@ void PrintConfigDef::init_sla_params()
def = this->add("pad_edge_radius", coFloat); def = this->add("pad_edge_radius", coFloat);
def->label = L("Pad edge radius"); def->label = L("Pad edge radius");
def->category = L("Pad");
def->tooltip = L(""); def->tooltip = L("");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->cli = ""; def->cli = "";

View File

@ -25,6 +25,7 @@ ObjectList::ObjectList(wxWindow* parent) :
{ {
// Fill CATEGORY_ICON // Fill CATEGORY_ICON
{ {
// ptFFF
CATEGORY_ICON[L("Layers and Perimeters")] = wxBitmap(from_u8(var("layers.png")), wxBITMAP_TYPE_PNG); CATEGORY_ICON[L("Layers and Perimeters")] = wxBitmap(from_u8(var("layers.png")), wxBITMAP_TYPE_PNG);
CATEGORY_ICON[L("Infill")] = wxBitmap(from_u8(var("infill.png")), wxBITMAP_TYPE_PNG); CATEGORY_ICON[L("Infill")] = wxBitmap(from_u8(var("infill.png")), wxBITMAP_TYPE_PNG);
CATEGORY_ICON[L("Support material")] = wxBitmap(from_u8(var("building.png")), wxBITMAP_TYPE_PNG); CATEGORY_ICON[L("Support material")] = wxBitmap(from_u8(var("building.png")), wxBITMAP_TYPE_PNG);
@ -34,6 +35,9 @@ ObjectList::ObjectList(wxWindow* parent) :
// CATEGORY_ICON[L("Skirt and brim")] = wxBitmap(from_u8(var("box.png")), wxBITMAP_TYPE_PNG); // CATEGORY_ICON[L("Skirt and brim")] = wxBitmap(from_u8(var("box.png")), wxBITMAP_TYPE_PNG);
// CATEGORY_ICON[L("Speed > Acceleration")] = wxBitmap(from_u8(var("time.png")), wxBITMAP_TYPE_PNG); // CATEGORY_ICON[L("Speed > Acceleration")] = wxBitmap(from_u8(var("time.png")), wxBITMAP_TYPE_PNG);
CATEGORY_ICON[L("Advanced")] = wxBitmap(from_u8(var("wand.png")), wxBITMAP_TYPE_PNG); CATEGORY_ICON[L("Advanced")] = wxBitmap(from_u8(var("wand.png")), wxBITMAP_TYPE_PNG);
// ptSLA
CATEGORY_ICON[L("Supports")] = wxBitmap(from_u8(var("building.png")), wxBITMAP_TYPE_PNG);
CATEGORY_ICON[L("Pad")] = wxBitmap(from_u8(var("brick.png")), wxBITMAP_TYPE_PNG);
} }
// create control // create control
@ -310,8 +314,8 @@ void ObjectList::show_context_menu()
if (!(m_objects_model->GetItemType(item) & (itObject | itVolume))) if (!(m_objects_model->GetItemType(item) & (itObject | itVolume)))
return; return;
const auto menu = m_objects_model->GetParent(item) == wxDataViewItem(0) ? const auto menu = m_objects_model->GetParent(item) == wxDataViewItem(0) ?
create_add_part_popupmenu() : create_object_popupmenu() :
create_part_settings_popupmenu(); create_part_popupmenu();
wxGetApp().tab_panel()->GetPage(0)->PopupMenu(menu); wxGetApp().tab_panel()->GetPage(0)->PopupMenu(menu);
} }
} }
@ -436,6 +440,13 @@ void ObjectList::on_drop(wxDataViewEvent &event)
std::vector<std::string> get_options(const bool is_part) std::vector<std::string> get_options(const bool is_part)
{ {
if (wxGetApp().plater()->printer_technology() == ptSLA) {
SLAPrintObjectConfig full_sla_config;
auto options = full_sla_config.keys();
options.erase(find(options.begin(), options.end(), "layer_height"));
return options;
}
PrintRegionConfig reg_config; PrintRegionConfig reg_config;
auto options = reg_config.keys(); auto options = reg_config.keys();
if (!is_part) { if (!is_part) {
@ -463,7 +474,10 @@ void get_options_menu(settings_menu_hierarchy& settings_menu, bool is_part)
if (category.empty() || if (category.empty() ||
(category == "Extruders" && extruders_cnt == 1)) continue; (category == "Extruders" && extruders_cnt == 1)) continue;
std::pair<std::string, std::string> option_label(option, opt->label); const std::string& label = opt->label.empty() ? opt->full_label :
opt->full_label.empty() ? opt->label :
opt->full_label + " " + opt->label;;
std::pair<std::string, std::string> option_label(option, label);
std::vector< std::pair<std::string, std::string> > new_category; std::vector< std::pair<std::string, std::string> > new_category;
auto& cat_opt_label = settings_menu.find(category) == settings_menu.end() ? new_category : settings_menu.at(category); auto& cat_opt_label = settings_menu.find(category) == settings_menu.end() ? new_category : settings_menu.at(category);
cat_opt_label.push_back(option_label); cat_opt_label.push_back(option_label);
@ -575,14 +589,27 @@ wxMenuItem* ObjectList::menu_item_settings(wxMenu* menu, int id, const bool is_p
auto menu_item = new wxMenuItem(menu, id, _(L("Add settings"))); auto menu_item = new wxMenuItem(menu, id, _(L("Add settings")));
menu_item->SetBitmap(m_bmp_cog); menu_item->SetBitmap(m_bmp_cog);
auto sub_menu = create_add_settings_popupmenu(is_part); auto sub_menu = create_settings_popupmenu(is_part);
menu_item->SetSubMenu(sub_menu); menu_item->SetSubMenu(sub_menu);
return menu_item; return menu_item;
} }
wxMenu* ObjectList::create_add_part_popupmenu() wxMenu* ObjectList::create_object_popupmenu()
{ {
wxMenu *menu = new wxMenu; wxMenu *menu = new wxMenu;
if (wxGetApp().plater()->printer_technology() == ptSLA)
{
wxWindowID config_id_base = NewControlId(1);
// Append settings popupmenu
menu->Append(menu_item_settings(menu, config_id_base, false));
menu->Bind(wxEVT_MENU, [menu, this](wxEvent &event) {
get_settings_choice(menu, event.GetId(), false);
});
return menu;
}
// Note: id accords to type of the sub-object, so sequence of the menu items is important // Note: id accords to type of the sub-object, so sequence of the menu items is important
std::vector<std::string> menu_object_types_items = {L("Add part"), // ~ModelVolume::MODEL_PART std::vector<std::string> menu_object_types_items = {L("Add part"), // ~ModelVolume::MODEL_PART
L("Add modifier"), // ~ModelVolume::PARAMETER_MODIFIER L("Add modifier"), // ~ModelVolume::PARAMETER_MODIFIER
@ -635,7 +662,7 @@ wxMenu* ObjectList::create_add_part_popupmenu()
return menu; return menu;
} }
wxMenu* ObjectList::create_part_settings_popupmenu() wxMenu* ObjectList::create_part_popupmenu()
{ {
wxMenu *menu = new wxMenu; wxMenu *menu = new wxMenu;
wxWindowID config_id_base = NewControlId(3); wxWindowID config_id_base = NewControlId(3);
@ -671,7 +698,7 @@ wxMenu* ObjectList::create_part_settings_popupmenu()
return menu; return menu;
} }
wxMenu* ObjectList::create_add_settings_popupmenu(bool is_part) wxMenu* ObjectList::create_settings_popupmenu(bool is_part)
{ {
wxMenu *menu = new wxMenu; wxMenu *menu = new wxMenu;

View File

@ -98,9 +98,9 @@ public:
void menu_item_add_generic(wxMenuItem* &menu, int id, const int type); void menu_item_add_generic(wxMenuItem* &menu, int id, const int type);
wxMenuItem* menu_item_split(wxMenu* menu, int id); wxMenuItem* menu_item_split(wxMenu* menu, int id);
wxMenuItem* menu_item_settings(wxMenu* menu, int id, const bool is_part); wxMenuItem* menu_item_settings(wxMenu* menu, int id, const bool is_part);
wxMenu* create_add_part_popupmenu(); wxMenu* create_object_popupmenu();
wxMenu* create_part_settings_popupmenu(); wxMenu* create_part_popupmenu();
wxMenu* create_add_settings_popupmenu(bool is_part); wxMenu* create_settings_popupmenu(bool is_part);
void load_subobject(int type); void load_subobject(int type);
void load_part(ModelObject* model_object, wxArrayString& part_names, int type); void load_part(ModelObject* model_object, wxArrayString& part_names, int type);

View File

@ -3011,6 +3011,7 @@ void TabSLAPrint::build()
optgroup->append_single_option_line("support_critical_angle"); optgroup->append_single_option_line("support_critical_angle");
optgroup->append_single_option_line("support_max_bridge_length"); optgroup->append_single_option_line("support_max_bridge_length");
page = add_options_page(_(L("Pad")), "brick.png");
optgroup = page->new_optgroup(_(L("Pad"))); optgroup = page->new_optgroup(_(L("Pad")));
optgroup->append_single_option_line("pad_enable"); optgroup->append_single_option_line("pad_enable");
optgroup->append_single_option_line("pad_wall_thickness"); optgroup->append_single_option_line("pad_wall_thickness");