mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-10 16:27:54 -06:00
NEW: first layer printing sequence
Change-Id: I19e39a27cf972eb859e51a334aeae8f57ee263f8 (cherry picked from commit 1369107c04668f800a338395ed3af316c32d194d)
This commit is contained in:
parent
d5e5992b02
commit
d9a8526843
8 changed files with 490 additions and 6 deletions
65
src/slic3r/GUI/DragCanvas.hpp
Normal file
65
src/slic3r/GUI/DragCanvas.hpp
Normal file
|
@ -0,0 +1,65 @@
|
|||
#ifndef slic3r_GUI_DragCanvas_hpp_
|
||||
#define slic3r_GUI_DragCanvas_hpp_
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/dragimag.h"
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
class DragShape : public wxObject
|
||||
{
|
||||
public:
|
||||
DragShape(const wxBitmap& bitmap, int index);
|
||||
~DragShape() {}
|
||||
|
||||
wxPoint GetPosition() const { return m_pos; }
|
||||
void SetPosition(const wxPoint& pos) { m_pos = pos; }
|
||||
|
||||
const wxBitmap& GetBitmap() const { return m_bitmap; }
|
||||
void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
|
||||
|
||||
int get_index() { return m_index; }
|
||||
|
||||
bool hit_test(const wxPoint& pt) const;
|
||||
void paint(wxDC& dc, bool highlight = false);
|
||||
|
||||
protected:
|
||||
wxPoint m_pos;
|
||||
wxBitmap m_bitmap;
|
||||
int m_index;
|
||||
};
|
||||
|
||||
|
||||
enum class DragMode {
|
||||
NONE,
|
||||
DRAGGING,
|
||||
};
|
||||
class DragCanvas : public wxPanel
|
||||
{
|
||||
public:
|
||||
DragCanvas(wxWindow* parent, const std::vector<std::string>& colors, const std::vector<int>& order);
|
||||
~DragCanvas();
|
||||
void set_shape_list(const std::vector<std::string>& colors, const std::vector<int>& order);
|
||||
std::vector<int> get_shape_list_order();
|
||||
std::vector<DragShape*> get_ordered_shape_list();
|
||||
|
||||
protected:
|
||||
void on_paint(wxPaintEvent& event);
|
||||
void on_erase(wxEraseEvent& event);
|
||||
void on_mouse(wxMouseEvent& event);
|
||||
DragShape* find_shape(const wxPoint& pt) const;
|
||||
|
||||
private:
|
||||
std::vector<DragShape*> m_dragshape_list;
|
||||
DragMode m_drag_mode;
|
||||
DragShape* m_dragging_shape{ nullptr };
|
||||
DragShape* m_slot_shape{ nullptr }; // The shape that's being highlighted
|
||||
wxDragImage* m_drag_image{ nullptr };
|
||||
wxPoint m_drag_start_pos;
|
||||
wxBitmap m_arrow_bmp;
|
||||
wxPoint m_max_shape_pos;
|
||||
};
|
||||
|
||||
|
||||
}}
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue