Merge with bibnikv.

Added some functions to TabIface.
Added BedShapeDialog & Bed2D classes.
Added new_scale to Polygon.
In class Field: Point renamed to PointCtrl and added set_value for PointCtrl, extended get_value for Choice.
This commit is contained in:
YuSanka 2018-01-25 13:46:04 +01:00
parent a1705c093b
commit f0b035059a
18 changed files with 774 additions and 95 deletions

View file

@ -0,0 +1,50 @@
// 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);
// Returns the resulting bed shape polygon. This value will be stored to the ini file.
int GetValue() { return 1/*m_canvas->bed_shape*/; }
ConfigOptionsGroupShp init_shape_options_page(std::string title);
void set_shape(ConfigOptionPoints* points);
void update_preview();
void update_shape();
void load_stl();
};
class BedShapeDialog : public wxDialog
{
BedShapePanel* m_panel;
public:
BedShapeDialog(wxWindow* parent) : wxDialog(parent, wxID_ANY, "Bed Shape",
wxDefaultPosition, wxSize(350, 700), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER){}
~BedShapeDialog(){}
void build_dialog(ConfigOptionPoints* default_pt);
int GetValue() { return m_panel->GetValue(); }
};
} // GUI
} // Slic3r