3DScene zoom functions moved to c++

This commit is contained in:
Enrico Turri 2018-05-15 10:32:38 +02:00
commit 7519e34507
8 changed files with 143 additions and 51 deletions

View file

@ -336,6 +336,18 @@ BoundingBoxf3 GLCanvas3D::max_bounding_box() const
return bb;
}
void GLCanvas3D::zoom_to_bed()
{
_zoom_to_bounding_box(bed_bounding_box());
}
void GLCanvas3D::zoom_to_volumes()
{
m_apply_zoom_to_volumes_filter = true;
_zoom_to_bounding_box(volumes_bounding_box());
m_apply_zoom_to_volumes_filter = false;
}
void GLCanvas3D::register_on_viewport_changed_callback(void* callback)
{
if (callback != nullptr)
@ -360,18 +372,6 @@ void GLCanvas3D::on_idle(wxIdleEvent& evt)
}
}
void GLCanvas3D::_zoom_to_bed()
{
_zoom_to_bounding_box(bed_bounding_box());
}
void GLCanvas3D::_zoom_to_volumes()
{
m_apply_zoom_to_volumes_filter = true;
_zoom_to_bounding_box(volumes_bounding_box());
m_apply_zoom_to_volumes_filter = false;
}
void GLCanvas3D::_zoom_to_bounding_box(const BoundingBoxf3& bbox)
{
// Calculate the zoom factor needed to adjust viewport to bounding box.