diff options
author | bubnikv <bubnikv@gmail.com> | 2018-09-19 12:02:24 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2018-09-19 12:02:24 +0300 |
commit | 0558b53493a77bae44831cf87bb0f59359828ef5 (patch) | |
tree | c3e8dbdf7d91a051c12d9ebbf7606d41047fea96 /src/slic3r/GUI/BedShapeDialog.hpp | |
parent | 3ddaccb6410478ad02d8c0e02d6d8e6eb1785b9f (diff) |
WIP: Moved sources int src/, separated most of the source code from Perl.
The XS was left only for the unit / integration tests, and it links
libslic3r only. No wxWidgets are allowed to be used from Perl starting
from now.
Diffstat (limited to 'src/slic3r/GUI/BedShapeDialog.hpp')
-rw-r--r-- | src/slic3r/GUI/BedShapeDialog.hpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/slic3r/GUI/BedShapeDialog.hpp b/src/slic3r/GUI/BedShapeDialog.hpp new file mode 100644 index 000000000..d8ba5a912 --- /dev/null +++ b/src/slic3r/GUI/BedShapeDialog.hpp @@ -0,0 +1,56 @@ +#ifndef slic3r_BedShapeDialog_hpp_ +#define slic3r_BedShapeDialog_hpp_ +// The bed shape dialog. +// The dialog opens from Print Settins tab->Bed Shape : Set... + +#include "OptionsGroup.hpp" +#include "2DBed.hpp" + + +#include <wx/dialog.h> +#include <wx/choicebk.h> + +namespace Slic3r { +namespace GUI { + +using ConfigOptionsGroupShp = std::shared_ptr<ConfigOptionsGroup>; +class BedShapePanel : public wxPanel +{ + wxChoicebook* m_shape_options_book; + Bed_2D* m_canvas; + + std::vector <ConfigOptionsGroupShp> m_optgroups; + +public: + BedShapePanel(wxWindow* parent) : wxPanel(parent, wxID_ANY){} + ~BedShapePanel(){} + + void build_panel(ConfigOptionPoints* default_pt); + + ConfigOptionsGroupShp init_shape_options_page(wxString title); + void set_shape(ConfigOptionPoints* points); + void update_preview(); + void update_shape(); + void load_stl(); + + // Returns the resulting bed shape polygon. This value will be stored to the ini file. + std::vector<Vec2d> GetValue() { return m_canvas->m_bed_shape; } +}; + +class BedShapeDialog : public wxDialog +{ + BedShapePanel* m_panel; +public: + BedShapeDialog(wxWindow* parent) : wxDialog(parent, wxID_ANY, _(L("Bed Shape")), + wxDefaultPosition, wxSize(350, 700), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER){} + ~BedShapeDialog(){ } + + void build_dialog(ConfigOptionPoints* default_pt); + std::vector<Vec2d> GetValue() { return m_panel->GetValue(); } +}; + +} // GUI +} // Slic3r + + +#endif /* slic3r_BedShapeDialog_hpp_ */ |