mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 15:44:12 -06:00
3DScene reset_object method moved to c++
This commit is contained in:
parent
5fc8fdee11
commit
a7fc57a176
12 changed files with 135 additions and 31 deletions
|
@ -395,6 +395,16 @@ void GLCanvas3D::CuttingPlane::render_contour()
|
|||
::glDisableClientState(GL_VERTEX_ARRAY);
|
||||
}
|
||||
|
||||
GLCanvas3D::LayersEditing::LayersEditing()
|
||||
: m_enabled(false)
|
||||
{
|
||||
}
|
||||
|
||||
bool GLCanvas3D::LayersEditing::is_enabled() const
|
||||
{
|
||||
return m_enabled;
|
||||
}
|
||||
|
||||
GLCanvas3D::GLCanvas3D(wxGLCanvas* canvas, wxGLContext* context)
|
||||
: m_canvas(canvas)
|
||||
, m_context(context)
|
||||
|
@ -409,10 +419,15 @@ GLCanvas3D::~GLCanvas3D()
|
|||
_deregister_callbacks();
|
||||
}
|
||||
|
||||
void GLCanvas3D::set_current()
|
||||
bool GLCanvas3D::set_current()
|
||||
{
|
||||
if ((m_canvas != nullptr) && (m_context != nullptr))
|
||||
{
|
||||
m_canvas->SetCurrent(*m_context);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GLCanvas3D::is_dirty() const
|
||||
|
@ -507,6 +522,16 @@ void GLCanvas3D::set_volumes(GLVolumeCollection* volumes)
|
|||
m_volumes = volumes;
|
||||
}
|
||||
|
||||
void GLCanvas3D::reset_volumes()
|
||||
{
|
||||
if (set_current() && (m_volumes != nullptr))
|
||||
{
|
||||
m_volumes->release_geometry();
|
||||
m_volumes->clear();
|
||||
set_dirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
void GLCanvas3D::set_bed_shape(const Pointfs& shape)
|
||||
{
|
||||
m_bed.set_shape(shape);
|
||||
|
@ -652,6 +677,11 @@ BoundingBoxf3 GLCanvas3D::max_bounding_box() const
|
|||
return bb;
|
||||
}
|
||||
|
||||
bool GLCanvas3D::is_layers_editing_enabled() const
|
||||
{
|
||||
return m_layers_editing.is_enabled();
|
||||
}
|
||||
|
||||
void GLCanvas3D::zoom_to_bed()
|
||||
{
|
||||
_zoom_to_bounding_box(bed_bounding_box());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue