2018-09-17 10:15:11 +00:00
|
|
|
#ifndef slic3r_Plater_hpp_
|
|
|
|
#define slic3r_Plater_hpp_
|
|
|
|
|
|
|
|
#include <memory>
|
2018-10-08 17:14:55 +00:00
|
|
|
#include <vector>
|
2018-10-04 09:12:55 +00:00
|
|
|
#include <boost/filesystem/path.hpp>
|
2018-09-17 10:15:11 +00:00
|
|
|
|
|
|
|
#include <wx/panel.h>
|
2018-10-09 10:41:05 +00:00
|
|
|
#include <wx/bmpcbox.h>
|
2018-09-17 10:15:11 +00:00
|
|
|
|
|
|
|
#include "Preset.hpp"
|
|
|
|
|
2018-10-04 09:12:55 +00:00
|
|
|
class wxButton;
|
2018-10-10 11:53:45 +00:00
|
|
|
class wxBoxSizer;
|
2018-10-11 13:57:09 +00:00
|
|
|
class wxGLCanvas;
|
2018-11-09 17:39:07 +00:00
|
|
|
class wxScrolledWindow;
|
2018-10-04 09:12:55 +00:00
|
|
|
|
2018-09-17 10:15:11 +00:00
|
|
|
namespace Slic3r {
|
2018-10-04 14:43:10 +00:00
|
|
|
|
|
|
|
class Model;
|
2018-10-11 11:22:36 +00:00
|
|
|
class Print;
|
2018-11-12 16:35:57 +00:00
|
|
|
class SLAPrint;
|
|
|
|
|
2018-09-17 10:15:11 +00:00
|
|
|
namespace GUI {
|
|
|
|
|
|
|
|
class MainFrame;
|
2018-10-03 13:14:52 +00:00
|
|
|
class ConfigOptionsGroup;
|
2018-10-04 14:43:10 +00:00
|
|
|
class ObjectManipulation;
|
2018-11-09 17:39:07 +00:00
|
|
|
class ObjectSettings;
|
2018-10-05 21:29:15 +00:00
|
|
|
class ObjectList;
|
2018-10-03 13:14:52 +00:00
|
|
|
|
|
|
|
using t_optgroups = std::vector <std::shared_ptr<ConfigOptionsGroup>>;
|
2018-09-17 10:15:11 +00:00
|
|
|
|
2018-10-04 09:12:55 +00:00
|
|
|
class Plater;
|
|
|
|
|
2018-10-09 10:41:05 +00:00
|
|
|
class PresetComboBox : public wxBitmapComboBox
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
PresetComboBox(wxWindow *parent, Preset::Type preset_type);
|
|
|
|
~PresetComboBox();
|
|
|
|
|
|
|
|
void set_label_marker(int item);
|
2018-10-10 11:53:45 +00:00
|
|
|
void set_extruder_idx(const int extr_idx) { extruder_idx = extr_idx; }
|
|
|
|
int get_extruder_idx() const { return extruder_idx; }
|
2018-10-09 10:41:05 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
typedef std::size_t Marker;
|
|
|
|
enum { LABEL_ITEM_MARKER = 0x4d };
|
|
|
|
|
|
|
|
Preset::Type preset_type;
|
|
|
|
int last_selected;
|
2018-10-10 11:53:45 +00:00
|
|
|
int extruder_idx = -1;
|
2018-10-09 10:41:05 +00:00
|
|
|
};
|
|
|
|
|
2018-10-15 08:53:47 +00:00
|
|
|
enum ButtonAction
|
|
|
|
{
|
|
|
|
baUndef,
|
|
|
|
baReslice,
|
|
|
|
baExportGcode,
|
|
|
|
baSendGcode
|
|
|
|
};
|
|
|
|
|
2018-09-17 10:15:11 +00:00
|
|
|
class Sidebar : public wxPanel
|
|
|
|
{
|
2018-11-13 11:19:56 +00:00
|
|
|
/*ConfigMenuIDs*/int m_mode;
|
2018-09-17 10:15:11 +00:00
|
|
|
public:
|
2018-10-04 09:12:55 +00:00
|
|
|
Sidebar(Plater *parent);
|
2018-09-17 10:15:11 +00:00
|
|
|
Sidebar(Sidebar &&) = delete;
|
|
|
|
Sidebar(const Sidebar &) = delete;
|
|
|
|
Sidebar &operator=(Sidebar &&) = delete;
|
|
|
|
Sidebar &operator=(const Sidebar &) = delete;
|
|
|
|
~Sidebar();
|
|
|
|
|
2018-10-10 11:53:45 +00:00
|
|
|
void init_filament_combo(PresetComboBox **combo, const int extr_idx);
|
|
|
|
void remove_unused_filament_combos(const int current_extruder_count);
|
2018-09-17 10:15:11 +00:00
|
|
|
void update_presets(Slic3r::Preset::Type preset_type);
|
2018-10-03 13:14:52 +00:00
|
|
|
|
2018-10-09 10:41:05 +00:00
|
|
|
ObjectManipulation* obj_manipul();
|
2018-10-05 21:29:15 +00:00
|
|
|
ObjectList* obj_list();
|
2018-11-09 17:39:07 +00:00
|
|
|
ObjectSettings* obj_settings();
|
|
|
|
wxScrolledWindow* scrolled_panel();
|
2018-10-03 13:14:52 +00:00
|
|
|
|
2018-10-05 21:29:15 +00:00
|
|
|
ConfigOptionsGroup* og_freq_chng_params();
|
2018-10-03 13:14:52 +00:00
|
|
|
wxButton* get_wiping_dialog_button();
|
2018-10-04 14:43:10 +00:00
|
|
|
void update_objects_list_extruder_column(int extruders_count);
|
2018-11-13 11:19:56 +00:00
|
|
|
void show_info_sizer();
|
2018-10-31 11:26:57 +00:00
|
|
|
void show_sliced_info_sizer(const bool show);
|
2018-10-05 21:29:15 +00:00
|
|
|
void show_buttons(const bool show);
|
2018-10-15 08:53:47 +00:00
|
|
|
void show_button(ButtonAction but_action, bool show);
|
2018-10-08 17:14:55 +00:00
|
|
|
void enable_buttons(bool enable);
|
2018-10-09 10:41:05 +00:00
|
|
|
bool is_multifilament();
|
2018-11-13 11:19:56 +00:00
|
|
|
void set_mode_value(const /*ConfigMenuIDs*/int mode) { m_mode = mode; }
|
2018-10-04 14:43:10 +00:00
|
|
|
|
2018-10-10 11:53:45 +00:00
|
|
|
std::vector<PresetComboBox*>& combos_filament();
|
2018-09-17 10:15:11 +00:00
|
|
|
private:
|
|
|
|
struct priv;
|
|
|
|
std::unique_ptr<priv> p;
|
|
|
|
};
|
|
|
|
|
|
|
|
class Plater: public wxPanel
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Plater(wxWindow *parent, MainFrame *main_frame);
|
|
|
|
Plater(Plater &&) = delete;
|
|
|
|
Plater(const Plater &) = delete;
|
|
|
|
Plater &operator=(Plater &&) = delete;
|
|
|
|
Plater &operator=(const Plater &) = delete;
|
|
|
|
~Plater();
|
|
|
|
|
|
|
|
Sidebar& sidebar();
|
2018-10-11 11:22:36 +00:00
|
|
|
Model& model();
|
|
|
|
Print& print();
|
2018-09-17 10:15:11 +00:00
|
|
|
|
2018-11-15 14:27:39 +00:00
|
|
|
#if ENABLE_NEW_MENU_LAYOUT
|
|
|
|
void load_project();
|
|
|
|
void add_model();
|
2018-11-16 08:26:41 +00:00
|
|
|
void extract_config_from_project();
|
2018-11-15 14:27:39 +00:00
|
|
|
#else
|
2018-10-17 10:17:25 +00:00
|
|
|
void add();
|
2018-11-15 14:27:39 +00:00
|
|
|
#endif // ENABLE_NEW_MENU_LAYOUT
|
2018-10-17 10:17:25 +00:00
|
|
|
|
2018-11-16 08:26:41 +00:00
|
|
|
#if ENABLE_NEW_MENU_LAYOUT
|
|
|
|
void load_files(const std::vector<boost::filesystem::path>& input_files, bool load_model = true, bool load_config = true);
|
|
|
|
#else
|
2018-10-11 08:03:38 +00:00
|
|
|
void load_files(const std::vector<boost::filesystem::path> &input_files);
|
2018-11-16 08:26:41 +00:00
|
|
|
#endif // ENABLE_NEW_MENU_LAYOUT
|
2018-09-17 10:15:11 +00:00
|
|
|
|
2018-11-21 12:32:24 +00:00
|
|
|
void update();
|
2018-10-17 10:59:58 +00:00
|
|
|
void select_view(const std::string& direction);
|
|
|
|
|
2018-10-04 09:12:55 +00:00
|
|
|
void remove(size_t obj_idx);
|
2018-11-13 13:17:35 +00:00
|
|
|
void delete_object_from_model(size_t obj_idx);
|
2018-10-04 09:12:55 +00:00
|
|
|
void remove_selected();
|
2018-10-18 13:09:41 +00:00
|
|
|
void increase_instances(size_t num = 1);
|
|
|
|
void decrease_instances(size_t num = 1);
|
2018-10-25 19:13:45 +00:00
|
|
|
void set_number_of_copies(/*size_t num*/);
|
2018-10-08 17:14:55 +00:00
|
|
|
|
2018-10-18 13:13:38 +00:00
|
|
|
void cut(size_t obj_idx, size_t instance_idx, coordf_t z);
|
|
|
|
|
2018-10-04 09:12:55 +00:00
|
|
|
// Note: empty path means "use the default"
|
2018-10-23 13:27:31 +00:00
|
|
|
void export_gcode(boost::filesystem::path output_path = boost::filesystem::path());
|
2018-10-04 09:12:55 +00:00
|
|
|
void export_stl();
|
|
|
|
void export_amf();
|
2018-11-15 14:27:39 +00:00
|
|
|
#if ENABLE_NEW_MENU_LAYOUT
|
|
|
|
void export_3mf(const boost::filesystem::path& output_path = boost::filesystem::path());
|
|
|
|
#else
|
2018-10-04 09:12:55 +00:00
|
|
|
void export_3mf();
|
2018-11-15 14:27:39 +00:00
|
|
|
#endif // ENABLE_NEW_MENU_LAYOUT
|
2018-09-17 10:15:11 +00:00
|
|
|
void reslice();
|
2018-10-31 14:41:27 +00:00
|
|
|
void changed_object(int obj_idx);
|
2018-11-07 12:40:24 +00:00
|
|
|
void fix_through_netfabb(const int obj_idx);
|
2018-10-04 09:12:55 +00:00
|
|
|
void send_gcode();
|
2018-10-10 11:53:45 +00:00
|
|
|
|
|
|
|
void on_extruders_change(int extruders_count);
|
2018-10-17 09:12:38 +00:00
|
|
|
void on_config_change(const DynamicPrintConfig &config);
|
2018-10-11 13:57:09 +00:00
|
|
|
|
2018-11-15 14:27:39 +00:00
|
|
|
#if ENABLE_NEW_MENU_LAYOUT
|
|
|
|
const wxString& get_project_filename() const;
|
|
|
|
bool is_export_gcode_scheduled() const;
|
|
|
|
#endif // ENABLE_NEW_MENU_LAYOUT
|
|
|
|
|
2018-11-01 11:33:56 +00:00
|
|
|
int get_selected_object_idx();
|
2018-11-13 14:24:05 +00:00
|
|
|
bool is_single_full_object_selection() const;
|
2018-10-11 13:57:09 +00:00
|
|
|
wxGLCanvas* canvas3D();
|
2018-11-12 16:35:57 +00:00
|
|
|
|
|
|
|
PrinterTechnology printer_technology() const;
|
2018-09-17 10:15:11 +00:00
|
|
|
private:
|
|
|
|
struct priv;
|
|
|
|
std::unique_ptr<priv> p;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
#endif
|