mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-21 13:47:59 -06:00
Added sinking property item to objects list
This commit is contained in:
parent
a54f5fb41a
commit
14a67b0c9e
4 changed files with 31 additions and 5 deletions
|
@ -3383,6 +3383,7 @@ void GLCanvas3D::do_move(const std::string& snapshot_type)
|
||||||
m_selection.translate(i.first, i.second, shift);
|
m_selection.translate(i.first, i.second, shift);
|
||||||
m->translate_instance(i.second, shift);
|
m->translate_instance(i.second, shift);
|
||||||
}
|
}
|
||||||
|
wxGetApp().obj_list()->update_info_items(static_cast<size_t>(i.first));
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the selection is not valid to allow for layer editing after the move, we need to turn off the tool if it is running
|
// if the selection is not valid to allow for layer editing after the move, we need to turn off the tool if it is running
|
||||||
|
@ -3463,6 +3464,7 @@ void GLCanvas3D::do_rotate(const std::string& snapshot_type)
|
||||||
m_selection.translate(i.first, i.second, shift);
|
m_selection.translate(i.first, i.second, shift);
|
||||||
m->translate_instance(i.second, shift);
|
m->translate_instance(i.second, shift);
|
||||||
}
|
}
|
||||||
|
wxGetApp().obj_list()->update_info_items(static_cast<size_t>(i.first));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!done.empty())
|
if (!done.empty())
|
||||||
|
@ -3530,6 +3532,7 @@ void GLCanvas3D::do_scale(const std::string& snapshot_type)
|
||||||
m_selection.translate(i.first, i.second, shift);
|
m_selection.translate(i.first, i.second, shift);
|
||||||
m->translate_instance(i.second, shift);
|
m->translate_instance(i.second, shift);
|
||||||
}
|
}
|
||||||
|
wxGetApp().obj_list()->update_info_items(static_cast<size_t>(i.first));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!done.empty())
|
if (!done.empty())
|
||||||
|
|
|
@ -2386,15 +2386,28 @@ void ObjectList::part_selection_changed()
|
||||||
|
|
||||||
if (type == itInfo) {
|
if (type == itInfo) {
|
||||||
InfoItemType info_type = m_objects_model->GetInfoItemType(item);
|
InfoItemType info_type = m_objects_model->GetInfoItemType(item);
|
||||||
if (info_type != InfoItemType::VariableLayerHeight) {
|
switch (info_type)
|
||||||
|
{
|
||||||
|
case InfoItemType::VariableLayerHeight:
|
||||||
|
{
|
||||||
|
wxGetApp().plater()->toggle_layers_editing(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case InfoItemType::CustomSupports:
|
||||||
|
case InfoItemType::CustomSeam:
|
||||||
|
case InfoItemType::MmuSegmentation:
|
||||||
|
{
|
||||||
GLGizmosManager::EType gizmo_type = info_type == InfoItemType::CustomSupports ? GLGizmosManager::EType::FdmSupports :
|
GLGizmosManager::EType gizmo_type = info_type == InfoItemType::CustomSupports ? GLGizmosManager::EType::FdmSupports :
|
||||||
info_type == InfoItemType::CustomSeam ? GLGizmosManager::EType::Seam :
|
info_type == InfoItemType::CustomSeam ? GLGizmosManager::EType::Seam :
|
||||||
GLGizmosManager::EType::MmuSegmentation;
|
GLGizmosManager::EType::MmuSegmentation;
|
||||||
GLGizmosManager& gizmos_mgr = wxGetApp().plater()->canvas3D()->get_gizmos_manager();
|
GLGizmosManager& gizmos_mgr = wxGetApp().plater()->canvas3D()->get_gizmos_manager();
|
||||||
if (gizmos_mgr.get_current_type() != gizmo_type)
|
if (gizmos_mgr.get_current_type() != gizmo_type)
|
||||||
gizmos_mgr.open_gizmo(gizmo_type);
|
gizmos_mgr.open_gizmo(gizmo_type);
|
||||||
} else
|
break;
|
||||||
wxGetApp().plater()->toggle_layers_editing(true);
|
}
|
||||||
|
case InfoItemType::Sinking: { break; }
|
||||||
|
default: { break; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -2520,6 +2533,7 @@ void ObjectList::update_info_items(size_t obj_idx)
|
||||||
for (InfoItemType type : {InfoItemType::CustomSupports,
|
for (InfoItemType type : {InfoItemType::CustomSupports,
|
||||||
InfoItemType::CustomSeam,
|
InfoItemType::CustomSeam,
|
||||||
InfoItemType::MmuSegmentation,
|
InfoItemType::MmuSegmentation,
|
||||||
|
InfoItemType::Sinking,
|
||||||
InfoItemType::VariableLayerHeight}) {
|
InfoItemType::VariableLayerHeight}) {
|
||||||
wxDataViewItem item = m_objects_model->GetInfoItemByType(item_obj, type);
|
wxDataViewItem item = m_objects_model->GetInfoItemByType(item_obj, type);
|
||||||
bool shows = item.IsOk();
|
bool shows = item.IsOk();
|
||||||
|
@ -2542,6 +2556,13 @@ void ObjectList::update_info_items(size_t obj_idx)
|
||||||
should_show = printer_technology() == ptFFF
|
should_show = printer_technology() == ptFFF
|
||||||
&& ! model_object->layer_height_profile.empty();
|
&& ! model_object->layer_height_profile.empty();
|
||||||
break;
|
break;
|
||||||
|
case InfoItemType::Sinking:
|
||||||
|
{
|
||||||
|
const BoundingBoxf3& box = model_object->bounding_box();
|
||||||
|
should_show = printer_technology() == ptFFF &&
|
||||||
|
box.min.z() < SINKING_Z_THRESHOLD && box.max.z() > SINKING_Z_THRESHOLD;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,7 @@ ObjectDataViewModelNode::ObjectDataViewModelNode(ObjectDataViewModelNode* parent
|
||||||
m_name = info_type == InfoItemType::CustomSupports ? _L("Paint-on supports") :
|
m_name = info_type == InfoItemType::CustomSupports ? _L("Paint-on supports") :
|
||||||
info_type == InfoItemType::CustomSeam ? _L("Paint-on seam") :
|
info_type == InfoItemType::CustomSeam ? _L("Paint-on seam") :
|
||||||
info_type == InfoItemType::MmuSegmentation ? _L("Paint-on segmentation") :
|
info_type == InfoItemType::MmuSegmentation ? _L("Paint-on segmentation") :
|
||||||
|
info_type == InfoItemType::Sinking ? _L("Sinking") :
|
||||||
_L("Variable layer height");
|
_L("Variable layer height");
|
||||||
m_info_item_type = info_type;
|
m_info_item_type = info_type;
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,7 @@ enum class InfoItemType
|
||||||
CustomSupports,
|
CustomSupports,
|
||||||
CustomSeam,
|
CustomSeam,
|
||||||
MmuSegmentation,
|
MmuSegmentation,
|
||||||
|
Sinking,
|
||||||
VariableLayerHeight
|
VariableLayerHeight
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue