mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-03 07:16:52 +00:00
NEW: add plate tab at objectlist
Jira: STUDIO-4154 Change-Id: Id24517df3c15cc3907cb6b1fe0ea9d1b6c6d1e56
This commit is contained in:
@@ -199,7 +199,9 @@ bool ObjectSettings::update_settings_list()
|
||||
wxDataViewItemArray items;
|
||||
objects_ctrl->GetSelections(items);
|
||||
|
||||
std::map<ObjectBase *, ModelConfig *> object_configs;
|
||||
std::map<ObjectBase *, ModelConfig*> plate_configs;
|
||||
std::map<ObjectBase *, ModelConfig*> object_configs;
|
||||
bool is_plate_settings = false;
|
||||
bool is_object_settings = false;
|
||||
bool is_volume_settings = false;
|
||||
bool is_layer_range_settings = false;
|
||||
@@ -207,6 +209,14 @@ bool ObjectSettings::update_settings_list()
|
||||
ModelObject * parent_object = nullptr;
|
||||
for (auto item : items) {
|
||||
auto type = objects_model->GetItemType(item);
|
||||
if (type == itPlate) {
|
||||
is_plate_settings = true;
|
||||
|
||||
static ModelConfig cfg;
|
||||
auto plate = wxGetApp().plater()->get_partplate_list().get_curr_plate();
|
||||
cfg.assign_config(*plate->config());
|
||||
plate_configs.emplace(plate, &cfg);
|
||||
}
|
||||
if (type != itObject && type != itVolume && type != itLayerRoot && type != itLayer) {
|
||||
continue;
|
||||
}
|
||||
@@ -241,33 +251,45 @@ bool ObjectSettings::update_settings_list()
|
||||
}
|
||||
}
|
||||
|
||||
auto tab_plate = dynamic_cast<TabPrintPlate*>(wxGetApp().get_plate_tab());
|
||||
auto tab_object = dynamic_cast<TabPrintModel*>(wxGetApp().get_model_tab());
|
||||
auto tab_volume = dynamic_cast<TabPrintModel*>(wxGetApp().get_model_tab(true));
|
||||
auto tab_layer = dynamic_cast<TabPrintModel*>(wxGetApp().get_layer_tab());
|
||||
|
||||
if (is_object_settings) {
|
||||
if (is_plate_settings) {
|
||||
tab_object->set_model_config({});
|
||||
tab_volume->set_model_config({});
|
||||
tab_layer->set_model_config({});
|
||||
tab_plate->set_model_config(plate_configs);
|
||||
;// m_tab_active = tab_plate;
|
||||
}
|
||||
else if (is_object_settings) {
|
||||
tab_object->set_model_config(object_configs);
|
||||
tab_volume->set_model_config({});
|
||||
tab_layer->set_model_config({});
|
||||
m_tab_active = tab_object;
|
||||
tab_plate->set_model_config({});
|
||||
//m_tab_active = tab_object;
|
||||
}
|
||||
else if (is_volume_settings) {
|
||||
tab_object->set_model_config({ {parent_object, &parent_object->config} });
|
||||
tab_volume->set_model_config(object_configs);
|
||||
tab_layer->set_model_config({});
|
||||
m_tab_active = tab_volume;
|
||||
tab_plate->set_model_config({});
|
||||
//m_tab_active = tab_volume;
|
||||
}
|
||||
else if (is_layer_range_settings) {
|
||||
tab_object->set_model_config({ {parent_object, &parent_object->config} });
|
||||
tab_volume->set_model_config({});
|
||||
tab_layer->set_model_config(object_configs);
|
||||
m_tab_active = tab_layer;
|
||||
tab_plate->set_model_config({});
|
||||
//m_tab_active = tab_layer;
|
||||
}
|
||||
else {
|
||||
tab_object->set_model_config({});
|
||||
tab_volume->set_model_config({});
|
||||
tab_layer->set_model_config({});
|
||||
m_tab_active = nullptr;
|
||||
tab_plate->set_model_config({});
|
||||
//m_tab_active = nullptr;
|
||||
}
|
||||
((ParamsPanel*) tab_object->GetParent())->set_active_tab(nullptr);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user