mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Cutting
This commit is contained in:
parent
4c007a410c
commit
6629d75853
19 changed files with 502 additions and 182 deletions
|
@ -6,7 +6,13 @@
|
|||
#include "../../libslic3r/Point.hpp"
|
||||
#include "../../libslic3r/BoundingBox.hpp"
|
||||
|
||||
#include <array>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
|
||||
class wxWindow;
|
||||
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
|
@ -120,6 +126,8 @@ public:
|
|||
void render(const GLCanvas3D::Selection& selection) const { on_render(selection); }
|
||||
void render_for_picking(const GLCanvas3D::Selection& selection) const { on_render_for_picking(selection); }
|
||||
|
||||
virtual void create_external_gizmo_widgets(wxWindow *parent);
|
||||
|
||||
protected:
|
||||
virtual bool on_init() = 0;
|
||||
virtual std::string on_get_name() const = 0;
|
||||
|
@ -450,6 +458,43 @@ protected:
|
|||
bool on_is_activable(const GLCanvas3D::Selection& selection) const override;
|
||||
};
|
||||
|
||||
|
||||
class GLGizmoCutPanel;
|
||||
|
||||
class GLGizmoCut : public GLGizmoBase
|
||||
{
|
||||
static const double Offset;
|
||||
static const double Margin;
|
||||
static const std::array<float, 3> GrabberColor;
|
||||
|
||||
double m_cut_z;
|
||||
double m_start_z;
|
||||
double m_max_z;
|
||||
Vec3d m_drag_pos;
|
||||
Vec3d m_drag_center;
|
||||
GLGizmoCutPanel *m_panel;
|
||||
|
||||
public:
|
||||
explicit GLGizmoCut(GLCanvas3D& parent);
|
||||
|
||||
virtual void create_external_gizmo_widgets(wxWindow *parent);
|
||||
|
||||
protected:
|
||||
virtual bool on_init();
|
||||
virtual std::string on_get_name() const;
|
||||
virtual void on_set_state();
|
||||
virtual bool on_is_activable(const GLCanvas3D::Selection& selection) const;
|
||||
virtual void on_start_dragging(const GLCanvas3D::Selection& selection);
|
||||
virtual void on_update(const UpdateData& data);
|
||||
virtual void on_render(const GLCanvas3D::Selection& selection) const;
|
||||
virtual void on_render_for_picking(const GLCanvas3D::Selection& selection) const;
|
||||
|
||||
private:
|
||||
void perform_cut();
|
||||
double calc_projection(const Linef3& mouse_ray) const;
|
||||
};
|
||||
|
||||
|
||||
} // namespace GUI
|
||||
} // namespace Slic3r
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue