mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-30 16:42:43 +00:00
3DScene bed origin moved to c++
This commit is contained in:
@@ -1767,6 +1767,17 @@ void _3DScene::set_bed_shape(wxGLCanvas* canvas, const Pointfs& shape)
|
||||
return s_canvas_mgr.set_bed_shape(canvas, shape);
|
||||
}
|
||||
|
||||
Pointf _3DScene::get_bed_origin(wxGLCanvas* canvas)
|
||||
{
|
||||
return s_canvas_mgr.get_bed_origin(canvas);
|
||||
}
|
||||
|
||||
void _3DScene::set_bed_origin(wxGLCanvas* canvas, const Pointf* origin)
|
||||
{
|
||||
if (origin != nullptr)
|
||||
s_canvas_mgr.set_bed_origin(canvas, *origin);
|
||||
}
|
||||
|
||||
BoundingBoxf3 _3DScene::get_bed_bounding_box(wxGLCanvas* canvas)
|
||||
{
|
||||
return s_canvas_mgr.get_bed_bounding_box(canvas);
|
||||
|
||||
@@ -551,6 +551,9 @@ public:
|
||||
|
||||
static void set_bed_shape(wxGLCanvas* canvas, const Pointfs& shape);
|
||||
|
||||
static Pointf get_bed_origin(wxGLCanvas* canvas);
|
||||
static void set_bed_origin(wxGLCanvas* canvas, const Pointf* origin);
|
||||
|
||||
static BoundingBoxf3 get_bed_bounding_box(wxGLCanvas* canvas);
|
||||
static BoundingBoxf3 get_volumes_bounding_box(wxGLCanvas* canvas);
|
||||
static BoundingBoxf3 get_max_bounding_box(wxGLCanvas* canvas);
|
||||
|
||||
@@ -119,6 +119,16 @@ const BoundingBoxf3& GLCanvas3D::Bed::get_bounding_box() const
|
||||
return m_bounding_box;
|
||||
}
|
||||
|
||||
const Pointf& GLCanvas3D::Bed::get_origin() const
|
||||
{
|
||||
return m_origin;
|
||||
}
|
||||
|
||||
void GLCanvas3D::Bed::set_origin(const Pointf& origin)
|
||||
{
|
||||
m_origin = origin;
|
||||
}
|
||||
|
||||
void GLCanvas3D::Bed::_calc_bounding_box()
|
||||
{
|
||||
m_bounding_box = BoundingBoxf3();
|
||||
@@ -235,6 +245,16 @@ void GLCanvas3D::set_bed_shape(const Pointfs& shape)
|
||||
m_bed.set_shape(shape);
|
||||
}
|
||||
|
||||
const Pointf& GLCanvas3D::get_bed_origin() const
|
||||
{
|
||||
return m_bed.get_origin();
|
||||
}
|
||||
|
||||
void GLCanvas3D::set_bed_origin(const Pointf& origin)
|
||||
{
|
||||
m_bed.set_origin(origin);
|
||||
}
|
||||
|
||||
bool GLCanvas3D::is_dirty() const
|
||||
{
|
||||
return m_dirty;
|
||||
|
||||
@@ -64,6 +64,7 @@ public:
|
||||
{
|
||||
Pointfs m_shape;
|
||||
BoundingBoxf3 m_bounding_box;
|
||||
Pointf m_origin;
|
||||
|
||||
public:
|
||||
const Pointfs& get_shape() const;
|
||||
@@ -71,6 +72,9 @@ public:
|
||||
|
||||
const BoundingBoxf3& get_bounding_box() const;
|
||||
|
||||
const Pointf& get_origin() const;
|
||||
void set_origin(const Pointf& origin);
|
||||
|
||||
private:
|
||||
void _calc_bounding_box();
|
||||
};
|
||||
@@ -103,6 +107,9 @@ public:
|
||||
|
||||
void set_bed_shape(const Pointfs& shape);
|
||||
|
||||
const Pointf& get_bed_origin() const;
|
||||
void set_bed_origin(const Pointf& origin);
|
||||
|
||||
bool is_dirty() const;
|
||||
void set_dirty(bool dirty);
|
||||
|
||||
|
||||
@@ -180,6 +180,19 @@ void GLCanvas3DManager::set_bed_shape(wxGLCanvas* canvas, const Pointfs& shape)
|
||||
it->second->set_bed_shape(shape);
|
||||
}
|
||||
|
||||
Pointf GLCanvas3DManager::get_bed_origin(wxGLCanvas* canvas) const
|
||||
{
|
||||
CanvasesMap::const_iterator it = _get_canvas(canvas);
|
||||
return (it != m_canvases.end()) ? it->second->get_bed_origin() : Pointf();
|
||||
}
|
||||
|
||||
void GLCanvas3DManager::set_bed_origin(wxGLCanvas* canvas, const Pointf& origin)
|
||||
{
|
||||
CanvasesMap::iterator it = _get_canvas(canvas);
|
||||
if (it != m_canvases.end())
|
||||
it->second->set_bed_origin(origin);
|
||||
}
|
||||
|
||||
BoundingBoxf3 GLCanvas3DManager::get_bed_bounding_box(wxGLCanvas* canvas)
|
||||
{
|
||||
CanvasesMap::const_iterator it = _get_canvas(canvas);
|
||||
|
||||
@@ -61,6 +61,9 @@ public:
|
||||
|
||||
void set_bed_shape(wxGLCanvas* canvas, const Pointfs& shape);
|
||||
|
||||
Pointf get_bed_origin(wxGLCanvas* canvas) const;
|
||||
void set_bed_origin(wxGLCanvas* canvas, const Pointf& origin);
|
||||
|
||||
BoundingBoxf3 get_bed_bounding_box(wxGLCanvas* canvas);
|
||||
BoundingBoxf3 get_volumes_bounding_box(wxGLCanvas* canvas);
|
||||
BoundingBoxf3 get_max_bounding_box(wxGLCanvas* canvas);
|
||||
|
||||
@@ -215,6 +215,21 @@ set_bed_shape(canvas, shape)
|
||||
CODE:
|
||||
_3DScene::set_bed_shape((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), shape);
|
||||
|
||||
Clone<Pointf>
|
||||
get_bed_origin(canvas)
|
||||
SV *canvas;
|
||||
CODE:
|
||||
RETVAL = _3DScene::get_bed_origin((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
void
|
||||
set_bed_origin(canvas, origin)
|
||||
SV *canvas;
|
||||
Pointf *origin
|
||||
CODE:
|
||||
_3DScene::set_bed_origin((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), origin);
|
||||
|
||||
Clone<BoundingBoxf3>
|
||||
get_bed_bounding_box(canvas)
|
||||
SV *canvas;
|
||||
|
||||
Reference in New Issue
Block a user