mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 15:44:12 -06:00
3DScene zoom functions moved to c++
This commit is contained in:
commit
7519e34507
8 changed files with 143 additions and 51 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue