Stubbed out classes for 3D plater/preview, 2D preview (toolpaths), and DLP/SLA preview tabs.

This commit is contained in:
Joseph Lenox 2018-05-09 23:03:06 -05:00 committed by Joseph Lenox
parent bb615f5414
commit 375663c381
6 changed files with 102 additions and 0 deletions

View File

@ -63,6 +63,18 @@ Plater::Plater(wxWindow* parent, const wxString& title, std::shared_ptr<Settings
*/ */
canvas2D = new Plate2D(preview_notebook, wxDefaultSize, objects, model, config, settings); canvas2D = new Plate2D(preview_notebook, wxDefaultSize, objects, model, config, settings);
preview_notebook->AddPage(canvas2D, _("2D")); preview_notebook->AddPage(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 # Initialize 2D preview canvas
@ -369,6 +381,11 @@ void Plater::refresh_canvases() {
this->canvas3D->update(); this->canvas3D->update();
if (this->preview3D != nullptr) if (this->preview3D != nullptr)
this->preview3D->reload_print(); this->preview3D->reload_print();
if (this->preview2D != nullptr)
this->preview2D->reload_print();
if (this->previewDLP != nullptr)
this->previewDLP->reload_print();
} }

View File

@ -17,7 +17,10 @@
#include "Plater/PlaterObject.hpp" #include "Plater/PlaterObject.hpp"
#include "Plater/Plate2D.hpp" #include "Plater/Plate2D.hpp"
#include "Plater/Plate3D.hpp" #include "Plater/Plate3D.hpp"
#include "Plater/Preview2D.hpp"
#include "Plater/Preview3D.hpp" #include "Plater/Preview3D.hpp"
#include "Plater/PreviewDLP.hpp"
#include "Settings.hpp" #include "Settings.hpp"
#include "MainFrame.hpp" #include "MainFrame.hpp"
@ -76,8 +79,11 @@ private:
Plate2D* canvas2D {nullptr}; //< 2D plater canvas Plate2D* canvas2D {nullptr}; //< 2D plater canvas
Plate3D* canvas3D {nullptr}; //< 3D plater canvas Plate3D* canvas3D {nullptr}; //< 3D plater canvas
Preview2D* preview2D {nullptr}; //< 2D Preview
Preview3D* preview3D {nullptr}; //< 3D Preview Preview3D* preview3D {nullptr}; //< 3D Preview
PreviewDLP* previewDLP {nullptr}; //< DLP/SLA Preview canvas
/// Handles the actual load of the file from the dialog handoff. /// Handles the actual load of the file from the dialog handoff.
std::vector<int> load_file(const std::string file, const int obj_idx_to_load = -1); std::vector<int> load_file(const std::string file, const int obj_idx_to_load = -1);

View File

@ -4,12 +4,23 @@
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include <wx/wx.h> #include <wx/wx.h>
#endif #endif
#include "Settings.hpp"
#include "Model.hpp"
#include "Config.hpp"
namespace Slic3r { namespace GUI { namespace Slic3r { namespace GUI {
class Plate3D : public wxPanel { class Plate3D : public wxPanel {
public: public:
void update() {}; void update() {};
Plate3D(wxWindow* parent, const wxSize& size, std::vector<PlaterObject>& _objects, std::shared_ptr<Model> _model, std::shared_ptr<Config> _config, std::shared_ptr<Settings> _settings) :
wxPanel(parent, wxID_ANY, wxDefaultPosition, size, wxTAB_TRAVERSAL), objects(_objects), model(_model), config(_config), settings(_settings)
{}
private:
std::vector<PlaterObject>& objects; //< reference to parent vector
std::shared_ptr<Slic3r::Model> model;
std::shared_ptr<Slic3r::Config> config;
std::shared_ptr<Settings> settings;
}; };
} } // Namespace Slic3r::GUI } } // Namespace Slic3r::GUI

View File

@ -0,0 +1,28 @@
#ifndef PREVIEW2D_HPP
#define PREVIEW2D_HPP
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#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<PlaterObject>& _objects, std::shared_ptr<Model> _model, std::shared_ptr<Config> _config, std::shared_ptr<Settings> _settings) :
wxPanel(parent, wxID_ANY, wxDefaultPosition, size, wxTAB_TRAVERSAL), objects(_objects), model(_model), config(_config), settings(_settings)
{}
private:
std::vector<PlaterObject>& objects; //< reference to parent vector
std::shared_ptr<Slic3r::Model> model;
std::shared_ptr<Slic3r::Config> config;
std::shared_ptr<Settings> settings;
};
} } // Namespace Slic3r::GUI
#endif

View File

@ -5,11 +5,23 @@
#include <wx/wx.h> #include <wx/wx.h>
#endif #endif
#include "Settings.hpp"
#include "Model.hpp"
#include "Config.hpp"
namespace Slic3r { namespace GUI { namespace Slic3r { namespace GUI {
class Preview3D : public wxPanel { class Preview3D : public wxPanel {
public: public:
void reload_print() {}; void reload_print() {};
Preview3D(wxWindow* parent, const wxSize& size, std::vector<PlaterObject>& _objects, std::shared_ptr<Model> _model, std::shared_ptr<Config> _config, std::shared_ptr<Settings> _settings) :
wxPanel(parent, wxID_ANY, wxDefaultPosition, size, wxTAB_TRAVERSAL), objects(_objects), model(_model), config(_config), settings(_settings)
{}
private:
std::vector<PlaterObject>& objects; //< reference to parent vector
std::shared_ptr<Slic3r::Model> model;
std::shared_ptr<Slic3r::Config> config;
std::shared_ptr<Settings> settings;
}; };
} } // Namespace Slic3r::GUI } } // Namespace Slic3r::GUI

View File

@ -0,0 +1,28 @@
#ifndef PREVIEWDLP_HPP
#define PREVIEWDLP_HPP
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#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<PlaterObject>& _objects, std::shared_ptr<Model> _model, std::shared_ptr<Config> _config, std::shared_ptr<Settings> _settings) :
wxPanel(parent, wxID_ANY, wxDefaultPosition, size, wxTAB_TRAVERSAL), objects(_objects), model(_model), config(_config), settings(_settings)
{}
private:
std::vector<PlaterObject>& objects; //< reference to parent vector
std::shared_ptr<Slic3r::Model> model;
std::shared_ptr<Slic3r::Config> config;
std::shared_ptr<Settings> settings;
};
} } // Namespace Slic3r::GUI
#endif