AABB trees for SLA gizmos are not calculated when the object is selected, but only after one of the gizmos is opened

This commit is contained in:
Lukas Matena 2020-02-20 14:28:45 +01:00
parent 487ac0423e
commit 4df6a645f2
5 changed files with 38 additions and 20 deletions

View file

@ -371,13 +371,7 @@ bool CommonGizmosData::update_from_backend(GLCanvas3D& canvas, ModelObject* mode
m_model_object_id = m_model_object->id();
if (m_mesh != m_old_mesh) {
wxBusyCursor wait;
m_mesh_raycaster.reset(new MeshRaycaster(*m_mesh));
m_object_clipper.reset();
m_supports_clipper.reset();
m_old_mesh = m_mesh;
m_clipping_plane_distance = 0.f;
m_clipping_plane_distance_stash = 0.f;
m_schedule_aabb_calculation = true;
recent_update = true;
return true;
}
@ -388,6 +382,21 @@ bool CommonGizmosData::update_from_backend(GLCanvas3D& canvas, ModelObject* mode
}
void CommonGizmosData::build_AABB_if_needed()
{
if (! m_schedule_aabb_calculation)
return;
wxBusyCursor wait;
m_mesh_raycaster.reset(new MeshRaycaster(*m_mesh));
m_object_clipper.reset();
m_supports_clipper.reset();
m_old_mesh = m_mesh;
m_clipping_plane_distance = 0.f;
m_clipping_plane_distance_stash = 0.f;
m_schedule_aabb_calculation = false;
}
} // namespace GUI
} // namespace Slic3r