ENH:hide inactive plate

when open cut,text gizmo
Jira:STUDIO-6478

Change-Id: Idd9e25c4d46b58c51ef440eb20bcefdaecef53c2
This commit is contained in:
zhou.xu 2024-03-12 10:59:48 +08:00 committed by Lane.Wei
parent 087e1abafa
commit b5fbcc9e8f
3 changed files with 18 additions and 2 deletions

View File

@ -1907,7 +1907,7 @@ void GLCanvas3D::render(bool only_init)
//BBS add partplater rendering logic
bool only_current = false, only_body = false, show_axes = true, no_partplate = false;
GLGizmosManager::EType gizmo_type = m_gizmos.get_current_type();
if (!m_main_toolbar.is_enabled()) {
if (!m_main_toolbar.is_enabled() || m_gizmos.is_show_only_active_plate()) {
//only_body = true;
only_current = true;
}
@ -6865,7 +6865,7 @@ void GLCanvas3D::_render_bed(bool bottom, bool show_axes)
*/
//bool show_texture = true;
//BBS set axes mode
m_bed.set_axes_mode(m_main_toolbar.is_enabled());
m_bed.set_axes_mode(m_main_toolbar.is_enabled() && !m_gizmos.is_show_only_active_plate());
m_bed.render(*this, bottom, scale_factor, show_axes);
}
@ -6994,6 +6994,12 @@ void GLCanvas3D::_render_objects(GLVolumeCollection::ERenderType type, bool with
return !volume.is_modifier && !volume.is_wipe_tower;
}
else {
if (m_gizmos.is_show_only_active_plate()) {
auto plate_box = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_plate_box();
if (!plate_box.contains(volume.transformed_bounding_box())) {
return false;
}
}
return (m_render_sla_auxiliaries || volume.composite_id.volume_id >= 0);
}
}, with_outline);

View File

@ -666,6 +666,15 @@ bool GLGizmosManager::is_gizmo_click_empty_not_exit()
return false;
}
bool GLGizmosManager::is_show_only_active_plate()
{
if (get_current_type() == GLGizmosManager::EType::Cut ||
get_current_type() == GLGizmosManager::EType::Text) {
return true;
}
return false;
}
// Returns true if the gizmo used the event to do something, false otherwise.
bool GLGizmosManager::gizmo_event(SLAGizmoEventType action, const Vec2d& mouse_position, bool shift_down, bool alt_down, bool control_down)
{

View File

@ -283,6 +283,7 @@ public:
bool is_gizmo_activable_when_single_full_instance();
bool is_gizmo_click_empty_not_exit();
bool is_show_only_active_plate();
bool gizmo_event(SLAGizmoEventType action, const Vec2d& mouse_position = Vec2d::Zero(), bool shift_down = false, bool alt_down = false, bool control_down = false);
ClippingPlane get_clipping_plane() const;
ClippingPlane get_assemble_view_clipping_plane() const;