mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
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:
parent
95c5763b83
commit
e002f0066f
14 changed files with 1376 additions and 1415 deletions
|
@ -171,13 +171,14 @@ public:
|
|||
}
|
||||
|
||||
bool SetValue(const wxVariant &variant, unsigned int col);
|
||||
|
||||
void SetVolumeType(ModelVolumeType type) { m_volume_type = type; }
|
||||
void SetBitmap(const wxBitmap &icon) { m_bmp = icon; }
|
||||
const wxBitmap& GetBitmap() const { return m_bmp; }
|
||||
const wxString& GetName() const { return m_name; }
|
||||
ItemType GetType() const { return m_type; }
|
||||
void SetIdx(const int& idx);
|
||||
int GetIdx() const { return m_idx; }
|
||||
ModelVolumeType GetVolumeType() { return m_volume_type; }
|
||||
t_layer_height_range GetLayerRange() const { return m_layer_range; }
|
||||
PrintIndicator IsPrintable() const { return m_printable; }
|
||||
|
||||
|
@ -241,8 +242,8 @@ wxDECLARE_EVENT(wxCUSTOMEVT_LAST_VOLUME_IS_DELETED, wxCommandEvent);
|
|||
class ObjectDataViewModel :public wxDataViewModel
|
||||
{
|
||||
std::vector<ObjectDataViewModelNode*> m_objects;
|
||||
std::vector<wxBitmap*> m_volume_bmps;
|
||||
wxBitmap* m_warning_bmp { nullptr };
|
||||
std::vector<wxBitmap> m_volume_bmps;
|
||||
wxBitmap m_warning_bmp;
|
||||
|
||||
wxDataViewCtrl* m_ctrl { nullptr };
|
||||
|
||||
|
@ -348,9 +349,8 @@ public:
|
|||
void UpdateObjectPrintable(wxDataViewItem parent_item);
|
||||
void UpdateInstancesPrintable(wxDataViewItem parent_item);
|
||||
|
||||
void SetVolumeBitmaps(const std::vector<wxBitmap*>& volume_bmps) { m_volume_bmps = volume_bmps; }
|
||||
void SetWarningBitmap(wxBitmap* bitmap) { m_warning_bmp = bitmap; }
|
||||
void SetVolumeType(const wxDataViewItem &item, const Slic3r::ModelVolumeType type);
|
||||
ModelVolumeType GetVolumeType(const wxDataViewItem &item);
|
||||
wxDataViewItem SetPrintableState( PrintIndicator printable, int obj_idx,
|
||||
int subobj_idx = -1,
|
||||
ItemType subobj_type = itInstance);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue