diff --git a/src/GUI/Plater.cpp b/src/GUI/Plater.cpp index 25b99ec16..d743cd37d 100644 --- a/src/GUI/Plater.cpp +++ b/src/GUI/Plater.cpp @@ -63,6 +63,18 @@ Plater::Plater(wxWindow* parent, const wxString& title, std::shared_ptrAddPage(canvas2D, _("2D")); + + canvas3D = new Plate3D(preview_notebook, wxDefaultSize, objects, model, config, settings); + preview_notebook->AddPage(canvas3D, _("3D")); + + preview3D = new Preview3D(preview_notebook, wxDefaultSize, objects, model, config, settings); + preview_notebook->AddPage(preview3D, _("Preview")); + + preview2D = new Preview2D(preview_notebook, wxDefaultSize, objects, model, config, settings); + preview_notebook->AddPage(preview2D, _("Toolpaths")); + + previewDLP = new PreviewDLP(preview_notebook, wxDefaultSize, objects, model, config, settings); + preview_notebook->AddPage(previewDLP, _("DLP/SLA")); /* # Initialize 2D preview canvas @@ -369,6 +381,11 @@ void Plater::refresh_canvases() { this->canvas3D->update(); if (this->preview3D != nullptr) this->preview3D->reload_print(); + if (this->preview2D != nullptr) + this->preview2D->reload_print(); + + if (this->previewDLP != nullptr) + this->previewDLP->reload_print(); } diff --git a/src/GUI/Plater.hpp b/src/GUI/Plater.hpp index 9ad6df3a3..a306217ce 100644 --- a/src/GUI/Plater.hpp +++ b/src/GUI/Plater.hpp @@ -17,7 +17,10 @@ #include "Plater/PlaterObject.hpp" #include "Plater/Plate2D.hpp" #include "Plater/Plate3D.hpp" +#include "Plater/Preview2D.hpp" #include "Plater/Preview3D.hpp" +#include "Plater/PreviewDLP.hpp" + #include "Settings.hpp" #include "MainFrame.hpp" @@ -76,8 +79,11 @@ private: Plate2D* canvas2D {nullptr}; //< 2D plater canvas Plate3D* canvas3D {nullptr}; //< 3D plater canvas + Preview2D* preview2D {nullptr}; //< 2D Preview Preview3D* preview3D {nullptr}; //< 3D Preview + PreviewDLP* previewDLP {nullptr}; //< DLP/SLA Preview canvas + /// Handles the actual load of the file from the dialog handoff. std::vector load_file(const std::string file, const int obj_idx_to_load = -1); diff --git a/src/GUI/Plater/Plate3D.hpp b/src/GUI/Plater/Plate3D.hpp index 488e35019..7df04abcb 100644 --- a/src/GUI/Plater/Plate3D.hpp +++ b/src/GUI/Plater/Plate3D.hpp @@ -4,12 +4,23 @@ #ifndef WX_PRECOMP #include #endif +#include "Settings.hpp" +#include "Model.hpp" +#include "Config.hpp" namespace Slic3r { namespace GUI { class Plate3D : public wxPanel { public: void update() {}; + Plate3D(wxWindow* parent, const wxSize& size, std::vector& _objects, std::shared_ptr _model, std::shared_ptr _config, std::shared_ptr _settings) : + wxPanel(parent, wxID_ANY, wxDefaultPosition, size, wxTAB_TRAVERSAL), objects(_objects), model(_model), config(_config), settings(_settings) + {} +private: + std::vector& objects; //< reference to parent vector + std::shared_ptr model; + std::shared_ptr config; + std::shared_ptr settings; }; } } // Namespace Slic3r::GUI diff --git a/src/GUI/Plater/Preview2D.hpp b/src/GUI/Plater/Preview2D.hpp new file mode 100644 index 000000000..9aa4c37f7 --- /dev/null +++ b/src/GUI/Plater/Preview2D.hpp @@ -0,0 +1,28 @@ +#ifndef PREVIEW2D_HPP +#define PREVIEW2D_HPP +#include +#ifndef WX_PRECOMP + #include +#endif + +#include "Settings.hpp" +#include "Model.hpp" +#include "Config.hpp" + +namespace Slic3r { namespace GUI { + +class Preview2D : public wxPanel { +public: + void reload_print() {}; + Preview2D(wxWindow* parent, const wxSize& size, std::vector& _objects, std::shared_ptr _model, std::shared_ptr _config, std::shared_ptr _settings) : + wxPanel(parent, wxID_ANY, wxDefaultPosition, size, wxTAB_TRAVERSAL), objects(_objects), model(_model), config(_config), settings(_settings) + {} +private: + std::vector& objects; //< reference to parent vector + std::shared_ptr model; + std::shared_ptr config; + std::shared_ptr settings; +}; + +} } // Namespace Slic3r::GUI +#endif diff --git a/src/GUI/Plater/Preview3D.hpp b/src/GUI/Plater/Preview3D.hpp index cd4e0a283..2baa63900 100644 --- a/src/GUI/Plater/Preview3D.hpp +++ b/src/GUI/Plater/Preview3D.hpp @@ -5,11 +5,23 @@ #include #endif +#include "Settings.hpp" +#include "Model.hpp" +#include "Config.hpp" + namespace Slic3r { namespace GUI { class Preview3D : public wxPanel { public: void reload_print() {}; + Preview3D(wxWindow* parent, const wxSize& size, std::vector& _objects, std::shared_ptr _model, std::shared_ptr _config, std::shared_ptr _settings) : + wxPanel(parent, wxID_ANY, wxDefaultPosition, size, wxTAB_TRAVERSAL), objects(_objects), model(_model), config(_config), settings(_settings) + {} +private: + std::vector& objects; //< reference to parent vector + std::shared_ptr model; + std::shared_ptr config; + std::shared_ptr settings; }; } } // Namespace Slic3r::GUI diff --git a/src/GUI/Plater/PreviewDLP.hpp b/src/GUI/Plater/PreviewDLP.hpp new file mode 100644 index 000000000..090483cc1 --- /dev/null +++ b/src/GUI/Plater/PreviewDLP.hpp @@ -0,0 +1,28 @@ +#ifndef PREVIEWDLP_HPP +#define PREVIEWDLP_HPP +#include +#ifndef WX_PRECOMP + #include +#endif + +#include "Settings.hpp" +#include "Model.hpp" +#include "Config.hpp" + +namespace Slic3r { namespace GUI { + +class PreviewDLP : public wxPanel { +public: + void reload_print() {}; + PreviewDLP(wxWindow* parent, const wxSize& size, std::vector& _objects, std::shared_ptr _model, std::shared_ptr _config, std::shared_ptr _settings) : + wxPanel(parent, wxID_ANY, wxDefaultPosition, size, wxTAB_TRAVERSAL), objects(_objects), model(_model), config(_config), settings(_settings) + {} +private: + std::vector& objects; //< reference to parent vector + std::shared_ptr model; + std::shared_ptr config; + std::shared_ptr settings; +}; + +} } // Namespace Slic3r::GUI +#endif