mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-14 19:12:38 -07:00
WIP Undo / Redo : serialization / deserialization of object selection.
This commit is contained in:
@@ -311,6 +311,24 @@ void Selection::add_all()
|
||||
this->set_bounding_boxes_dirty();
|
||||
}
|
||||
|
||||
void Selection::set_deserialized(EMode mode, const std::vector<std::pair<ObjectID, ObjectID>> &volumes_and_instances)
|
||||
{
|
||||
if (! m_valid)
|
||||
return;
|
||||
|
||||
m_mode = mode;
|
||||
for (unsigned int i : m_list)
|
||||
(*m_volumes)[i]->selected = false;
|
||||
m_list.clear();
|
||||
for (unsigned int i = 0; i < (unsigned int)m_volumes->size(); ++ i) {
|
||||
const GLVolume::CompositeID &id = (*m_volumes)[i]->composite_id;
|
||||
if (std::binary_search(volumes_and_instances.begin(), volumes_and_instances.end(), std::make_pair<ObjectID, ObjectID>(id.volume_id, id.instance_id)))
|
||||
this->do_add_volume(i);
|
||||
}
|
||||
update_type();
|
||||
this->set_bounding_boxes_dirty();
|
||||
}
|
||||
|
||||
void Selection::clear()
|
||||
{
|
||||
if (!m_valid)
|
||||
|
||||
Reference in New Issue
Block a user