mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-13 13:09:04 +08:00
Stubbed out classes for 3D plater/preview, 2D preview (toolpaths), and DLP/SLA preview tabs.
This commit is contained in:
parent
bb615f5414
commit
375663c381
@ -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);
|
||||
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
|
||||
@ -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();
|
||||
|
||||
}
|
||||
|
||||
|
@ -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<int> load_file(const std::string file, const int obj_idx_to_load = -1);
|
||||
|
||||
|
@ -4,12 +4,23 @@
|
||||
#ifndef WX_PRECOMP
|
||||
#include <wx/wx.h>
|
||||
#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<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
|
||||
|
28
src/GUI/Plater/Preview2D.hpp
Normal file
28
src/GUI/Plater/Preview2D.hpp
Normal 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
|
@ -5,11 +5,23 @@
|
||||
#include <wx/wx.h>
|
||||
#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<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
|
||||
|
28
src/GUI/Plater/PreviewDLP.hpp
Normal file
28
src/GUI/Plater/PreviewDLP.hpp
Normal 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
|
Loading…
x
Reference in New Issue
Block a user