mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 00:37:51 -06:00
Improved Selection from ObjectList side
This commit is contained in:
parent
a71f05cdc0
commit
8631cb006b
6 changed files with 117 additions and 22 deletions
|
@ -1238,6 +1238,32 @@ unsigned int PrusaObjectDataViewModel::GetChildren(const wxDataViewItem &parent,
|
|||
return count;
|
||||
}
|
||||
|
||||
void PrusaObjectDataViewModel::GetAllChildren(const wxDataViewItem &parent, wxDataViewItemArray &array) const
|
||||
{
|
||||
PrusaObjectDataViewModelNode *node = (PrusaObjectDataViewModelNode*)parent.GetID();
|
||||
if (!node) {
|
||||
for (auto object : m_objects)
|
||||
array.Add(wxDataViewItem((void*)object));
|
||||
}
|
||||
else if (node->GetChildCount() == 0)
|
||||
return;
|
||||
else {
|
||||
const size_t count = node->GetChildren().GetCount();
|
||||
for (size_t pos = 0; pos < count; pos++) {
|
||||
PrusaObjectDataViewModelNode *child = node->GetChildren().Item(pos);
|
||||
array.Add(wxDataViewItem((void*)child));
|
||||
}
|
||||
}
|
||||
|
||||
wxDataViewItemArray new_array = array;
|
||||
for (const auto item : new_array)
|
||||
{
|
||||
wxDataViewItemArray children;
|
||||
GetAllChildren(item, children);
|
||||
WX_APPEND_ARRAY(array, children);
|
||||
}
|
||||
}
|
||||
|
||||
ItemType PrusaObjectDataViewModel::GetItemType(const wxDataViewItem &item) const
|
||||
{
|
||||
if (!item.IsOk())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue