mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-09-21 01:43:13 +08:00
NEW: add api of "toggle_selected_volume_visibility"
Jira: STUDIO-6166 Change-Id: I77eb988a3ea43cd37d50888d1753b973795d8b36
This commit is contained in:
parent
ac1459e338
commit
d9d95294d3
@ -1396,7 +1396,36 @@ ModelInstanceEPrintVolumeState GLCanvas3D::check_volumes_outside_state() const
|
||||
return state;
|
||||
}
|
||||
|
||||
void GLCanvas3D::toggle_sla_auxiliaries_visibility(bool visible, const ModelObject* mo, int instance_idx)
|
||||
void GLCanvas3D::toggle_selected_volume_visibility(bool selected_visible)
|
||||
{
|
||||
m_render_sla_auxiliaries = !selected_visible;
|
||||
if (selected_visible) {
|
||||
const Selection::IndicesList &idxs = m_selection.get_volume_idxs();
|
||||
if (idxs.size() > 0) {
|
||||
for (GLVolume *vol : m_volumes.volumes) {
|
||||
if (vol->composite_id.object_id >= 1000 && vol->composite_id.object_id < 1000 + wxGetApp().plater()->get_partplate_list().get_plate_count())
|
||||
continue; // the wipe tower
|
||||
if (vol->composite_id.volume_id >= 0) {
|
||||
vol->is_active = false;
|
||||
}
|
||||
}
|
||||
for (unsigned int idx : idxs) {
|
||||
GLVolume *v = const_cast<GLVolume *>(m_selection.get_volume(idx));
|
||||
v->is_active = true;
|
||||
}
|
||||
}
|
||||
} else { // show all
|
||||
for (GLVolume *vol : m_volumes.volumes) {
|
||||
if (vol->composite_id.object_id >= 1000 && vol->composite_id.object_id < 1000 + wxGetApp().plater()->get_partplate_list().get_plate_count())
|
||||
continue; // the wipe tower
|
||||
if (vol->composite_id.volume_id >= 0) {
|
||||
vol->is_active = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GLCanvas3D::toggle_sla_auxiliaries_visibility(bool visible, const ModelObject *mo, int instance_idx)
|
||||
{
|
||||
m_render_sla_auxiliaries = visible;
|
||||
|
||||
|
@ -730,6 +730,7 @@ public:
|
||||
const GCodeViewer::SequentialView& get_gcode_sequential_view() const { return m_gcode_viewer.get_sequential_view(); }
|
||||
void update_gcode_sequential_view_current(unsigned int first, unsigned int last) { m_gcode_viewer.update_sequential_view_current(first, last); }
|
||||
|
||||
void toggle_selected_volume_visibility(bool selected_visible);
|
||||
void toggle_sla_auxiliaries_visibility(bool visible, const ModelObject* mo = nullptr, int instance_idx = -1);
|
||||
void toggle_model_objects_visibility(bool visible, const ModelObject* mo = nullptr, int instance_idx = -1, const ModelVolume* mv = nullptr);
|
||||
void update_instance_printable_state_for_object(size_t obj_idx);
|
||||
|
Loading…
x
Reference in New Issue
Block a user