mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-10 08:17:51 -06:00
ObjectList: Fixed update of the selection, when some gizmo in 3D-Scene is activated
This commit is contained in:
parent
cb294e0b3e
commit
4fe6f726de
3 changed files with 20 additions and 24 deletions
|
@ -2470,28 +2470,22 @@ void ObjectList::unselect_objects()
|
||||||
m_prevent_list_events = false;
|
m_prevent_list_events = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectList::select_current_object(int idx)
|
void ObjectList::select_object_item(bool is_msr_gizmo)
|
||||||
{
|
{
|
||||||
m_prevent_list_events = true;
|
if (wxDataViewItem item = GetSelection()) {
|
||||||
UnselectAll();
|
ItemType type = m_objects_model->GetItemType(item);
|
||||||
if (idx >= 0)
|
bool is_volume_item = type == itVolume || type == itSettings && m_objects_model->GetItemType(m_objects_model->GetParent(item)) == itVolume;
|
||||||
Select(m_objects_model->GetItemById(idx));
|
if (is_msr_gizmo && is_volume_item || type == itObject)
|
||||||
part_selection_changed();
|
return;
|
||||||
m_prevent_list_events = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ObjectList::select_current_volume(int idx, int vol_idx)
|
if (wxDataViewItem obj_item = m_objects_model->GetTopParent(item)) {
|
||||||
{
|
m_prevent_list_events = true;
|
||||||
if (vol_idx < 0) {
|
UnselectAll();
|
||||||
select_current_object(idx);
|
Select(obj_item);
|
||||||
return;
|
part_selection_changed();
|
||||||
|
m_prevent_list_events = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
m_prevent_list_events = true;
|
|
||||||
UnselectAll();
|
|
||||||
if (idx >= 0)
|
|
||||||
Select(m_objects_model->GetItemByVolumeId(idx, vol_idx));
|
|
||||||
part_selection_changed();
|
|
||||||
m_prevent_list_events = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void update_selection(wxDataViewItemArray& sels, ObjectList::SELECTION_MODE mode, ObjectDataViewModel* model)
|
static void update_selection(wxDataViewItemArray& sels, ObjectList::SELECTION_MODE mode, ObjectDataViewModel* model)
|
||||||
|
|
|
@ -291,10 +291,9 @@ public:
|
||||||
// #ys_FIXME_to_delete
|
// #ys_FIXME_to_delete
|
||||||
// Unselect all objects in the list on c++ side
|
// Unselect all objects in the list on c++ side
|
||||||
void unselect_objects();
|
void unselect_objects();
|
||||||
// Select current object in the list on c++ side
|
// Select object item in the ObjectList, when some gizmo is activated
|
||||||
void select_current_object(int idx);
|
// "is_msr_gizmo" indicates if Move/Scale/Rotate gizmo was activated
|
||||||
// Select current volume in the list on c++ side
|
void select_object_item(bool is_msr_gizmo);
|
||||||
void select_current_volume(int idx, int vol_idx);
|
|
||||||
|
|
||||||
// Remove objects/sub-object from the list
|
// Remove objects/sub-object from the list
|
||||||
void remove();
|
void remove();
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "slic3r/GUI/Camera.hpp"
|
#include "slic3r/GUI/Camera.hpp"
|
||||||
#include "slic3r/GUI/GUI_App.hpp"
|
#include "slic3r/GUI/GUI_App.hpp"
|
||||||
#include "slic3r/GUI/GUI_ObjectManipulation.hpp"
|
#include "slic3r/GUI/GUI_ObjectManipulation.hpp"
|
||||||
|
#include "slic3r/GUI/GUI_ObjectList.hpp"
|
||||||
#include "slic3r/GUI/Plater.hpp"
|
#include "slic3r/GUI/Plater.hpp"
|
||||||
#include "slic3r/Utils/UndoRedo.hpp"
|
#include "slic3r/Utils/UndoRedo.hpp"
|
||||||
#include "slic3r/GUI/NotificationManager.hpp"
|
#include "slic3r/GUI/NotificationManager.hpp"
|
||||||
|
@ -1084,8 +1085,10 @@ void GLGizmosManager::update_on_off_state(const Vec2d& mouse_pos)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
size_t idx = get_gizmo_idx_from_mouse(mouse_pos);
|
size_t idx = get_gizmo_idx_from_mouse(mouse_pos);
|
||||||
if (idx != Undefined && m_gizmos[idx]->is_activable() && m_hover == idx)
|
if (idx != Undefined && m_gizmos[idx]->is_activable() && m_hover == idx) {
|
||||||
activate_gizmo(m_current == idx ? Undefined : (EType)idx);
|
activate_gizmo(m_current == idx ? Undefined : (EType)idx);
|
||||||
|
wxGetApp().obj_list()->select_object_item((EType)idx <= Rotate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GLGizmosManager::update_hover_state(const Vec2d& mouse_pos)
|
std::string GLGizmosManager::update_hover_state(const Vec2d& mouse_pos)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue