Ys code refactoring (#6227)

* GUI_ObjectList code refactoring:
The MenuFactory structure contains functions related to the context menu and bitmaps used to different volume types.
The SettingsFactory structure contains functions to getting overridden options, its bundles and bitmaps used to setting categories.

Fixed bugs/crashes:
1. Add object -> Add Settings from 3D scene -> Right click on object => Part's Settings list instead of object's
   (Same behavior if something else but Object is selected in ObjectList)
2. Add settings to the part -> Change part type to the "Support Blocker/Enforcer" -> Settings disappears (it's OK) but =>
   Save Project -> Open project => Support Blocker/Enforcer has a settings
3. Add part for object -> Change type of part -> Change monitor DPI -> old type icon appears
4. Select all instances in ObjectList -> Context menu in 3D scene -> Add Settings -> Select some category -> Crash

* ObjectLayers: Fixed a crash on re-scaling, when some layer range is selected

* Fixed OSX build

* Added menu item "Split to Objects" for multipart objects

+ Fixed bug: Add 2 parts,
             Add some settings for one part
             Delete part without settings => Single part object without settings, but settings are applied for the object.

+ Next refactoring: use same menu for Plater and ObjectList
This commit is contained in:
Oleksandra Yushchenko 2021-03-15 10:04:45 +01:00 committed by GitHub
parent 95c5763b83
commit e002f0066f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 1376 additions and 1415 deletions

View file

@ -271,6 +271,10 @@ public:
void copy_selection_to_clipboard();
void paste_from_clipboard();
void search(bool plater_is_active);
void mirror(Axis axis);
void split_object();
void split_volume();
void optimize_rotation();
bool can_delete() const;
bool can_delete_all() const;
@ -287,6 +291,8 @@ public:
bool can_undo() const;
bool can_redo() const;
bool can_reload_from_disk() const;
bool can_mirror() const;
bool can_split(bool to_objects) const;
void msw_rescale();
void sys_color_changed();
@ -375,6 +381,15 @@ public:
bool PopupMenu(wxMenu *menu, const wxPoint& pos = wxDefaultPosition);
bool PopupMenu(wxMenu *menu, int x, int y) { return this->PopupMenu(menu, wxPoint(x, y)); }
// get same Plater/ObjectList menus
wxMenu* object_menu();
wxMenu* part_menu();
wxMenu* sla_object_menu();
wxMenu* default_menu();
wxMenu* instance_menu();
wxMenu* layer_menu();
wxMenu* multi_selection_menu();
private:
struct priv;
std::unique_ptr<priv> p;