Do not select wipe tower when using Select all command

This commit is contained in:
Enrico Turri 2018-11-23 11:47:18 +01:00
parent bcf7a1f751
commit cabfca1031
2 changed files with 10 additions and 2 deletions

View File

@ -1320,10 +1320,12 @@ void GLCanvas3D::Selection::add_all()
return;
m_mode = Instance;
clear();
for (unsigned int i = 0; i < (unsigned int)m_volumes->size(); ++i)
{
_add_volume(i);
if (!(*m_volumes)[i]->is_wipe_tower)
_add_volume(i);
}
_update_type();
@ -1399,6 +1401,12 @@ bool GLCanvas3D::Selection::is_single_full_instance() const
return false;
}
bool GLCanvas3D::Selection::is_from_single_object() const
{
int idx = get_object_idx();
return (0 <= idx) && (idx < 1000);
}
int GLCanvas3D::Selection::get_object_idx() const
{
return (m_cache.content.size() == 1) ? m_cache.content.begin()->first : -1;

View File

@ -501,7 +501,7 @@ public:
bool is_multiple_volume() const { return m_type == MultipleVolume; }
bool is_mixed() const { return m_type == Mixed; }
bool is_from_single_instance() const { return get_instance_idx() != -1; }
bool is_from_single_object() const { return get_object_idx() != -1; }
bool is_from_single_object() const;
bool contains_volume(unsigned int volume_idx) const { return std::find(m_list.begin(), m_list.end(), volume_idx) != m_list.end(); }