PrusaSlicer-NonPlainar/src/slic3r/GUI/Plater.hpp

122 lines
3.0 KiB
C++
Raw Normal View History

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;
class wxBoxSizer;
2018-10-04 09:12:55 +00:00
2018-09-17 10:15:11 +00:00
namespace Slic3r {
class Model;
2018-09-17 10:15:11 +00:00
namespace GUI {
class MainFrame;
2018-10-03 13:14:52 +00:00
class ConfigOptionsGroup;
class ObjectManipulation;
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);
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;
int extruder_idx = -1;
2018-10-09 10:41:05 +00:00
};
2018-09-17 10:15:11 +00:00
class Sidebar : public wxPanel
{
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();
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-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();
void update_objects_list_extruder_column(int extruders_count);
int get_ol_selection();
2018-10-05 21:29:15 +00:00
void show_info_sizers(const bool show);
void show_buttons(const 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();
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();
Model& model();
2018-09-17 10:15:11 +00:00
2018-10-04 09:12:55 +00:00
void update(bool force_autocenter = false);
void remove(size_t obj_idx);
void remove_selected();
2018-10-08 17:14:55 +00:00
void load_files(const std::vector<boost::filesystem::path> &input_files);
2018-10-04 09:12:55 +00:00
// Note: empty path means "use the default"
boost::filesystem::path export_gcode(const boost::filesystem::path &output_path = boost::filesystem::path());
void export_stl();
void export_amf();
void export_3mf();
2018-09-17 10:15:11 +00:00
void reslice();
void changed_object_settings(int obj_idx);
2018-10-04 09:12:55 +00:00
void send_gcode();
void on_extruders_change(int extruders_count);
void on_config_change(DynamicPrintConfig* config);
2018-09-17 10:15:11 +00:00
private:
struct priv;
std::unique_ptr<priv> p;
};
}}
#endif