Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::GUI::Plater Class Reference

#include <src/slic3r/GUI/Plater.hpp>

+ Inheritance diagram for Slic3r::GUI::Plater:
+ Collaboration diagram for Slic3r::GUI::Plater:

Classes

struct  priv
 
class  SuppressSnapshots
 
class  TakeSnapshot
 

Public Types

enum class  UpdateParams { FORCE_FULL_SCREEN_REFRESH = 1 , FORCE_BACKGROUND_PROCESSING_UPDATE = 2 , POSTPONE_VALIDATION_ERROR_MESSAGE = 4 }
 
using fs_path = boost::filesystem::path
 

Public Member Functions

 Plater (wxWindow *parent, MainFrame *main_frame)
 
 Plater (Plater &&)=delete
 
 Plater (const Plater &)=delete
 
Plateroperator= (Plater &&)=delete
 
Plateroperator= (const Plater &)=delete
 
 ~Plater ()=default
 
bool is_project_dirty () const
 
bool is_presets_dirty () const
 
void update_project_dirty_from_presets ()
 
int save_project_if_dirty (const wxString &reason)
 
void reset_project_dirty_after_save ()
 
void reset_project_dirty_initial_presets ()
 
bool is_project_temp () const
 
Sidebarsidebar ()
 
const Modelmodel () const
 
Modelmodel ()
 
const Printfff_print () const
 
Printfff_print ()
 
const SLAPrintsla_print () const
 
SLAPrintsla_print ()
 
void new_project ()
 
void load_project ()
 
void load_project (const wxString &filename)
 
void add_model (bool imperial_units=false)
 
void import_zip_archive ()
 
void import_sl1_archive ()
 
void extract_config_from_project ()
 
void load_gcode ()
 
void load_gcode (const wxString &filename)
 
void reload_gcode_from_disk ()
 
void refresh_print ()
 
std::vector< size_t > load_files (const std::vector< boost::filesystem::path > &input_files, bool load_model=true, bool load_config=true, bool imperial_units=false)
 
std::vector< size_t > load_files (const std::vector< std::string > &input_files, bool load_model=true, bool load_config=true, bool imperial_units=false)
 
bool load_files (const wxArrayString &filenames, bool delete_after_load=false)
 
void check_selected_presets_visibility (PrinterTechnology loaded_printer_technology)
 
bool preview_zip_archive (const boost::filesystem::path &input_file)
 
const wxString & get_last_loaded_gcode () const
 
void update (unsigned int flags=0)
 
Workerget_ui_job_worker ()
 
const Workerget_ui_job_worker () const
 
void select_view (const std::string &direction)
 
void select_view_3D (const std::string &name)
 
bool is_preview_shown () const
 
bool is_preview_loaded () const
 
bool is_view3D_shown () const
 
bool are_view3D_labels_shown () const
 
void show_view3D_labels (bool show)
 
bool is_legend_shown () const
 
void show_legend (bool show)
 
bool is_sidebar_collapsed () const
 
void collapse_sidebar (bool show)
 
bool is_view3D_layers_editing_enabled () const
 
void update_ui_from_settings ()
 
void select_all ()
 
void deselect_all ()
 
void remove (size_t obj_idx)
 
void reset ()
 
void reset_with_confirm ()
 
bool delete_object_from_model (size_t obj_idx)
 
void remove_selected ()
 
void increase_instances (size_t num=1, int obj_idx=-1, int inst_idx=-1)
 
void decrease_instances (size_t num=1, int obj_idx=-1)
 
void set_number_of_copies ()
 
void fill_bed_with_instances ()
 
bool is_selection_empty () const
 
void scale_selection_to_fit_print_volume ()
 
void convert_unit (ConversionType conv_type)
 
void toggle_layers_editing (bool enable)
 
void cut (size_t obj_idx, size_t instance_idx, const Transform3d &cut_matrix, ModelObjectCutAttributes attributes)
 
void cut (size_t init_obj_idx, const ModelObjectPtrs &cut_objects)
 
void export_gcode (bool prefer_removable)
 
void export_stl_obj (bool extended=false, bool selection_only=false)
 
void export_amf ()
 
bool export_3mf (const boost::filesystem::path &output_path=boost::filesystem::path())
 
void reload_from_disk ()
 
void replace_with_stl ()
 
void reload_all_from_disk ()
 
bool has_toolpaths_to_export () const
 
void export_toolpaths_to_obj () const
 
void reslice ()
 
void reslice_FFF_until_step (PrintObjectStep step, const ModelObject &object, bool postpone_error_messages=false)
 
void reslice_SLA_until_step (SLAPrintObjectStep step, const ModelObject &object, bool postpone_error_messages=false)
 
void clear_before_change_mesh (int obj_idx, const std::string &notification_msg)
 
void changed_mesh (int obj_idx)
 
void changed_object (int obj_idx)
 
void changed_objects (const std::vector< size_t > &object_idxs)
 
void schedule_background_process (bool schedule=true)
 
bool is_background_process_update_scheduled () const
 
void suppress_background_process (const bool stop_background_process)
 
void send_gcode ()
 
void eject_drive ()
 
void take_snapshot (const std::string &snapshot_name)
 
void take_snapshot (const wxString &snapshot_name)
 
void take_snapshot (const std::string &snapshot_name, UndoRedo::SnapshotType snapshot_type)
 
void take_snapshot (const wxString &snapshot_name, UndoRedo::SnapshotType snapshot_type)
 
void undo ()
 
void redo ()
 
void undo_to (int selection)
 
void redo_to (int selection)
 
bool undo_redo_string_getter (const bool is_undo, int idx, const char **out_text)
 
void undo_redo_topmost_string_getter (const bool is_undo, std::string &out_text)
 
bool search_string_getter (int idx, const char **label, const char **tooltip)
 
const Slic3r::UndoRedo::Stackundo_redo_stack_main () const
 
void clear_undo_redo_stack_main ()
 
void enter_gizmos_stack ()
 
void leave_gizmos_stack ()
 
void on_extruders_change (size_t extruders_count)
 
bool update_filament_colors_in_full_config ()
 
void on_config_change (const DynamicPrintConfig &config)
 
void force_filament_colors_update ()
 
void force_filament_cb_update ()
 
void force_print_bed_update ()
 
void on_activate ()
 
std::vector< std::string > get_extruder_colors_from_plater_config (const GCodeProcessorResult *const result=nullptr) const
 
std::vector< std::string > get_colors_for_color_print (const GCodeProcessorResult *const result=nullptr) const
 
void update_menus ()
 
void show_action_buttons (const bool is_ready_to_slice) const
 
void show_action_buttons () const
 
wxString get_project_filename (const wxString &extension=wxEmptyString) const
 
void set_project_filename (const wxString &filename)
 
bool is_export_gcode_scheduled () const
 
const Selectionget_selection () const
 
int get_selected_object_idx ()
 
bool is_single_full_object_selection () const
 
GLCanvas3Dcanvas3D ()
 
const GLCanvas3Dcanvas3D () const
 
GLCanvas3Dget_current_canvas3D ()
 
void arrange ()
 
void set_current_canvas_as_dirty ()
 
void unbind_canvas_event_handlers ()
 
void reset_canvas_volumes ()
 
PrinterTechnology printer_technology () const
 
const DynamicPrintConfigconfig () const
 
bool set_printer_technology (PrinterTechnology printer_technology)
 
void copy_selection_to_clipboard ()
 
void paste_from_clipboard ()
 
void search (bool plater_is_active)
 
void mirror (Axis axis)
 
void split_object ()
 
void split_volume ()
 
bool can_delete () const
 
bool can_delete_all () const
 
bool can_increase_instances () const
 
bool can_decrease_instances (int obj_idx=-1) const
 
bool can_set_instance_to_object () const
 
bool can_fix_through_netfabb () const
 
bool can_simplify () const
 
bool can_split_to_objects () const
 
bool can_split_to_volumes () const
 
bool can_arrange () const
 
bool can_layers_editing () const
 
bool can_paste_from_clipboard () const
 
bool can_copy_to_clipboard () const
 
bool can_undo () const
 
bool can_redo () const
 
bool can_reload_from_disk () const
 
bool can_replace_with_stl () const
 
bool can_mirror () const
 
bool can_split (bool to_objects) const
 
bool can_scale_to_print_volume () const
 
void msw_rescale ()
 
void sys_color_changed ()
 
bool init_view_toolbar ()
 
void enable_view_toolbar (bool enable)
 
bool init_collapse_toolbar ()
 
void enable_collapse_toolbar (bool enable)
 
const Cameraget_camera () const
 
Cameraget_camera ()
 
const BuildVolumebuild_volume () const
 
const GLToolbarget_view_toolbar () const
 
GLToolbarget_view_toolbar ()
 
const GLToolbarget_collapse_toolbar () const
 
GLToolbarget_collapse_toolbar ()
 
void set_preview_layers_slider_values_range (int bottom, int top)
 
void update_preview_moves_slider ()
 
void enable_preview_moves_slider (bool enable)
 
void reset_gcode_toolpaths ()
 
void reset_last_loaded_gcode ()
 
const Mouse3DControllerget_mouse3d_controller () const
 
Mouse3DControllerget_mouse3d_controller ()
 
void set_bed_shape () const
 
void set_bed_shape (const Pointfs &shape, const double max_print_height, const std::string &custom_texture, const std::string &custom_model, bool force_as_custom=false) const
 
void set_default_bed_shape () const
 
NotificationManagerget_notification_manager ()
 
const NotificationManagerget_notification_manager () const
 
void init_notification_manager ()
 
void bring_instance_forward ()
 
bool inside_snapshot_capture ()
 
void toggle_render_statistic_dialog ()
 
bool is_render_statistic_dialog_visible () const
 
void set_keep_current_preview_type (bool value)
 
bool PopupMenu (wxMenu *menu, const wxPoint &pos=wxDefaultPosition)
 
bool PopupMenu (wxMenu *menu, int x, int y)
 
wxMenu * object_menu ()
 
wxMenu * part_menu ()
 
wxMenu * text_part_menu ()
 
wxMenu * sla_object_menu ()
 
wxMenu * default_menu ()
 
wxMenu * instance_menu ()
 
wxMenu * layer_menu ()
 
wxMenu * multi_selection_menu ()
 

Static Public Member Functions

static bool has_illegal_filename_characters (const wxString &name)
 
static bool has_illegal_filename_characters (const std::string &name)
 
static void show_illegal_characters_warning (wxWindow *parent)
 

Private Member Functions

void reslice_until_step_inner (int step, const ModelObject &object, bool postpone_error_messages)
 
void suppress_snapshots ()
 
void allow_snapshots ()
 

Private Attributes

std::unique_ptr< privp
 
bool m_tracking_popup_menu = false
 
wxString m_tracking_popup_menu_error_message
 
wxString m_last_loaded_gcode
 

Friends

class SuppressBackgroundProcessingUpdate
 

Detailed Description

Member Typedef Documentation

◆ fs_path

using Slic3r::GUI::Plater::fs_path = boost::filesystem::path

Member Enumeration Documentation

◆ UpdateParams

Enumerator
FORCE_FULL_SCREEN_REFRESH 
FORCE_BACKGROUND_PROCESSING_UPDATE 
POSTPONE_VALIDATION_ERROR_MESSAGE 

Constructor & Destructor Documentation

◆ Plater() [1/3]

Slic3r::GUI::Plater::Plater ( wxWindow *  parent,
MainFrame main_frame 
)
5205 : wxPanel(parent, wxID_ANY, wxDefaultPosition, wxGetApp().get_min_size())
5206 , p(new priv(this, main_frame))
5207{
5208 // Initialization performed in the private c-tor
5209}
std::unique_ptr< priv > p
Definition Plater.hpp:494
Definition CutSurface.cpp:39

◆ Plater() [2/3]

Slic3r::GUI::Plater::Plater ( Plater &&  )
delete

◆ Plater() [3/3]

Slic3r::GUI::Plater::Plater ( const Plater )
delete

◆ ~Plater()

Slic3r::GUI::Plater::~Plater ( )
default

Member Function Documentation

◆ add_model()

void Slic3r::GUI::Plater::add_model ( bool  imperial_units = false)
5297{
5298 wxArrayString input_files;
5299 wxGetApp().import_model(this, input_files);
5300 if (input_files.empty())
5301 return;
5302
5303 std::vector<fs::path> paths;
5304 for (const auto &file : input_files)
5305 paths.emplace_back(into_path(file));
5306
5307 wxString snapshot_label;
5308 assert(! paths.empty());
5309 if (paths.size() == 1) {
5310 snapshot_label = _L("Import Object");
5311 snapshot_label += ": ";
5312 snapshot_label += wxString::FromUTF8(paths.front().filename().string().c_str());
5313 } else {
5314 snapshot_label = _L("Import Objects");
5315 snapshot_label += ": ";
5316 snapshot_label += wxString::FromUTF8(paths.front().filename().string().c_str());
5317 for (size_t i = 1; i < paths.size(); ++ i) {
5318 snapshot_label += ", ";
5319 snapshot_label += wxString::FromUTF8(paths[i].filename().string().c_str());
5320 }
5321 }
5322
5323 Plater::TakeSnapshot snapshot(this, snapshot_label);
5324 if (! load_files(paths, true, false, imperial_units).empty())
5325 wxGetApp().mainframe->update_title();
5326}
std::vector< size_t > load_files(const std::vector< boost::filesystem::path > &input_files, bool load_model=true, bool load_config=true, bool imperial_units=false)
boost::filesystem::path into_path(const wxString &str)
Definition GUI.cpp:457
bool empty(const BoundingBoxBase< PointType, PointsType > &bb)
Definition BoundingBox.hpp:229
#define _L(s)
Definition I18N.hpp:3

References _L, Slic3r::empty(), Slic3r::GUI::into_path(), and load_files().

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ allow_snapshots()

void Slic3r::GUI::Plater::allow_snapshots ( )
private
6896{ p->allow_snapshots(); }

References p.

Referenced by Slic3r::GUI::Plater::SuppressSnapshots::~SuppressSnapshots(), and Slic3r::GUI::Plater::TakeSnapshot::~TakeSnapshot().

+ Here is the caller graph for this function:

◆ are_view3D_labels_shown()

bool Slic3r::GUI::Plater::are_view3D_labels_shown ( ) const
6084{ return p->are_view3D_labels_shown(); }

References p.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the caller graph for this function:

◆ arrange()

void Slic3r::GUI::Plater::arrange ( )
7242{
7243 if (p->can_arrange()) {
7244 auto &w = get_ui_job_worker();
7245 p->take_snapshot(_L("Arrange"));
7246
7247 auto mode = wxGetKeyState(WXK_SHIFT) ? ArrangeJob::SelectionOnly :
7249
7250 replace_job(w, std::make_unique<ArrangeJob>(mode));
7251 }
7252}
@ SelectionOnly
Definition ArrangeJob.hpp:44
@ Full
Definition ArrangeJob.hpp:44
Worker & get_ui_job_worker()
Definition Plater.cpp:6070
bool replace_job(Worker &w, Args &&...args)
Definition Worker.hpp:96
IGL_INLINE void mode(const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &X, const int d, Eigen::Matrix< T, Eigen::Dynamic, 1 > &M)
Definition mode.cpp:14

References _L, Slic3r::GUI::ArrangeJob::Full, get_ui_job_worker(), p, Slic3r::GUI::replace_job(), and Slic3r::GUI::ArrangeJob::SelectionOnly.

Referenced by increase_instances().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bring_instance_forward()

void Slic3r::GUI::Plater::bring_instance_forward ( )
7703{
7704 p->bring_instance_forward();
7705}

References p.

◆ build_volume()

const BuildVolume & Slic3r::GUI::Plater::build_volume ( ) const
7536{
7537 return p->bed.build_volume();
7538}

References p.

Referenced by Slic3r::GUI::bed_stride(), and priv::start_create_object_job().

+ Here is the caller graph for this function:

◆ can_arrange()

bool Slic3r::GUI::Plater::can_arrange ( ) const
7614{ return p->can_arrange(); }

References p.

◆ can_copy_to_clipboard()

bool Slic3r::GUI::Plater::can_copy_to_clipboard ( ) const
7638{
7639 if (is_selection_empty())
7640 return false;
7641
7642 const Selection& selection = p->view3D->get_canvas3d()->get_selection();
7643 if ((wxGetApp().preset_bundle->printers.get_edited_preset().printer_technology() == ptSLA) && !selection.is_sla_compliant())
7644 return false;
7645
7646 return true;
7647}
bool is_selection_empty() const
Definition Plater.cpp:6268
@ ptSLA
Definition Config.hpp:209

References is_selection_empty(), Slic3r::GUI::Selection::is_sla_compliant(), p, and Slic3r::ptSLA.

Referenced by copy_selection_to_clipboard(), and Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ can_decrease_instances()

bool Slic3r::GUI::Plater::can_decrease_instances ( int  obj_idx = -1) const
7608{ return p->can_decrease_instances(obj_idx); }

References p.

Referenced by Slic3r::GUI::MenuFactory::append_menu_items_instance_manipulation(), Slic3r::GUI::Plater::priv::can_decrease_instances(), and decrease_instances().

+ Here is the caller graph for this function:

◆ can_delete()

bool Slic3r::GUI::Plater::can_delete ( ) const
7605{ return p->can_delete(); }

References p.

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_delete().

+ Here is the caller graph for this function:

◆ can_delete_all()

bool Slic3r::GUI::Plater::can_delete_all ( ) const
7606{ return p->can_delete_all(); }

References p.

◆ can_fix_through_netfabb()

bool Slic3r::GUI::Plater::can_fix_through_netfabb ( ) const
7610{ return p->can_fix_through_netfabb(); }

References p.

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_fix_through_netfabb().

+ Here is the caller graph for this function:

◆ can_increase_instances()

bool Slic3r::GUI::Plater::can_increase_instances ( ) const
7607{ return p->can_increase_instances(); }

References p.

Referenced by Slic3r::GUI::MenuFactory::append_menu_items_instance_manipulation(), increase_instances(), and Slic3r::GUI::MenuFactory::multi_selection_menu().

+ Here is the caller graph for this function:

◆ can_layers_editing()

bool Slic3r::GUI::Plater::can_layers_editing ( ) const
7615{ return p->can_layers_editing(); }

References p.

◆ can_mirror()

bool Slic3r::GUI::Plater::can_mirror ( ) const
7653{ return p->can_mirror(); }

References p.

Referenced by Slic3r::GUI::MenuFactory::append_menu_items_mirror().

+ Here is the caller graph for this function:

◆ can_paste_from_clipboard()

bool Slic3r::GUI::Plater::can_paste_from_clipboard ( ) const
7617{
7618 const Selection& selection = p->view3D->get_canvas3d()->get_selection();
7619 const Selection::Clipboard& clipboard = selection.get_clipboard();
7620
7621 if (clipboard.is_empty() && p->sidebar->obj_list()->clipboard_is_empty())
7622 return false;
7623
7624 if ((wxGetApp().preset_bundle->printers.get_edited_preset().printer_technology() == ptSLA) && !clipboard.is_sla_compliant())
7625 return false;
7626
7627 Selection::EMode mode = clipboard.get_mode();
7628 if ((mode == Selection::Volume) && !selection.is_from_single_instance())
7629 return false;
7630
7631 if ((mode == Selection::Instance) && (selection.get_mode() != Selection::Instance))
7632 return false;
7633
7634 return true;
7635}
EMode
Definition Selection.hpp:36
@ Instance
Definition Selection.hpp:38
@ Volume
Definition Selection.hpp:37

References Slic3r::GUI::Selection::get_clipboard(), Slic3r::GUI::Selection::Clipboard::get_mode(), Slic3r::GUI::Selection::get_mode(), Slic3r::GUI::Selection::Instance, Slic3r::GUI::Selection::Clipboard::is_empty(), Slic3r::GUI::Selection::is_from_single_instance(), Slic3r::GUI::Selection::Clipboard::is_sla_compliant(), p, Slic3r::ptSLA, and Slic3r::GUI::Selection::Volume.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor(), and paste_from_clipboard().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ can_redo()

bool Slic3r::GUI::Plater::can_redo ( ) const
7650{ return p->undo_redo_stack().has_redo_snapshot(); }

References p.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the caller graph for this function:

◆ can_reload_from_disk()

bool Slic3r::GUI::Plater::can_reload_from_disk ( ) const
7651{ return p->can_reload_from_disk(); }

References p.

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_reload_from_disk().

+ Here is the caller graph for this function:

◆ can_replace_with_stl()

bool Slic3r::GUI::Plater::can_replace_with_stl ( ) const
7652{ return p->can_replace_with_stl(); }

References p.

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_replace_with_stl().

+ Here is the caller graph for this function:

◆ can_scale_to_print_volume()

bool Slic3r::GUI::Plater::can_scale_to_print_volume ( ) const
7655{ return p->can_scale_to_print_volume(); }

References p.

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_scale_selection_to_fit_print_volume().

+ Here is the caller graph for this function:

◆ can_set_instance_to_object()

bool Slic3r::GUI::Plater::can_set_instance_to_object ( ) const
7609{ return p->can_set_instance_to_object(); }

References p.

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_instance_to_object().

+ Here is the caller graph for this function:

◆ can_simplify()

bool Slic3r::GUI::Plater::can_simplify ( ) const
7611{ return p->can_simplify(); }

References p.

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_simplify().

+ Here is the caller graph for this function:

◆ can_split()

bool Slic3r::GUI::Plater::can_split ( bool  to_objects) const
7654{ return p->can_split(to_objects); }

References p.

Referenced by Slic3r::GUI::MenuFactory::append_menu_items_split(), and Slic3r::GUI::MenuFactory::create_part_menu().

+ Here is the caller graph for this function:

◆ can_split_to_objects()

bool Slic3r::GUI::Plater::can_split_to_objects ( ) const
7612{ return p->can_split_to_objects(); }

References p.

◆ can_split_to_volumes()

bool Slic3r::GUI::Plater::can_split_to_volumes ( ) const
7613{ return p->can_split_to_volumes(); }

References p.

◆ can_undo()

bool Slic3r::GUI::Plater::can_undo ( ) const
7649{ return p->undo_redo_stack().has_undo_snapshot(); }

References p.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the caller graph for this function:

◆ canvas3D() [1/2]

◆ canvas3D() [2/2]

const GLCanvas3D * Slic3r::GUI::Plater::canvas3D ( ) const
7232{
7233 return p->view3D->get_canvas3d();
7234}

References p.

◆ changed_mesh()

void Slic3r::GUI::Plater::changed_mesh ( int  obj_idx)
7343{
7344 ModelObject* mo = model().objects[obj_idx];
7346 update();
7347 p->object_list_changed();
7348 p->schedule_background_process();
7349}
void update(unsigned int flags=0)
Definition Plater.cpp:6068
const Model & model() const
Definition Plater.cpp:5222
ModelObjectPtrs objects
Definition Model.hpp:1254
void reproject_points_and_holes(ModelObject *object)
Definition ReprojectPointsOnMesh.hpp:28

References model(), Slic3r::Model::objects, p, Slic3r::sla::reproject_points_and_holes(), and update().

Referenced by Slic3r::GUI::GLGizmoSimplify::apply_simplify(), and Slic3r::GUI::ObjectList::fix_through_netfabb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ changed_object()

void Slic3r::GUI::Plater::changed_object ( int  obj_idx)
7352{
7353 if (obj_idx < 0)
7354 return;
7355 // recenter and re - align to Z = 0
7356 p->model.objects[obj_idx]->ensure_on_bed(p->printer_technology != ptSLA);
7357 if (this->p->printer_technology == ptSLA) {
7358 // Update the SLAPrint from the current Model, so that the reload_scene()
7359 // pulls the correct data, update the 3D scene.
7360 this->p->update_restart_background_process(true, false);
7361 }
7362 else
7363 p->view3D->reload_scene(false);
7364
7365 // update print
7366 this->p->schedule_background_process();
7367}

References p, and Slic3r::ptSLA.

◆ changed_objects()

void Slic3r::GUI::Plater::changed_objects ( const std::vector< size_t > &  object_idxs)
7370{
7371 if (object_idxs.empty())
7372 return;
7373
7374 for (size_t obj_idx : object_idxs) {
7375 if (obj_idx < p->model.objects.size()) {
7376 if (p->model.objects[obj_idx]->min_z() >= SINKING_Z_THRESHOLD)
7377 // re - align to Z = 0
7378 p->model.objects[obj_idx]->ensure_on_bed();
7379 }
7380 }
7381 if (this->p->printer_technology == ptSLA) {
7382 // Update the SLAPrint from the current Model, so that the reload_scene()
7383 // pulls the correct data, update the 3D scene.
7384 this->p->update_restart_background_process(true, false);
7385 }
7386 else {
7387 p->view3D->reload_scene(false);
7388 p->view3D->get_canvas3d()->update_instance_printable_state_for_objects(object_idxs);
7389 }
7390
7391 // update print
7392 this->p->schedule_background_process();
7393}
static const float SINKING_Z_THRESHOLD
Definition Model.hpp:1409

References model(), Slic3r::Model::objects, p, Slic3r::ptSLA, and Slic3r::SINKING_Z_THRESHOLD.

+ Here is the call graph for this function:

◆ check_selected_presets_visibility()

void Slic3r::GUI::Plater::check_selected_presets_visibility ( PrinterTechnology  loaded_printer_technology)
2386{
2387 auto update_selected_preset_visibility = [](PresetCollection& presets, std::vector<std::string>& names) {
2388 if (!presets.get_selected_preset().is_visible) {
2389 assert(presets.get_selected_preset().name == presets.get_edited_preset().name);
2390 presets.get_selected_preset().is_visible = true;
2391 presets.get_edited_preset().is_visible = true;
2392 names.emplace_back(presets.get_selected_preset().name);
2393 }
2394 };
2395
2396 std::vector<std::string> names;
2397 PresetBundle* preset_bundle = wxGetApp().preset_bundle;
2398 if (loaded_printer_technology == ptFFF) {
2399 update_selected_preset_visibility(preset_bundle->prints, names);
2400 for (const auto& extruder_filaments : preset_bundle->extruders_filaments) {
2401 Preset* preset = preset_bundle->filaments.find_preset(extruder_filaments.get_selected_preset_name());
2402 if (preset && !preset->is_visible) {
2403 preset->is_visible = true;
2404 names.emplace_back(preset->name);
2405 if (preset->name == preset_bundle->filaments.get_edited_preset().name)
2406 preset_bundle->filaments.get_selected_preset().is_visible = true;
2407 }
2408 }
2409 }
2410 else {
2411 update_selected_preset_visibility(preset_bundle->sla_prints, names);
2412 update_selected_preset_visibility(preset_bundle->sla_materials, names);
2413 }
2414 update_selected_preset_visibility(preset_bundle->printers, names);
2415
2416 preset_bundle->update_compatible(PresetSelectCompatibleType::Never);
2417
2418 // show notification about temporarily installed presets
2419 if (!names.empty()) {
2420 std::string notif_text = into_u8(_L_PLURAL("The preset below was temporarily installed on the active instance of PrusaSlicer",
2421 "The presets below were temporarily installed on the active instance of PrusaSlicer", names.size())) + ":";
2422 for (std::string& name : names)
2423 notif_text += "\n - " + name;
2426 }
2427}
void push_notification(const NotificationType type, int timestamp=0)
Definition NotificationManager.cpp:2065
NotificationManager * get_notification_manager()
Definition Plater.cpp:7590
Definition Preset.hpp:107
std::string name
Definition Preset.hpp:147
bool is_visible
Definition Preset.hpp:138
std::string into_u8(const wxString &str)
Definition GUI.cpp:442
@ ptFFF
Definition Config.hpp:207
#define _L_PLURAL(s, plural, n)
Definition I18N.hpp:93

References _L_PLURAL, Slic3r::GUI::CustomNotification, Slic3r::PresetBundle::extruders_filaments, Slic3r::PresetBundle::filaments, Slic3r::PresetCollection::find_preset(), Slic3r::PresetCollection::get_edited_preset(), get_notification_manager(), Slic3r::PresetCollection::get_selected_preset(), Slic3r::GUI::into_u8(), Slic3r::Preset::is_visible, Slic3r::Preset::name, Slic3r::Never, Slic3r::PresetBundle::printers, Slic3r::GUI::NotificationManager::PrintInfoNotificationLevel, Slic3r::PresetBundle::prints, Slic3r::ptFFF, Slic3r::GUI::NotificationManager::push_notification(), Slic3r::PresetBundle::sla_materials, Slic3r::PresetBundle::sla_prints, and Slic3r::PresetBundle::update_compatible().

Referenced by Slic3r::GUI::MainFrame::load_config_file().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clear_before_change_mesh()

void Slic3r::GUI::Plater::clear_before_change_mesh ( int  obj_idx,
const std::string &  notification_msg 
)
7307{
7308 ModelObject* mo = model().objects[obj_idx];
7309
7310 // If there are custom supports/seams/mmu segmentation, remove them. Fixed mesh
7311 // may be different and they would make no sense.
7312 bool paint_removed = false;
7313 for (ModelVolume* mv : mo->volumes) {
7314 paint_removed |= ! mv->supported_facets.empty() || ! mv->seam_facets.empty() || ! mv->mmu_segmentation_facets.empty();
7315 mv->supported_facets.reset();
7316 mv->seam_facets.reset();
7317 mv->mmu_segmentation_facets.reset();
7318 }
7319 if (paint_removed) {
7320 // snapshot_time is captured by copy so the lambda knows where to undo/redo to.
7324 notification_msg);
7325// _u8L("Undo the repair"),
7326// [this, snapshot_time](wxEvtHandler*){
7327// // Make sure the snapshot is still available and that
7328// // we are in the main stack and not in a gizmo-stack.
7329// if (undo_redo_stack().has_undo_snapshot(snapshot_time)
7330// && q->canvas3D()->get_gizmos_manager().get_current() == nullptr)
7331// undo_redo_to(snapshot_time);
7332// else
7333// notification_manager->push_notification(
7334// NotificationType::CustomSupportsAndSeamRemovedAfterRepair,
7335// NotificationManager::NotificationLevel::RegularNotificationLevel,
7336// _u8L("Cannot undo to before the mesh repair!"));
7337// return true;
7338// });
7339 }
7340}

References Slic3r::GUI::CustomSupportsAndSeamRemovedAfterRepair, get_notification_manager(), model(), Slic3r::Model::objects, Slic3r::GUI::NotificationManager::PrintInfoNotificationLevel, Slic3r::GUI::NotificationManager::push_notification(), and Slic3r::ModelObject::volumes.

Referenced by Slic3r::GUI::GLGizmoSimplify::apply_simplify(), and Slic3r::GUI::ObjectList::fix_through_netfabb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clear_undo_redo_stack_main()

void Slic3r::GUI::Plater::clear_undo_redo_stack_main ( )
7658{ p->undo_redo_stack_main().clear(); }

References p.

◆ collapse_sidebar()

void Slic3r::GUI::Plater::collapse_sidebar ( bool  show)
6091{ p->collapse_sidebar(show); }

References p.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor(), and Slic3r::GUI::MainFrame::update_layout().

+ Here is the caller graph for this function:

◆ config()

◆ convert_unit()

void Slic3r::GUI::Plater::convert_unit ( ConversionType  conv_type)
6279{
6280 std::vector<int> obj_idxs, volume_idxs;
6281 wxGetApp().obj_list()->get_selection_indexes(obj_idxs, volume_idxs);
6282 if (obj_idxs.empty() && volume_idxs.empty())
6283 return;
6284
6285 // We will remove object indexes after convertion
6286 // So, resort object indexes descending to avoid the crash after remove
6287 std::sort(obj_idxs.begin(), obj_idxs.end(), std::greater<int>());
6288
6289 TakeSnapshot snapshot(this, conv_type == ConversionType::CONV_FROM_INCH ? _L("Convert from imperial units") :
6290 conv_type == ConversionType::CONV_TO_INCH ? _L("Revert conversion from imperial units") :
6291 conv_type == ConversionType::CONV_FROM_METER ? _L("Convert from meters") : _L("Revert conversion from meters"));
6292 wxBusyCursor wait;
6293
6294 ModelObjectPtrs objects;
6295 for (int obj_idx : obj_idxs) {
6296 ModelObject *object = p->model.objects[obj_idx];
6297 object->convert_units(objects, conv_type, volume_idxs);
6298 remove(obj_idx);
6299 }
6300 p->load_model_objects(objects);
6301
6302 Selection& selection = p->view3D->get_canvas3d()->get_selection();
6303 size_t last_obj_idx = p->model.objects.size() - 1;
6304
6305 if (volume_idxs.empty()) {
6306 for (size_t i = 0; i < objects.size(); ++i)
6307 selection.add_object((unsigned int)(last_obj_idx - i), i == 0);
6308 }
6309 else {
6310 for (int vol_idx : volume_idxs)
6311 selection.add_volume(last_obj_idx, vol_idx, 0, false);
6312 }
6313}
void remove(size_t obj_idx)
Definition Plater.cpp:6098
ConversionType
Definition Model.hpp:687
std::vector< ModelObject * > ModelObjectPtrs
Definition Model.hpp:105

References _L, Slic3r::GUI::Selection::add_object(), Slic3r::GUI::Selection::add_volume(), Slic3r::CONV_FROM_INCH, Slic3r::CONV_FROM_METER, Slic3r::CONV_TO_INCH, p, and remove().

+ Here is the call graph for this function:

◆ copy_selection_to_clipboard()

void Slic3r::GUI::Plater::copy_selection_to_clipboard ( )
7424{
7425 // At first try to copy selected values to the ObjectList's clipboard
7426 // to check if Settings or Layers are selected in the list
7427 // and then copy to 3DCanvas's clipboard if not
7428 if (can_copy_to_clipboard() && !p->sidebar->obj_list()->copy_to_clipboard())
7429 p->view3D->get_canvas3d()->get_selection().copy_to_clipboard();
7430}
bool can_copy_to_clipboard() const
Definition Plater.cpp:7637

References can_copy_to_clipboard(), and p.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cut() [1/2]

void Slic3r::GUI::Plater::cut ( size_t  init_obj_idx,
const ModelObjectPtrs cut_objects 
)
6335{
6336 model().delete_object(obj_idx);
6338
6339 // suppress to call selection update for Object List to avoid call of early Gizmos on/off update
6340 p->load_model_objects(new_objects, false, false);
6341
6342 // now process all updates of the 3d scene
6343 update();
6344 // Update InfoItems in ObjectList after update() to use of a correct value of the GLCanvas3D::is_sinking(),
6345 // which is updated after a view3D->reload_scene(false, flags & (unsigned int)UpdateParams::FORCE_FULL_SCREEN_REFRESH) call
6346 for (size_t idx = 0; idx < p->model.objects.size(); idx++)
6347 wxGetApp().obj_list()->update_info_items(idx);
6348
6349 Selection& selection = p->get_selection();
6350 size_t last_id = p->model.objects.size() - 1;
6351 for (size_t i = 0; i < new_objects.size(); ++i)
6352 selection.add_object((unsigned int)(last_id - i), i == 0);
6353
6354 UIThreadWorker w;
6355 replace_job(w, std::make_unique<ArrangeJob>(ArrangeJob::SelectionOnly));
6356 w.process_events();
6357}
void delete_object_from_list()
Definition GUI_ObjectList.cpp:3117
Sidebar & sidebar()
Definition Plater.cpp:5221
ObjectList * obj_list()
Definition Plater.cpp:1235
void delete_object(size_t idx)
Definition Model.cpp:233

References Slic3r::GUI::Selection::add_object(), Slic3r::Model::delete_object(), Slic3r::GUI::ObjectList::delete_object_from_list(), model(), Slic3r::GUI::Sidebar::obj_list(), p, Slic3r::GUI::UIThreadWorker::process_events(), Slic3r::GUI::replace_job(), Slic3r::GUI::ArrangeJob::SelectionOnly, sidebar(), and update().

+ Here is the call graph for this function:

◆ cut() [2/2]

void Slic3r::GUI::Plater::cut ( size_t  obj_idx,
size_t  instance_idx,
const Transform3d cut_matrix,
ModelObjectCutAttributes  attributes 
)
6322{
6323 wxCHECK_RET(obj_idx < p->model.objects.size(), "obj_idx out of bounds");
6324 auto* object = p->model.objects[obj_idx];
6325
6326 wxCHECK_RET(instance_idx < object->instances.size(), "instance_idx out of bounds");
6327
6328 wxBusyCursor wait;
6329
6330 const auto new_objects = object->cut(instance_idx, cut_matrix, attributes);
6331 cut(obj_idx, new_objects);
6332}
void cut(size_t obj_idx, size_t instance_idx, const Transform3d &cut_matrix, ModelObjectCutAttributes attributes)
Definition Plater.cpp:6321

References cut(), model(), Slic3r::Model::objects, and p.

Referenced by cut(), and Slic3r::GUI::GLGizmoCut3D::perform_cut().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ decrease_instances()

void Slic3r::GUI::Plater::decrease_instances ( size_t  num = 1,
int  obj_idx = -1 
)
6177{
6178 if (! can_decrease_instances(obj_idx)) { return; }
6179
6180 Plater::TakeSnapshot snapshot(this, _L("Decrease Instances"));
6181
6182 if (obj_idx < 0)
6183 obj_idx = p->get_selected_object_idx();
6184
6185 if (obj_idx < 0) {
6186 if (const auto obj_ids = get_selection().get_object_idxs(); !obj_ids.empty())
6187 for (const size_t obj_id : obj_ids)
6188 decrease_instances(1, int(obj_id));
6189 return;
6190 }
6191
6192 ModelObject* model_object = p->model.objects[obj_idx];
6193 if (model_object->instances.size() > num) {
6194 for (size_t i = 0; i < num; ++ i)
6195 model_object->delete_last_instance();
6196 p->update();
6197 // Delete object from Sidebar list. Do it after update, so that the GLScene selection is updated with the modified model.
6198 sidebar().obj_list()->decrease_object_instances(obj_idx, num);
6199 }
6200 else {
6201 remove(obj_idx);
6202 }
6203
6204 if (!model_object->instances.empty())
6205 p->get_selection().add_instance(obj_idx, (int)model_object->instances.size() - 1);
6206
6207 p->selection_changed();
6208 this->p->schedule_background_process();
6209}
void decrease_object_instances(const size_t obj_idx, const size_t num)
Definition GUI_ObjectList.cpp:3243
void decrease_instances(size_t num=1, int obj_idx=-1)
Definition Plater.cpp:6176
bool can_decrease_instances(int obj_idx=-1) const
Definition Plater.cpp:7608
const Selection & get_selection() const
Definition Plater.cpp:7211

References _L, can_decrease_instances(), decrease_instances(), Slic3r::GUI::ObjectList::decrease_object_instances(), Slic3r::ModelObject::delete_last_instance(), get_selection(), Slic3r::ModelObject::instances, Slic3r::GUI::Sidebar::obj_list(), p, remove(), and sidebar().

Referenced by Slic3r::GUI::MenuFactory::append_menu_items_instance_manipulation(), decrease_instances(), and set_number_of_copies().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ default_menu()

wxMenu * Slic3r::GUI::Plater::default_menu ( )
7711{ return p->menus.default_menu(); }

References p.

Referenced by Slic3r::GUI::ObjectList::show_context_menu().

+ Here is the caller graph for this function:

◆ delete_object_from_model()

bool Slic3r::GUI::Plater::delete_object_from_model ( size_t  obj_idx)
6108{ return p->delete_object_from_model(obj_idx); }

References p.

◆ deselect_all()

void Slic3r::GUI::Plater::deselect_all ( )
6096{ p->deselect_all(); }

References p.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the caller graph for this function:

◆ eject_drive()

void Slic3r::GUI::Plater::eject_drive ( )
6886{
6887 wxBusyCursor wait;
6888 wxGetApp().removable_drive_manager()->eject_drive();
6889}

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the caller graph for this function:

◆ enable_collapse_toolbar()

void Slic3r::GUI::Plater::enable_collapse_toolbar ( bool  enable)
7508{
7509 p->collapse_toolbar.set_enabled(enable);
7510}

References p.

◆ enable_preview_moves_slider()

void Slic3r::GUI::Plater::enable_preview_moves_slider ( bool  enable)
7571{
7572 p->enable_preview_moves_slider(enable);
7573}

References p.

◆ enable_view_toolbar()

void Slic3r::GUI::Plater::enable_view_toolbar ( bool  enable)
7498{
7499 p->view_toolbar.set_enabled(enable);
7500}

References p.

◆ enter_gizmos_stack()

void Slic3r::GUI::Plater::enter_gizmos_stack ( )
7659{ p->enter_gizmos_stack(); }

References p.

◆ export_3mf()

bool Slic3r::GUI::Plater::export_3mf ( const boost::filesystem::path &  output_path = boost::filesystem::path())
6635{
6636 if (p->model.objects.empty()) {
6637 MessageDialog dialog(nullptr, _L("The plater is empty.\nDo you want to save the project?"), _L("Save project"), wxYES_NO);
6638 if (dialog.ShowModal() != wxID_YES)
6639 return false;
6640 }
6641
6642 wxString path;
6643 bool export_config = true;
6644 if (output_path.empty()) {
6645 path = p->get_export_file(FT_3MF);
6646 if (path.empty()) { return false; }
6647 }
6648 else
6649 path = from_path(output_path);
6650
6651 if (!path.Lower().EndsWith(".3mf"))
6652 return false;
6653
6654 DynamicPrintConfig cfg = wxGetApp().preset_bundle->full_config_secure();
6655 const std::string path_u8 = into_u8(path);
6656 wxBusyCursor wait;
6657 bool full_pathnames = wxGetApp().app_config->get_bool("export_sources_full_pathnames");
6658 ThumbnailData thumbnail_data;
6659 ThumbnailsParams thumbnail_params = { {}, false, true, true, true };
6660 p->generate_thumbnail(thumbnail_data, THUMBNAIL_SIZE_3MF.first, THUMBNAIL_SIZE_3MF.second, thumbnail_params, Camera::EType::Ortho);
6661 bool ret = false;
6662 try
6663 {
6664 ret = Slic3r::store_3mf(path_u8.c_str(), &p->model, export_config ? &cfg : nullptr, full_pathnames, &thumbnail_data);
6665 }
6666 catch (boost::filesystem::filesystem_error& e)
6667 {
6668 const wxString what = _("Unable to save file") + ": " + path_u8 + "\n" + e.code().message();
6669 MessageDialog dlg(this, what, _("Error saving 3mf file"), wxOK | wxICON_ERROR);
6670 dlg.ShowModal();
6671 }
6672 if (ret) {
6673 // Success
6674// p->statusbar()->set_status_text(format_wxstr(_L("3MF file exported to %s"), path));
6675 BOOST_LOG_TRIVIAL(info) << "3MF file exported to " << path;
6676 p->set_project_filename(path);
6677 }
6678 else {
6679 // Failure
6680// p->statusbar()->set_status_text(format_wxstr(_L("Error exporting 3MF file %s"), path));
6681 const wxString what = GUI::format_wxstr("%1%: %2%", _L("Unable to save file") , path_u8);
6682 show_error(this, what);
6683 }
6684 return ret;
6685}
static const std::pair< unsigned int, unsigned int > THUMBNAIL_SIZE_3MF
Definition Plater.cpp:126
#define _(msgid)
Definition getopt.c:87
void show_error(wxWindow *parent, const wxString &message, bool monospaced_font)
Definition GUI.cpp:224
wxString from_path(const boost::filesystem::path &path)
Definition GUI.cpp:448
wxString format_wxstr(const char *fmt, TArgs &&... args)
Definition format.hpp:42
@ FT_3MF
Definition GUI_App.hpp:62
bool store_3mf(const char *path, Model *model, const DynamicPrintConfig *config, bool fullpath_sources, const ThumbnailData *thumbnail_data, bool zip64)
Definition 3mf.cpp:3476

References _, _L, Slic3r::GUI::format_wxstr(), Slic3r::GUI::from_path(), Slic3r::GUI::FT_3MF, Slic3r::GUI::into_u8(), Slic3r::GUI::Camera::Ortho, p, Slic3r::GUI::show_error(), Slic3r::store_3mf(), and THUMBNAIL_SIZE_3MF.

Referenced by Slic3r::GUI::MainFrame::save_project_as().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ export_amf()

void Slic3r::GUI::Plater::export_amf ( )
6614{
6615 if (p->model.objects.empty()) { return; }
6616
6617 wxString path = p->get_export_file(FT_AMF);
6618 if (path.empty()) { return; }
6619 const std::string path_u8 = into_u8(path);
6620
6621 wxBusyCursor wait;
6622 bool export_config = true;
6623 DynamicPrintConfig cfg = wxGetApp().preset_bundle->full_config_secure();
6624 bool full_pathnames = wxGetApp().app_config->get_bool("export_sources_full_pathnames");
6625 if (Slic3r::store_amf(path_u8.c_str(), &p->model, export_config ? &cfg : nullptr, full_pathnames)) {
6626 // Success
6627// p->statusbar()->set_status_text(format_wxstr(_L("AMF file exported to %s"), path));
6628 } else {
6629 // Failure
6630// p->statusbar()->set_status_text(format_wxstr(_L("Error exporting AMF file %s"), path));
6631 }
6632}
@ FT_AMF
Definition GUI_App.hpp:61
bool store_amf(const char *path, Model *model, const DynamicPrintConfig *config, bool fullpath_sources)
Definition AMF.cpp:1095

References Slic3r::GUI::FT_AMF, Slic3r::GUI::into_u8(), p, and Slic3r::store_amf().

+ Here is the call graph for this function:

◆ export_gcode()

void Slic3r::GUI::Plater::export_gcode ( bool  prefer_removable)
6360{
6361 if (p->model.objects.empty())
6362 return;
6363
6364 if (canvas3D()->get_gizmos_manager().is_in_editing_mode(true))
6365 return;
6366
6367
6368 if (p->process_completed_with_error)
6369 return;
6370
6371 // If possible, remove accents from accented latin characters.
6372 // This function is useful for generating file names to be processed by legacy firmwares.
6373 fs::path default_output_file;
6374 try {
6375 // Update the background processing, so that the placeholder parser will get the correct values for the ouput file template.
6376 // Also if there is something wrong with the current configuration, a pop-up dialog will be shown and the export will not be performed.
6377 unsigned int state = this->p->update_restart_background_process(false, false);
6379 return;
6380 default_output_file = this->p->background_process.output_filepath_for_project(into_path(get_project_filename(".3mf")));
6381 } catch (const Slic3r::PlaceholderParserError &ex) {
6382 // Show the error with monospaced font.
6383 show_error(this, ex.what(), true);
6384 return;
6385 } catch (const std::exception &ex) {
6386 show_error(this, ex.what(), false);
6387 return;
6388 }
6389 default_output_file = fs::path(Slic3r::fold_utf8_to_ascii(default_output_file.string()));
6390 AppConfig &appconfig = *wxGetApp().app_config;
6391 RemovableDriveManager &removable_drive_manager = *wxGetApp().removable_drive_manager();
6392 // Get a last save path, either to removable media or to an internal media.
6393 std::string start_dir = appconfig.get_last_output_dir(default_output_file.parent_path().string(), prefer_removable);
6394 if (prefer_removable) {
6395 // Returns a path to a removable media if it exists, prefering start_dir. Update the internal removable drives database.
6396 start_dir = removable_drive_manager.get_removable_drive_path(start_dir);
6397 if (start_dir.empty())
6398 // Direct user to the last internal media.
6399 start_dir = appconfig.get_last_output_dir(default_output_file.parent_path().string(), false);
6400 }
6401
6402 fs::path output_path;
6403 {
6404#if !ENABLE_ALTERNATIVE_FILE_WILDCARDS_GENERATOR
6405 std::string ext = default_output_file.extension().string();
6406#endif // !ENABLE_ALTERNATIVE_FILE_WILDCARDS_GENERATOR
6407 wxFileDialog dlg(this, (printer_technology() == ptFFF) ? _L("Save G-code file as:") : _L("Save SL1 / SL1S file as:"),
6408 start_dir,
6409 from_path(default_output_file.filename()),
6413#else
6416#endif // ENABLE_ALTERNATIVE_FILE_WILDCARDS_GENERATOR
6417 wxFD_SAVE | wxFD_OVERWRITE_PROMPT
6418 );
6419 if (dlg.ShowModal() == wxID_OK) {
6420 output_path = into_path(dlg.GetPath());
6421 while (has_illegal_filename_characters(output_path.filename().string())) {
6422 show_error(this, _L("The provided file name is not valid.") + "\n" +
6423 _L("The following characters are not allowed by a FAT file system:") + " <>:/\\|?*\"");
6424 dlg.SetFilename(from_path(output_path.filename()));
6425 if (dlg.ShowModal() == wxID_OK)
6426 output_path = into_path(dlg.GetPath());
6427 else {
6428 output_path.clear();
6429 break;
6430 }
6431 }
6432 }
6433 }
6434
6435 if (! output_path.empty()) {
6436 bool path_on_removable_media = removable_drive_manager.set_and_verify_last_save_path(output_path.string());
6437 p->notification_manager->new_export_began(path_on_removable_media);
6438 p->exporting_status = path_on_removable_media ? ExportingStatus::EXPORTING_TO_REMOVABLE : ExportingStatus::EXPORTING_TO_LOCAL;
6439 p->last_output_path = output_path.string();
6440 p->last_output_dir_path = output_path.parent_path().string();
6441 p->export_gcode(output_path, path_on_removable_media, PrintHostJob());
6442 // Storing a path to AppConfig either as path to removable media or a path to internal media.
6443 // is_path_on_removable_drive() is called with the "true" parameter to update its internal database as the user may have shuffled the external drives
6444 // while the dialog was open.
6445 appconfig.update_last_output_dir(output_path.parent_path().string(), path_on_removable_media);
6446
6447 }
6448}
#define ENABLE_ALTERNATIVE_FILE_WILDCARDS_GENERATOR
Definition Technologies.hpp:62
static bool has_illegal_filename_characters(const wxString &name)
Definition Plater.cpp:143
PrinterTechnology printer_technology() const
Definition Plater.cpp:7269
const SLAPrint & sla_print() const
Definition Plater.cpp:5226
GLCanvas3D * canvas3D()
Definition Plater.cpp:7226
wxString get_project_filename(const wxString &extension=wxEmptyString) const
Definition Plater.cpp:7196
if(!(yy_init))
Definition lexer.c:1190
wxString sla_wildcards(const char *formatid)
Definition GUI_App.cpp:600
static wxString file_wildcards(const FileWildcards &data)
Definition GUI_App.cpp:499
@ FT_GCODE
Definition GUI_App.hpp:63
static DynamicPrintConfig & printer_config()
Definition GUI_ObjectList.cpp:57
@ EXPORTING_TO_REMOVABLE
Definition Plater.cpp:1638
@ EXPORTING_TO_LOCAL
Definition Plater.cpp:1639
std::string fold_utf8_to_ascii(const std::string &src)
Definition ASCIIFolding.cpp:1945
sla_archive_format((ConfigOptionFloat, sla_output_precision))) PRINT_CONFIG_CLASS_DERIVED_DEFINE0(SLAFullPrintConfig
@ UPDATE_BACKGROUND_PROCESS_INVALID
Definition Plater.cpp:1870
Definition PrintHost.hpp:79

References _L, canvas3D(), Slic3r::GUI::EXPORTING_TO_LOCAL, Slic3r::GUI::EXPORTING_TO_REMOVABLE, Slic3r::GUI::file_wildcards(), Slic3r::fold_utf8_to_ascii(), Slic3r::GUI::from_path(), Slic3r::GUI::FT_GCODE, Slic3r::AppConfig::get_last_output_dir(), get_project_filename(), Slic3r::GUI::RemovableDriveManager::get_removable_drive_path(), has_illegal_filename_characters(), Slic3r::GUI::into_path(), p, printer_technology(), Slic3r::ptFFF, Slic3r::GUI::RemovableDriveManager::set_and_verify_last_save_path(), Slic3r::GUI::show_error(), Slic3r::GUI::sla_wildcards(), Slic3r::GUI::Plater::priv::UPDATE_BACKGROUND_PROCESS_INVALID, and Slic3r::AppConfig::update_last_output_dir().

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ export_stl_obj()

void Slic3r::GUI::Plater::export_stl_obj ( bool  extended = false,
bool  selection_only = false 
)
6451{
6452 if (p->model.objects.empty()) { return; }
6453
6454 wxString path = p->get_export_file(FT_OBJECT);
6455 if (path.empty()) { return; }
6456 const std::string path_u8 = into_u8(path);
6457
6458 wxBusyCursor wait;
6459
6460 const auto &selection = p->get_selection();
6461 const auto obj_idx = selection.get_object_idx();
6462 if (selection_only && (obj_idx == -1 || selection.is_wipe_tower()))
6463 return;
6464
6465 // Following lambda generates a combined mesh for export with normals pointing outwards.
6466 auto mesh_to_export_fff = [this](const ModelObject& mo, int instance_id) {
6467 TriangleMesh mesh;
6468
6469 std::vector<csg::CSGPart> csgmesh;
6470 csgmesh.reserve(2 * mo.volumes.size());
6471 csg::model_to_csgmesh(mo, Transform3d::Identity(), std::back_inserter(csgmesh),
6473
6474 if (csg::check_csgmesh_booleans(range(csgmesh)) == csgmesh.end()) {
6475 try {
6476 auto cgalm = csg::perform_csgmesh_booleans(range(csgmesh));
6478 } catch (...) {}
6479 }
6480
6481 if (mesh.empty()) {
6483 _u8L("Unable to perform boolean operation on model meshes. "
6484 "Only positive parts will be exported."));
6485
6486 for (const ModelVolume* v : mo.volumes)
6487 if (v->is_model_part()) {
6488 TriangleMesh vol_mesh(v->mesh());
6489 vol_mesh.transform(v->get_matrix(), true);
6490 mesh.merge(vol_mesh);
6491 }
6492 }
6493
6494 if (instance_id == -1) {
6495 TriangleMesh vols_mesh(mesh);
6496 mesh = TriangleMesh();
6497 for (const ModelInstance* i : mo.instances) {
6498 TriangleMesh m = vols_mesh;
6499 m.transform(i->get_matrix(), true);
6500 mesh.merge(m);
6501 }
6502 }
6503 else if (0 <= instance_id && instance_id < int(mo.instances.size()))
6504 mesh.transform(mo.instances[instance_id]->get_matrix(), true);
6505 return mesh;
6506 };
6507
6508 auto mesh_to_export_sla = [&, this](const ModelObject& mo, int instance_id) {
6509 TriangleMesh mesh;
6510
6511 const SLAPrintObject *object = this->p->sla_print.get_print_object_by_model_object_id(mo.id());
6512
6513 if (!object || !object->get_mesh_to_print() || object->get_mesh_to_print()->empty())
6514 mesh = mesh_to_export_fff(mo, instance_id);
6515 else {
6516 const Transform3d mesh_trafo_inv = object->trafo().inverse();
6517 const bool is_left_handed = object->is_left_handed();
6518
6519 auto pad_mesh = extended? object->pad_mesh() : TriangleMesh{};
6520 pad_mesh.transform(mesh_trafo_inv);
6521
6522 auto supports_mesh = extended ? object->support_mesh() : TriangleMesh{};
6523 supports_mesh.transform(mesh_trafo_inv);
6524
6525 const std::vector<SLAPrintObject::Instance>& obj_instances = object->instances();
6526 for (const SLAPrintObject::Instance& obj_instance : obj_instances) {
6527 auto it = std::find_if(object->model_object()->instances.begin(), object->model_object()->instances.end(),
6528 [&obj_instance](const ModelInstance *mi) { return mi->id() == obj_instance.instance_id; });
6529 assert(it != object->model_object()->instances.end());
6530
6531 if (it != object->model_object()->instances.end()) {
6532 const bool one_inst_only = selection_only && ! selection.is_single_full_object();
6533
6534 const int instance_idx = it - object->model_object()->instances.begin();
6535 const Transform3d& inst_transform = one_inst_only
6537 : object->model_object()->instances[instance_idx]->get_transformation().get_matrix();
6538
6539 TriangleMesh inst_mesh;
6540
6541 if (!pad_mesh.empty()) {
6542 TriangleMesh inst_pad_mesh = pad_mesh;
6543 inst_pad_mesh.transform(inst_transform, is_left_handed);
6544 inst_mesh.merge(inst_pad_mesh);
6545 }
6546
6547 if (!supports_mesh.empty()) {
6548 TriangleMesh inst_supports_mesh = supports_mesh;
6549 inst_supports_mesh.transform(inst_transform, is_left_handed);
6550 inst_mesh.merge(inst_supports_mesh);
6551 }
6552
6553 std::shared_ptr<const indexed_triangle_set> m = object->get_mesh_to_print();
6554 TriangleMesh inst_object_mesh;
6555 if (m)
6556 inst_object_mesh = TriangleMesh{*m};
6557
6558 inst_object_mesh.transform(mesh_trafo_inv);
6559 inst_object_mesh.transform(inst_transform, is_left_handed);
6560
6561 inst_mesh.merge(inst_object_mesh);
6562
6563 // ensure that the instance lays on the bed
6564 inst_mesh.translate(0.0f, 0.0f, -inst_mesh.bounding_box().min.z());
6565
6566 // merge instance with global mesh
6567 mesh.merge(inst_mesh);
6568
6569 if (one_inst_only)
6570 break;
6571 }
6572 }
6573 }
6574
6575 return mesh;
6576 };
6577
6578 std::function<TriangleMesh(const ModelObject& mo, int instance_id)>
6579 mesh_to_export;
6580
6581 if (p->printer_technology == ptFFF )
6582 mesh_to_export = mesh_to_export_fff;
6583 else
6584 mesh_to_export = mesh_to_export_sla;
6585
6586 TriangleMesh mesh;
6587 if (selection_only) {
6588 const ModelObject* model_object = p->model.objects[obj_idx];
6589 if (selection.get_mode() == Selection::Instance)
6590 mesh = mesh_to_export(*model_object, (selection.is_single_full_object() && model_object->instances.size() > 1) ? -1 : selection.get_instance_idx());
6591 else {
6592 const GLVolume* volume = selection.get_first_volume();
6593 mesh = model_object->volumes[volume->volume_idx()]->mesh();
6594 mesh.transform(volume->get_volume_transformation().get_matrix(), true);
6595 }
6596
6597 if (!selection.is_single_full_object() || model_object->instances.size() == 1)
6598 mesh.translate(-model_object->origin_translation.cast<float>());
6599 }
6600 else {
6601 for (const ModelObject* o : p->model.objects) {
6602 mesh.merge(mesh_to_export(*o, -1));
6603 }
6604 }
6605
6606 if (path.Lower().EndsWith(".stl"))
6607 Slic3r::store_stl(path_u8.c_str(), &mesh, true);
6608 else if (path.Lower().EndsWith(".obj"))
6609 Slic3r::store_obj(path_u8.c_str(), &mesh);
6610// p->statusbar()->set_status_text(format_wxstr(_L("STL file exported to %s"), path));
6611}
#define _u8L(s)
macro used to mark string used at localization, return same string
Definition SLAPrint.cpp:29
void push_plater_error_notification(const std::string &text)
Definition NotificationManager.cpp:2122
EIGEN_DEVICE_FUNC Transform inverse(TransformTraits traits=(TransformTraits) Mode) const
Definition Transform.h:1202
static EIGEN_DEVICE_FUNC const Transform Identity()
Returns an identity transformation.
Definition Transform.h:539
@ FT_OBJECT
Definition GUI_App.hpp:59
static bool is_left_handed(const Transform3d::ConstLinearPart &m)
Definition Selection.cpp:2551
TriangleMesh cgal_to_triangle_mesh(const CGALMesh &cgalmesh)
Definition MeshBoolean.cpp:183
void perform_csgmesh_booleans(MeshBoolean::cgal::CGALMeshPtr &cgalm, const Range< It > &csgrange)
Definition PerformCSGMeshBooleans.hpp:87
void model_to_csgmesh(const ModelObject &mo, const Transform3d &trafo, OutIt out, int parts_to_include=mpartsPositive)
Definition ModelToCSGMesh.hpp:22
@ mpartsDoSplits
Definition ModelToCSGMesh.hpp:18
@ mpartsPositive
Definition ModelToCSGMesh.hpp:15
@ mpartsNegative
Definition ModelToCSGMesh.hpp:16
It check_csgmesh_booleans(const Range< It > &csgrange, Visitor &&vfn)
Definition PerformCSGMeshBooleans.hpp:136
Eigen::Transform< double, 3, Eigen::Affine, Eigen::DontAlign > Transform3d
Definition Point.hpp:81
auto range(Cont &&cont)
Definition libslic3r.h:356
bool store_stl(const char *path, TriangleMesh *mesh, bool binary)
Definition STL.cpp:40
bool store_obj(const char *path, TriangleMesh *mesh)
Definition OBJ.cpp:121
IGL_INLINE void volume(const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedT > &T, Eigen::PlainObjectBase< Derivedvol > &vol)
Definition volume.cpp:15

References _u8L, Slic3r::TriangleMesh::bounding_box(), Slic3r::MeshBoolean::cgal::cgal_to_triangle_mesh(), Slic3r::csg::check_csgmesh_booleans(), Slic3r::TriangleMesh::empty(), Slic3r::GUI::FT_OBJECT, Slic3r::SLAPrintObject::get_mesh_to_print(), get_notification_manager(), Slic3r::ObjectBase::id(), Eigen::Transform< double, 3, Eigen::Affine, Eigen::DontAlign >::Identity(), Slic3r::GUI::Selection::Instance, Slic3r::ModelObject::instances, Slic3r::GUI::into_u8(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::inverse(), Slic3r::GUI::is_left_handed(), Slic3r::TriangleMesh::merge(), Slic3r::BoundingBoxBase< PointType, APointsType >::min, Slic3r::PrintObjectBase::model_object(), Slic3r::csg::model_to_csgmesh(), Slic3r::csg::mpartsDoSplits, Slic3r::csg::mpartsNegative, Slic3r::csg::mpartsPositive, Slic3r::ModelObject::origin_translation, p, Slic3r::csg::perform_csgmesh_booleans(), Slic3r::ptFFF, Slic3r::GUI::NotificationManager::push_plater_error_notification(), Slic3r::range(), Slic3r::store_obj(), Slic3r::store_stl(), Slic3r::TriangleMesh::transform(), Slic3r::TriangleMesh::translate(), and Slic3r::ModelObject::volumes.

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_export_stl(), and Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ export_toolpaths_to_obj()

void Slic3r::GUI::Plater::export_toolpaths_to_obj ( ) const
6708{
6710 return;
6711
6712 wxString path = p->get_export_file(FT_OBJ);
6713 if (path.empty())
6714 return;
6715
6716 wxBusyCursor wait;
6717 p->preview->get_canvas3d()->export_toolpaths_to_obj(into_u8(path).c_str());
6718}
bool is_preview_loaded() const
Definition Plater.cpp:6081
@ FT_OBJ
Definition GUI_App.hpp:58

References Slic3r::GUI::FT_OBJ, Slic3r::GUI::into_u8(), is_preview_loaded(), p, printer_technology(), and Slic3r::ptFFF.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor(), and Slic3r::GUI::MainFrame::init_menubar_as_gcodeviewer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extract_config_from_project()

void Slic3r::GUI::Plater::extract_config_from_project ( )
5350{
5351 wxString input_file;
5352 wxGetApp().load_project(this, input_file);
5353
5354 if (! input_file.empty())
5355 load_files({ into_path(input_file) }, false, true);
5356}

References Slic3r::GUI::into_path(), and load_files().

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fff_print() [1/2]

Print & Slic3r::GUI::Plater::fff_print ( )
5225{ return p->fff_print; }

References p.

◆ fff_print() [2/2]

const Print & Slic3r::GUI::Plater::fff_print ( ) const
5224{ return p->fff_print; }

References p.

Referenced by Slic3r::GUI::PlaterAfterLoadAutoArrange::PlaterAfterLoadAutoArrange(), Slic3r::GUI::get_arrange_poly(), Slic3r::GUI::get_skirt_offset(), and Slic3r::GUI::Plater::priv::on_slicing_update().

+ Here is the caller graph for this function:

◆ fill_bed_with_instances()

void Slic3r::GUI::Plater::fill_bed_with_instances ( )
6260{
6261 auto &w = get_ui_job_worker();
6262 if (w.is_idle()) {
6263 p->take_snapshot(_L("Fill bed"));
6264 replace_job(w, std::make_unique<FillBedJob>());
6265 }
6266}

References _L, get_ui_job_worker(), p, and Slic3r::GUI::replace_job().

Referenced by Slic3r::GUI::MenuFactory::append_menu_items_instance_manipulation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ force_filament_cb_update()

void Slic3r::GUI::Plater::force_filament_cb_update ( )
7123{
7124 // Update visibility for templates presets according to app_config
7125 PresetCollection& filaments = wxGetApp().preset_bundle->filaments;
7126 AppConfig& config = *wxGetApp().app_config;
7127 for (Preset& preset : filaments)
7128 preset.set_visible_from_appconfig(config);
7129 wxGetApp().preset_bundle->update_compatible(PresetSelectCompatibleType::Never, PresetSelectCompatibleType::OnlyIfWasCompatible);
7130
7131 // Update preset comboboxes on sidebar and filaments tab
7132 p->sidebar->update_presets(Preset::TYPE_FILAMENT);
7133 wxGetApp().get_tab(Preset::TYPE_FILAMENT)->select_preset(wxGetApp().preset_bundle->filaments.get_selected_preset_name());
7134}
const DynamicPrintConfig * config() const
Definition Plater.cpp:7274
@ TYPE_FILAMENT
Definition Preset.hpp:114

References config(), Slic3r::Never, Slic3r::OnlyIfWasCompatible, p, and Slic3r::Preset::TYPE_FILAMENT.

+ Here is the call graph for this function:

◆ force_filament_colors_update()

void Slic3r::GUI::Plater::force_filament_colors_update ( )
7093{
7094 bool update_scheduled = false;
7095 DynamicPrintConfig* config = p->config;
7096
7097 const auto& extruders_filaments = wxGetApp().preset_bundle->extruders_filaments;
7098 if (extruders_filaments.size() > 1 &&
7099 p->config->option<ConfigOptionStrings>("filament_colour")->values.size() == extruders_filaments.size())
7100 {
7101 std::vector<std::string> filament_colors;
7102 filament_colors.reserve(extruders_filaments.size());
7103
7104 for (const auto& extr_filaments : extruders_filaments)
7105 filament_colors.push_back(extr_filaments.get_selected_preset()->config.opt_string("filament_colour", (unsigned)0));
7106
7107 if (config->option<ConfigOptionStrings>("filament_colour")->values != filament_colors) {
7108 config->option<ConfigOptionStrings>("filament_colour")->values = filament_colors;
7109 update_scheduled = true;
7110 }
7111 }
7112
7113 if (update_scheduled) {
7114 update();
7115 p->sidebar->obj_list()->update_extruder_colors();
7116 }
7117
7118 if (p->main_frame->is_loaded())
7119 this->p->schedule_background_process();
7120}
ConfigOption * option(const t_config_option_key &opt_key, bool create=false)
Definition Config.hpp:2169

References config(), Slic3r::ConfigBase::option(), p, update(), and Slic3r::ConfigOptionVector< T >::values.

+ Here is the call graph for this function:

◆ force_print_bed_update()

void Slic3r::GUI::Plater::force_print_bed_update ( )
7137{
7138 // Fill in the printer model key with something which cannot possibly be valid, so that Plater::on_config_change() will update the print bed
7139 // once a new Printer profile config is loaded.
7140 p->config->opt_string("printer_model", true) = "\x01\x00\x01";
7141}

References p.

Referenced by Slic3r::GUI::GUI_App::load_current_presets().

+ Here is the caller graph for this function:

◆ get_camera() [1/2]

Camera & Slic3r::GUI::Plater::get_camera ( )
7518{
7519 return p->camera;
7520}

References p.

◆ get_camera() [2/2]

const Camera & Slic3r::GUI::Plater::get_camera ( ) const
7513{
7514 return p->camera;
7515}

References p.

Referenced by Slic3r::GUI::Mouse3DController::disconnect_device(), priv::start_create_object_job(), and priv::start_create_volume_on_surface_job().

+ Here is the caller graph for this function:

◆ get_collapse_toolbar() [1/2]

GLToolbar & Slic3r::GUI::Plater::get_collapse_toolbar ( )
7556{
7557 return p->collapse_toolbar;
7558}

References p.

◆ get_collapse_toolbar() [2/2]

const GLToolbar & Slic3r::GUI::Plater::get_collapse_toolbar ( ) const
7551{
7552 return p->collapse_toolbar;
7553}

References p.

Referenced by Slic3r::GUI::MainFrame::MainFrame(), and Slic3r::GUI::MainFrame::update_layout().

+ Here is the caller graph for this function:

◆ get_colors_for_color_print()

std::vector< std::string > Slic3r::GUI::Plater::get_colors_for_color_print ( const GCodeProcessorResult *const  result = nullptr) const
7176{
7177 std::vector<std::string> colors = get_extruder_colors_from_plater_config(result);
7178 colors.reserve(colors.size() + p->model.custom_gcode_per_print_z.gcodes.size());
7179
7180 if (wxGetApp().is_gcode_viewer() && result != nullptr) {
7181 for (const CustomGCode::Item& code : result->custom_gcode_per_print_z) {
7182 if (code.type == CustomGCode::ColorChange)
7183 colors.emplace_back(code.color);
7184 }
7185 }
7186 else {
7187 for (const CustomGCode::Item& code : p->model.custom_gcode_per_print_z.gcodes) {
7188 if (code.type == CustomGCode::ColorChange)
7189 colors.emplace_back(code.color);
7190 }
7191 }
7192
7193 return colors;
7194}
std::vector< std::string > get_extruder_colors_from_plater_config(const GCodeProcessorResult *const result=nullptr) const
Definition Plater.cpp:7149
@ ColorChange
Definition CustomGCode.hpp:15

References Slic3r::CustomGCode::ColorChange, Slic3r::GCodeProcessorResult::custom_gcode_per_print_z, get_extruder_colors_from_plater_config(), and p.

+ Here is the call graph for this function:

◆ get_current_canvas3D()

GLCanvas3D * Slic3r::GUI::Plater::get_current_canvas3D ( )
7237{
7238 return p->get_current_canvas3D();
7239}

References p.

Referenced by Slic3r::GUI::Plater::priv::reload_from_disk(), and Slic3r::GUI::MainFrame::select_tab().

+ Here is the caller graph for this function:

◆ get_extruder_colors_from_plater_config()

std::vector< std::string > Slic3r::GUI::Plater::get_extruder_colors_from_plater_config ( const GCodeProcessorResult *const  result = nullptr) const
7150{
7151 if (wxGetApp().is_gcode_viewer() && result != nullptr)
7152 return result->extruder_colors;
7153 else {
7154 const Slic3r::DynamicPrintConfig* config = &wxGetApp().preset_bundle->printers.get_edited_preset().config;
7155 std::vector<std::string> extruder_colors;
7156 if (!config->has("extruder_colour")) // in case of a SLA print
7157 return extruder_colors;
7158
7159 extruder_colors = (config->option<ConfigOptionStrings>("extruder_colour"))->values;
7160 if (!wxGetApp().plater())
7161 return extruder_colors;
7162
7163 const std::vector<std::string>& filament_colours = (p->config->option<ConfigOptionStrings>("filament_colour"))->values;
7164 for (size_t i = 0; i < extruder_colors.size(); ++i)
7165 if (extruder_colors[i] == "" && i < filament_colours.size())
7166 extruder_colors[i] = filament_colours[i];
7167
7168 return extruder_colors;
7169 }
7170}
bool has(const t_config_option_key &opt_key) const
Definition Config.hpp:2105
Definition PrintConfig.hpp:212

References config(), Slic3r::GCodeProcessorResult::extruder_colors, Slic3r::ConfigOptionResolver::has(), Slic3r::ConfigBase::option(), and p.

Referenced by get_colors_for_color_print(), and Slic3r::GUI::Preview::update_layers_slider().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_last_loaded_gcode()

const wxString & Slic3r::GUI::Plater::get_last_loaded_gcode ( ) const
inline
186{ return m_last_loaded_gcode; }
wxString m_last_loaded_gcode
Definition Plater.hpp:502

References m_last_loaded_gcode.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_gcodeviewer().

+ Here is the caller graph for this function:

◆ get_mouse3d_controller() [1/2]

Mouse3DController & Slic3r::GUI::Plater::get_mouse3d_controller ( )
7586{
7587 return p->mouse3d_controller;
7588}

References p.

◆ get_mouse3d_controller() [2/2]

const Mouse3DController & Slic3r::GUI::Plater::get_mouse3d_controller ( ) const
7581{
7582 return p->mouse3d_controller;
7583}

References p.

Referenced by Slic3r::GUI::MainFrame::shutdown().

+ Here is the caller graph for this function:

◆ get_notification_manager() [1/2]

NotificationManager * Slic3r::GUI::Plater::get_notification_manager ( )
7591{
7592 return p->notification_manager.get();
7593}

References p.

Referenced by Slic3r::GUI::GUI_App::app_updater(), check_selected_presets_visibility(), clear_before_change_mesh(), export_stl_obj(), Slic3r::GUI::ArrangeJob::finalize(), Slic3r::GUI::ObjectList::fix_through_netfabb(), Slic3r::GUI::GUI_App::notification_manager(), Slic3r::GUI::GUI_App::on_init_inner(), Slic3r::GUI::GUI_App::on_version_read(), and Slic3r::GUI::GUI_App::post_init().

+ Here is the caller graph for this function:

◆ get_notification_manager() [2/2]

const NotificationManager * Slic3r::GUI::Plater::get_notification_manager ( ) const
7596{
7597 return p->notification_manager.get();
7598}

References p.

◆ get_project_filename()

wxString Slic3r::GUI::Plater::get_project_filename ( const wxString &  extension = wxEmptyString) const
7197{
7198 return p->get_project_filename(extension);
7199}

References p.

Referenced by Slic3r::GUI::MainFrame::can_start_new_project(), export_gcode(), Slic3r::GUI::Plater::priv::get_export_file_path(), Slic3r::GUI::MainFrame::save_project(), send_gcode(), Slic3r::GUI::ProjectDirtyStateManager::update_from_presets(), and Slic3r::GUI::MainFrame::update_title().

+ Here is the caller graph for this function:

◆ get_selected_object_idx()

int Slic3r::GUI::Plater::get_selected_object_idx ( )

◆ get_selection()

◆ get_ui_job_worker() [1/2]

Worker & Slic3r::GUI::Plater::get_ui_job_worker ( )
6070{ return p->m_worker; }

References p.

Referenced by arrange(), fill_bed_with_instances(), import_sl1_archive(), Slic3r::GUI::MainFrame::init_menubar_as_editor(), remove_selected(), reslice(), Slic3r::GUI::MainFrame::shutdown(), priv::start_create_object_job(), and priv::start_create_volume_job().

+ Here is the caller graph for this function:

◆ get_ui_job_worker() [2/2]

const Worker & Slic3r::GUI::Plater::get_ui_job_worker ( ) const
6072{ return p->m_worker; }

References p.

◆ get_view_toolbar() [1/2]

GLToolbar & Slic3r::GUI::Plater::get_view_toolbar ( )
7546{
7547 return p->view_toolbar;
7548}

References p.

◆ get_view_toolbar() [2/2]

const GLToolbar & Slic3r::GUI::Plater::get_view_toolbar ( ) const
7541{
7542 return p->view_toolbar;
7543}

References p.

◆ has_illegal_filename_characters() [1/2]

bool Slic3r::GUI::Plater::has_illegal_filename_characters ( const std::string &  name)
static
150{
151 const char* illegal_characters = "<>:/\\|?*\"";
152 for (size_t i = 0; i < std::strlen(illegal_characters); i++)
153 if (name.find_first_of(illegal_characters[i]) != std::string::npos)
154 return true;
155
156 return false;
157}

◆ has_illegal_filename_characters() [2/2]

bool Slic3r::GUI::Plater::has_illegal_filename_characters ( const wxString &  name)
static
144{
145 std::string name = into_u8(wxs_name);
147}

References has_illegal_filename_characters(), and Slic3r::GUI::into_u8().

Referenced by export_gcode(), BitmapTextRenderer::GetValueFromEditorCtrl(), has_illegal_filename_characters(), and Slic3r::GUI::ObjectList::rename_item().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ has_toolpaths_to_export()

bool Slic3r::GUI::Plater::has_toolpaths_to_export ( ) const
6703{
6704 return p->preview->get_canvas3d()->has_toolpaths_to_export();
6705}

References p.

Referenced by Slic3r::GUI::MainFrame::can_export_toolpaths().

+ Here is the caller graph for this function:

◆ import_sl1_archive()

void Slic3r::GUI::Plater::import_sl1_archive ( )
5341{
5342 auto &w = get_ui_job_worker();
5343 if (w.is_idle() && p->m_sla_import_dlg->ShowModal() == wxID_OK) {
5344 p->take_snapshot(_L("Import SLA archive"));
5345 replace_job(w, std::make_unique<SLAImportJob>(p->m_sla_import_dlg));
5346 }
5347}

References _L, get_ui_job_worker(), p, and Slic3r::GUI::replace_job().

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ import_zip_archive()

void Slic3r::GUI::Plater::import_zip_archive ( )
5329{
5330 wxString input_file;
5331 wxGetApp().import_zip(this, input_file);
5332 if (input_file.empty())
5333 return;
5334
5335 wxArrayString arr;
5336 arr.Add(input_file);
5337 load_files(arr, false);
5338}

References load_files().

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ increase_instances()

void Slic3r::GUI::Plater::increase_instances ( size_t  num = 1,
int  obj_idx = -1,
int  inst_idx = -1 
)
6121{
6122 if (! can_increase_instances()) { return; }
6123
6124 Plater::TakeSnapshot snapshot(this, _L("Increase Instances"));
6125
6126 if (obj_idx < 0) {
6127 obj_idx = p->get_selected_object_idx();
6128 if (obj_idx < 0) {
6129 // It's a case of increasing per 1 instance, when multiple objects are selected
6130 if (const auto obj_idxs = get_selection().get_object_idxs(); !obj_idxs.empty()) {
6131 // we need a copy made here because the selection changes at every call of increase_instances()
6132 const Selection::ObjectIdxsToInstanceIdxsMap content = p->get_selection().get_content();
6133 for (const unsigned int obj_id : obj_idxs) {
6134 if (auto obj_it = content.find(int(obj_id)); obj_it != content.end())
6135 increase_instances(1, int(obj_id), *obj_it->second.rbegin());
6136 }
6137 }
6138 return;
6139 }
6140 }
6141 assert(obj_idx >= 0);
6142
6143 ModelObject* model_object = p->model.objects[obj_idx];
6144
6145 if (inst_idx < 0 && get_selected_object_idx() >= 0) {
6146 inst_idx = get_selection().get_instance_idx();
6147 if (0 > inst_idx || inst_idx >= int(model_object->instances.size()))
6148 inst_idx = -1;
6149 }
6150 ModelInstance* model_instance = (inst_idx >= 0) ? model_object->instances[inst_idx] : model_object->instances.back();
6151
6152 bool was_one_instance = model_object->instances.size()==1;
6153
6154 double offset_base = canvas3D()->get_size_proportional_to_max_bed_size(0.05);
6155 double offset = offset_base;
6156 for (size_t i = 0; i < num; i++, offset += offset_base) {
6157 Vec3d offset_vec = model_instance->get_offset() + Vec3d(offset, offset, 0.0);
6158 Geometry::Transformation trafo = model_instance->get_transformation();
6159 trafo.set_offset(offset_vec);
6160 model_object->add_instance(trafo);
6161 }
6162
6163 if (p->get_config_bool("autocenter"))
6164 arrange();
6165
6166 p->update();
6167
6168 p->get_selection().add_instance(obj_idx, (int)model_object->instances.size() - 1);
6169
6170 sidebar().obj_list()->increase_object_instances(obj_idx, was_one_instance ? num + 1 : num);
6171
6172 p->selection_changed();
6173 this->p->schedule_background_process();
6174}
double get_size_proportional_to_max_bed_size(double factor) const
Definition GLCanvas3D.cpp:4479
void increase_object_instances(const size_t obj_idx, const size_t num)
Definition GUI_ObjectList.cpp:3237
bool can_increase_instances() const
Definition Plater.cpp:7607
int get_selected_object_idx()
Definition Plater.cpp:7216
void arrange()
Definition Plater.cpp:7241
void increase_instances(size_t num=1, int obj_idx=-1, int inst_idx=-1)
Definition Plater.cpp:6120
std::map< int, InstanceIdxsList > ObjectIdxsToInstanceIdxsMap
Definition Selection.hpp:105
int get_instance_idx() const
Definition Selection.cpp:646
Slic3r::Polygons offset(const Slic3r::Polygon &polygon, const float delta, ClipperLib::JoinType joinType, double miterLimit)
Definition ClipperUtils.cpp:416
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition Point.hpp:52
TPoint< P > back(const P &p)
Definition geometry_traits.hpp:873

References _L, Slic3r::ModelObject::add_instance(), arrange(), can_increase_instances(), canvas3D(), Slic3r::GUI::Selection::get_instance_idx(), Slic3r::ModelInstance::get_offset(), get_selected_object_idx(), get_selection(), Slic3r::GUI::GLCanvas3D::get_size_proportional_to_max_bed_size(), Slic3r::ModelInstance::get_transformation(), increase_instances(), Slic3r::GUI::ObjectList::increase_object_instances(), Slic3r::ModelObject::instances, Slic3r::GUI::Sidebar::obj_list(), Slic3r::offset(), p, Slic3r::Geometry::Transformation::set_offset(), and sidebar().

Referenced by Slic3r::GUI::MenuFactory::append_menu_items_instance_manipulation(), increase_instances(), and set_number_of_copies().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_collapse_toolbar()

bool Slic3r::GUI::Plater::init_collapse_toolbar ( )
7503{
7504 return p->init_collapse_toolbar();
7505}

References p.

◆ init_notification_manager()

void Slic3r::GUI::Plater::init_notification_manager ( )
7601{
7602 p->init_notification_manager();
7603}

References p.

◆ init_view_toolbar()

bool Slic3r::GUI::Plater::init_view_toolbar ( )
7493{
7494 return p->init_view_toolbar();
7495}

References p.

◆ inside_snapshot_capture()

bool Slic3r::GUI::Plater::inside_snapshot_capture ( )
7661{ return p->inside_snapshot_capture(); }

References p.

◆ instance_menu()

wxMenu * Slic3r::GUI::Plater::instance_menu ( )
7712{ return p->menus.instance_menu(); }

References p.

Referenced by Slic3r::GUI::ObjectList::show_context_menu().

+ Here is the caller graph for this function:

◆ is_background_process_update_scheduled()

bool Slic3r::GUI::Plater::is_background_process_update_scheduled ( ) const
7404{
7405 return this->p->background_process_timer.IsRunning();
7406}

References p.

◆ is_export_gcode_scheduled()

bool Slic3r::GUI::Plater::is_export_gcode_scheduled ( ) const
7207{
7208 return p->background_process.is_export_scheduled();
7209}

References p.

Referenced by Slic3r::GUI::MainFrame::can_export_gcode(), and Slic3r::GUI::MainFrame::can_export_gcode_sd().

+ Here is the caller graph for this function:

◆ is_legend_shown()

bool Slic3r::GUI::Plater::is_legend_shown ( ) const
6087{ return p->is_legend_shown(); }

References p.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor(), and Slic3r::GUI::MainFrame::init_menubar_as_gcodeviewer().

+ Here is the caller graph for this function:

◆ is_presets_dirty()

bool Slic3r::GUI::Plater::is_presets_dirty ( ) const
5212{ return p->is_presets_dirty(); }

References p.

◆ is_preview_loaded()

bool Slic3r::GUI::Plater::is_preview_loaded ( ) const
6081{ return p->is_preview_loaded(); }

References p.

Referenced by Slic3r::GUI::MainFrame::can_export_toolpaths(), and export_toolpaths_to_obj().

+ Here is the caller graph for this function:

◆ is_preview_shown()

bool Slic3r::GUI::Plater::is_preview_shown ( ) const
6080{ return p->is_preview_shown(); }

References p.

Referenced by Slic3r::GUI::MainFrame::can_export_toolpaths(), Slic3r::GUI::MainFrame::init_menubar_as_editor(), Slic3r::GUI::MainFrame::init_menubar_as_gcodeviewer(), and search().

+ Here is the caller graph for this function:

◆ is_project_dirty()

bool Slic3r::GUI::Plater::is_project_dirty ( ) const
5211{ return p->is_project_dirty(); }

References p.

Referenced by Slic3r::GUI::MainFrame::can_save(), and Slic3r::GUI::MainFrame::update_title().

+ Here is the caller graph for this function:

◆ is_project_temp()

bool Slic3r::GUI::Plater::is_project_temp ( ) const
5230{
5231 return false;
5232}

◆ is_render_statistic_dialog_visible()

bool Slic3r::GUI::Plater::is_render_statistic_dialog_visible ( ) const
7669{
7670 return p->show_render_statistic_dialog;
7671}

References p.

◆ is_selection_empty()

bool Slic3r::GUI::Plater::is_selection_empty ( ) const
6269{
6270 return p->get_selection().is_empty() || p->get_selection().is_wipe_tower();
6271}

References p.

Referenced by can_copy_to_clipboard(), Slic3r::GUI::MainFrame::can_delete(), and Slic3r::GUI::MainFrame::can_deselect().

+ Here is the caller graph for this function:

◆ is_sidebar_collapsed()

bool Slic3r::GUI::Plater::is_sidebar_collapsed ( ) const
6090{ return p->is_sidebar_collapsed(); }

References p.

Referenced by Slic3r::GUI::Plater::priv::init_collapse_toolbar(), and Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the caller graph for this function:

◆ is_single_full_object_selection()

bool Slic3r::GUI::Plater::is_single_full_object_selection ( ) const
7222{
7223 return p->get_selection().is_single_full_object();
7224}

References p.

◆ is_view3D_layers_editing_enabled()

bool Slic3r::GUI::Plater::is_view3D_layers_editing_enabled ( ) const
6093{ return p->is_view3D_layers_editing_enabled(); }

References p.

◆ is_view3D_shown()

bool Slic3r::GUI::Plater::is_view3D_shown ( ) const
6082{ return p->is_view3D_shown(); }

References p.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the caller graph for this function:

◆ layer_menu()

wxMenu * Slic3r::GUI::Plater::layer_menu ( )
7713{ return p->menus.layer_menu(); }

References p.

Referenced by Slic3r::GUI::ObjectList::show_context_menu().

+ Here is the caller graph for this function:

◆ leave_gizmos_stack()

void Slic3r::GUI::Plater::leave_gizmos_stack ( )
7660{ p->leave_gizmos_stack(); }

References p.

◆ load_files() [1/3]

std::vector< size_t > Slic3r::GUI::Plater::load_files ( const std::vector< boost::filesystem::path > &  input_files,
bool  load_model = true,
bool  load_config = true,
bool  imperial_units = false 
)

Referenced by add_model(), extract_config_from_project(), import_zip_archive(), load_files(), load_project(), Slic3r::GUI::GUI_App::post_init(), and preview_zip_archive().

+ Here is the caller graph for this function:

◆ load_files() [2/3]

std::vector< size_t > Slic3r::GUI::Plater::load_files ( const std::vector< std::string > &  input_files,
bool  load_model = true,
bool  load_config = true,
bool  imperial_units = false 
)
5442{
5443 std::vector<fs::path> paths;
5444 paths.reserve(input_files.size());
5445 for (const std::string& path : input_files)
5446 paths.emplace_back(path);
5447 return p->load_files(paths, load_model, load_config, imperial_units);
5448}

References p.

◆ load_files() [3/3]

bool Slic3r::GUI::Plater::load_files ( const wxArrayString &  filenames,
bool  delete_after_load = false 
)
5938{
5939 const std::regex pattern_drop(".*[.](stl|obj|amf|3mf|prusa|step|stp|zip)", std::regex::icase);
5940 const std::regex pattern_gcode_drop(".*[.](gcode|g)", std::regex::icase);
5941
5942 std::vector<fs::path> paths;
5943
5944 // gcode viewer section
5945 if (wxGetApp().is_gcode_viewer()) {
5946 for (const auto& filename : filenames) {
5947 fs::path path(into_path(filename));
5948 if (std::regex_match(path.string(), pattern_gcode_drop))
5949 paths.push_back(std::move(path));
5950 }
5951
5952 if (paths.size() > 1) {
5953 //wxMessageDialog(static_cast<wxWindow*>(this), _L("You can open only one .gcode file at a time."),
5954 MessageDialog(static_cast<wxWindow*>(this), _L("You can open only one .gcode file at a time."),
5955 wxString(SLIC3R_APP_NAME) + " - " + _L("Drag and drop G-code file"), wxCLOSE | wxICON_WARNING | wxCENTRE).ShowModal();
5956 return false;
5957 }
5958 else if (paths.size() == 1) {
5959 load_gcode(from_path(paths.front()));
5960 return true;
5961 }
5962 return false;
5963 }
5964
5965 // editor section
5966 for (const auto& filename : filenames) {
5967 fs::path path(into_path(filename));
5968 if (std::regex_match(path.string(), pattern_drop))
5969 paths.push_back(std::move(path));
5970 else if (std::regex_match(path.string(), pattern_gcode_drop))
5971 start_new_gcodeviewer(&filename);
5972 else
5973 continue;
5974 }
5975 if (paths.empty())
5976 // Likely all paths processed were gcodes, for which a G-code viewer instance has hopefully been started.
5977 return false;
5978
5979 // searches for project files
5980 for (std::vector<fs::path>::const_reverse_iterator it = paths.rbegin(); it != paths.rend(); ++it) {
5981 std::string filename = (*it).filename().string();
5982
5983 bool handle_as_project = (boost::algorithm::iends_with(filename, ".3mf") || boost::algorithm::iends_with(filename, ".amf"));
5984 if (boost::algorithm::iends_with(filename, ".zip") && is_project_3mf(it->string())) {
5985 BOOST_LOG_TRIVIAL(warning) << "File with .zip extension is 3mf project, opening as it would have .3mf extension: " << *it;
5986 handle_as_project = true;
5987 }
5988 if (handle_as_project) {
5990 {
5991 if ((boost::algorithm::iends_with(filename, ".3mf") && !is_project_3mf(it->string())) ||
5992 (boost::algorithm::iends_with(filename, ".amf") && !boost::algorithm::iends_with(filename, ".zip.amf")))
5994 else {
5995 if (wxGetApp().app_config->get_bool("show_drop_project_dialog")) {
5996 ProjectDropDialog dlg(filename);
5997 if (dlg.ShowModal() == wxID_OK) {
5998 int choice = dlg.get_action();
5999 load_type = static_cast<ProjectDropDialog::LoadType>(choice);
6000 wxGetApp().app_config->set("drop_project_action", std::to_string(choice));
6001 }
6002 }
6003 else
6004 load_type = static_cast<ProjectDropDialog::LoadType>(std::clamp(std::stoi(wxGetApp().app_config->get("drop_project_action")),
6006 }
6007 }
6008
6009 if (load_type == ProjectDropDialog::LoadType::Unknown)
6010 return false;
6011
6012 switch (load_type) {
6014 if (wxGetApp().can_load_project())
6015 load_project(from_path(*it));
6016 break;
6017 }
6019// Plater::TakeSnapshot snapshot(this, _L("Import Object"));
6020 load_files({ *it }, true, false);
6021 break;
6022 }
6024 load_files({ *it }, false, true);
6025 break;
6026 }
6028 wxString f = from_path(*it);
6029 start_new_slicer(&f, false, delete_after_load);
6030 return false; // did not load anything to this instance
6031 }
6033 assert(false);
6034 break;
6035 }
6036 }
6037
6038 return true;
6039 } else if (boost::algorithm::iends_with(filename, ".zip")) {
6040 return preview_zip_archive(*it);
6041
6042 }
6043 }
6044
6045 // other files
6046 wxString snapshot_label;
6047 assert(!paths.empty());
6048 if (paths.size() == 1) {
6049 snapshot_label = _L("Load File");
6050 snapshot_label += ": ";
6051 snapshot_label += wxString::FromUTF8(paths.front().filename().string().c_str());
6052 }
6053 else {
6054 snapshot_label = _L("Load Files");
6055 snapshot_label += ": ";
6056 snapshot_label += wxString::FromUTF8(paths.front().filename().string().c_str());
6057 for (size_t i = 1; i < paths.size(); ++i) {
6058 snapshot_label += ", ";
6059 snapshot_label += wxString::FromUTF8(paths[i].filename().string().c_str());
6060 }
6061 }
6062 Plater::TakeSnapshot snapshot(this, snapshot_label);
6063 load_files(paths);
6064
6065 return true;
6066}
bool preview_zip_archive(const boost::filesystem::path &input_file)
Definition Plater.cpp:5595
void load_project()
Definition Plater.cpp:5262
void load_gcode()
Definition Plater.cpp:5358
LoadType
Definition Plater.cpp:5859
void start_new_slicer(const wxString *path_to_open, bool single_instance, bool delete_after_load)
Definition Process.cpp:147
void start_new_gcodeviewer(const wxString *path_to_open)
Definition Process.cpp:156
bool is_project_3mf(const std::string &filename)
Definition 3mf.cpp:3431
static double f(double x, double z_sin, double z_cos, bool vertical, bool flip)
Definition FillGyroid.cpp:12

References _L, Slic3r::f(), Slic3r::GUI::from_path(), Slic3r::GUI::ProjectDropDialog::get_action(), Slic3r::GUI::into_path(), Slic3r::is_project_3mf(), load_files(), load_gcode(), load_project(), Slic3r::GUI::ProjectDropDialog::LoadConfig, Slic3r::GUI::ProjectDropDialog::LoadGeometry, Slic3r::GUI::ProjectDropDialog::OpenProject, Slic3r::GUI::ProjectDropDialog::OpenWindow, preview_zip_archive(), Slic3r::GUI::start_new_gcodeviewer(), Slic3r::GUI::start_new_slicer(), and Slic3r::GUI::ProjectDropDialog::Unknown.

+ Here is the call graph for this function:

◆ load_gcode() [1/2]

void Slic3r::GUI::Plater::load_gcode ( )
5359{
5360 // Ask user for a gcode file name.
5361 wxString input_file;
5362 wxGetApp().load_gcode(this, input_file);
5363 // And finally load the gcode file.
5364 load_gcode(input_file);
5365}

References load_gcode().

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_gcodeviewer(), load_files(), load_gcode(), Slic3r::GUI::GUI_App::post_init(), and reload_gcode_from_disk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ load_gcode() [2/2]

void Slic3r::GUI::Plater::load_gcode ( const wxString &  filename)
5368{
5369 if (! is_gcode_file(into_u8(filename)) || m_last_loaded_gcode == filename)
5370 return;
5371
5372 m_last_loaded_gcode = filename;
5373
5374 // cleanup view before to start loading/processing
5375 p->gcode_result.reset();
5377 p->preview->reload_print(false);
5378 p->get_current_canvas3D()->render();
5379
5380 wxBusyCursor wait;
5381
5382 // process gcode
5383 GCodeProcessor processor;
5384 try
5385 {
5386 processor.process_file(filename.ToUTF8().data());
5387 }
5388 catch (const std::exception& ex)
5389 {
5390 show_error(this, ex.what());
5391 return;
5392 }
5393 p->gcode_result = std::move(processor.extract_result());
5394
5395 // show results
5396 try
5397 {
5398 p->preview->reload_print(false);
5399 }
5400 catch (const std::exception&)
5401 {
5402 wxEndBusyCursor();
5403 p->gcode_result.reset();
5406 p->preview->reload_print(false);
5407 p->get_current_canvas3D()->render();
5408 MessageDialog(this, _L("The selected file") + ":\n" + filename + "\n" + _L("does not contain valid gcode."),
5409 wxString(GCODEVIEWER_APP_NAME) + " - " + _L("Error while loading .gcode file"), wxOK | wxICON_WARNING | wxCENTRE).ShowModal();
5410 set_project_filename(wxEmptyString);
5411 return;
5412 }
5413 p->preview->get_canvas3d()->zoom_to_gcode();
5414
5415 if (p->preview->get_canvas3d()->get_gcode_layers_zs().empty()) {
5416 wxEndBusyCursor();
5417 //wxMessageDialog(this, _L("The selected file") + ":\n" + filename + "\n" + _L("does not contain valid gcode."),
5418 MessageDialog(this, _L("The selected file") + ":\n" + filename + "\n" + _L("does not contain valid gcode."),
5419 wxString(GCODEVIEWER_APP_NAME) + " - " + _L("Error while loading .gcode file"), wxOK | wxICON_WARNING | wxCENTRE).ShowModal();
5420 set_project_filename(wxEmptyString);
5421 }
5422 else
5423 set_project_filename(filename);
5424}
void reset_gcode_toolpaths()
Definition Plater.cpp:7575
void set_default_bed_shape() const
Definition Plater.cpp:7087
void set_project_filename(const wxString &filename)
Definition Plater.cpp:7201
#define GCODEVIEWER_APP_NAME
Definition libslic3r.h:5
bool is_gcode_file(const std::string &path)
Definition utils.cpp:783

References _L, Slic3r::GCodeProcessor::extract_result(), GCODEVIEWER_APP_NAME, Slic3r::GUI::into_u8(), Slic3r::is_gcode_file(), m_last_loaded_gcode, p, Slic3r::GCodeProcessor::process_file(), reset_gcode_toolpaths(), set_default_bed_shape(), set_project_filename(), and Slic3r::GUI::show_error().

+ Here is the call graph for this function:

◆ load_project() [1/2]

void Slic3r::GUI::Plater::load_project ( )
5263{
5264 if (!wxGetApp().can_load_project())
5265 return;
5266
5267 // Ask user for a project file name.
5268 wxString input_file;
5269 wxGetApp().load_project(this, input_file);
5270 // And finally load the new project.
5271 load_project(input_file);
5272}

References load_project().

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor(), load_files(), load_project(), and preview_zip_archive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ load_project() [2/2]

void Slic3r::GUI::Plater::load_project ( const wxString &  filename)
5275{
5276 if (filename.empty())
5277 return;
5278
5279 // Take the Undo / Redo snapshot.
5280 Plater::TakeSnapshot snapshot(this, _L("Load Project") + ": " + wxString::FromUTF8(into_path(filename).stem().string().c_str()), UndoRedo::SnapshotType::ProjectSeparator);
5281
5282 p->reset();
5283
5284 if (! load_files({ into_path(filename) }).empty()) {
5285 // At least one file was loaded.
5286 p->set_project_filename(filename);
5287 // Save the names of active presets and project specific config into ProjectDirtyStateManager.
5289 // Make a copy of the active presets for detecting changes in preset values.
5290 wxGetApp().update_saved_preset_from_current_preset();
5291 // Update Project dirty state, update application title bar.
5293 }
5294}
void update_project_dirty_from_presets()
Definition Plater.cpp:5213
void reset_project_dirty_initial_presets()
Definition Plater.cpp:5216

References _L, Slic3r::empty(), Slic3r::GUI::into_path(), load_files(), p, Slic3r::UndoRedo::ProjectSeparator, reset_project_dirty_initial_presets(), and update_project_dirty_from_presets().

+ Here is the call graph for this function:

◆ mirror()

void Slic3r::GUI::Plater::mirror ( Axis  axis)
7416{ p->mirror(axis); }

References p.

Referenced by Slic3r::GUI::MenuFactory::append_menu_items_mirror().

+ Here is the caller graph for this function:

◆ model() [1/2]

Model & Slic3r::GUI::Plater::model ( )
5223{ return p->model; }

References p.

◆ model() [2/2]

const Model & Slic3r::GUI::Plater::model ( ) const
5222{ return p->model; }

References p.

Referenced by Slic3r::GUI::PlaterAfterLoadAutoArrange::PlaterAfterLoadAutoArrange(), Slic3r::GUI::GLGizmoSimplify::add_simplify_suggestion_notification(), Slic3r::GUI::MenuFactory::append_menu_item_edit_text(), Slic3r::GUI::Plater::priv::can_arrange(), Slic3r::GUI::Plater::priv::can_decrease_instances(), Slic3r::GUI::MainFrame::can_delete_all(), Slic3r::GUI::Plater::priv::can_delete_all(), Slic3r::GUI::MainFrame::can_export_gcode(), Slic3r::GUI::MainFrame::can_export_gcode_sd(), Slic3r::GUI::MainFrame::can_export_model(), Slic3r::GUI::MainFrame::can_export_supports(), Slic3r::GUI::Plater::priv::can_fix_through_netfabb(), Slic3r::GUI::Plater::priv::can_reload_from_disk(), Slic3r::GUI::MainFrame::can_reslice(), Slic3r::GUI::MainFrame::can_select(), Slic3r::GUI::MainFrame::can_send_gcode(), Slic3r::GUI::Plater::priv::can_set_instance_to_object(), Slic3r::GUI::Plater::priv::can_simplify(), Slic3r::GUI::MainFrame::can_slice(), Slic3r::GUI::MainFrame::can_start_new_project(), changed_mesh(), changed_objects(), clear_before_change_mesh(), Slic3r::GUI::ArrangeJob::clear_input(), priv::create_volume(), cut(), cut(), Slic3r::GUI::Plater::priv::delete_all_objects_from_model(), Slic3r::GUI::Plater::priv::delete_object_from_model(), Slic3r::GUI::Plater::priv::export_gcode(), Slic3r::GUI::RotoptimizeJob::finalize(), Slic3r::GUI::FillBedJob::finalize(), Slic3r::GUI::Plater::priv::get_export_file_path(), Slic3r::GUI::Plater::priv::get_selected_instance_idx(), Slic3r::GUI::Plater::priv::get_selected_object_idx(), Slic3r::GUI::Plater::priv::get_selected_volume_idx(), Slic3r::GUI::MainFrame::init_menubar_as_editor(), Slic3r::GUI::Plater::priv::layers_height_allowed(), Slic3r::GUI::Plater::priv::load_files(), Slic3r::GUI::Plater::priv::load_model_objects(), Slic3r::GUI::GUI_App::model(), Slic3r::GUI::Plater::priv::object_list_changed(), Slic3r::GUI::GLGizmoCut3D::perform_cut(), Slic3r::GUI::FillBedJob::prepare(), Slic3r::GUI::ArrangeJob::prepare_all(), Slic3r::GUI::ArrangeJob::prepare_selected(), Slic3r::GUI::RotoptimizeJob::process(), Slic3r::GUI::Plater::priv::reload_all_from_disk(), Slic3r::GUI::reloadable_volumes(), Slic3r::GUI::Plater::priv::remove(), Slic3r::GUI::Plater::priv::replace_volume_with_stl(), Slic3r::GUI::Plater::priv::replace_with_stl(), Slic3r::GUI::Plater::priv::reset(), reslice(), Slic3r::GUI::Plater::priv::set_current_panel(), Slic3r::GUI::Plater::priv::split_object(), priv::start_create_volume_on_surface_job(), Slic3r::GUI::Plater::priv::take_snapshot(), Slic3r::GUI::Plater::priv::undo_redo_to(), Slic3r::GUI::Plater::priv::update(), Slic3r::GUI::Plater::priv::update_after_undo_redo(), Slic3r::GUI::Preview::update_layers_slider(), and priv::update_volume().

◆ msw_rescale()

void Slic3r::GUI::Plater::msw_rescale ( )
7470{
7471 p->preview->msw_rescale();
7472
7473 p->view3D->get_canvas3d()->msw_rescale();
7474
7475 p->sidebar->msw_rescale();
7476
7477 Layout();
7478 GetParent()->Layout();
7479}

References p.

◆ multi_selection_menu()

wxMenu * Slic3r::GUI::Plater::multi_selection_menu ( )
7714{ return p->menus.multi_selection_menu(); }

References p.

Referenced by Slic3r::GUI::ObjectList::show_context_menu().

+ Here is the caller graph for this function:

◆ new_project()

void Slic3r::GUI::Plater::new_project ( )
5235{
5236 if (int saved_project = p->save_project_if_dirty(_L("Creating a new project while the current project is modified.")); saved_project == wxID_CANCEL)
5237 return;
5238 else {
5239 wxString header = _L("Creating a new project while some presets are modified.") + "\n" +
5240 (saved_project == wxID_YES ? _L("You can keep presets modifications to the new project or discard them") :
5241 _L("You can keep presets modifications to the new project, discard them or save changes as new presets.\n"
5242 "Note, if changes will be saved then new project wouldn't keep them"));
5243 int act_buttons = ActionButtons::KEEP;
5244 if (saved_project == wxID_NO)
5245 act_buttons |= ActionButtons::SAVE;
5246 if (!wxGetApp().check_and_keep_current_preset_changes(_L("Creating a new project"), header, act_buttons))
5247 return;
5248 }
5249
5250 p->select_view_3D("3D");
5252 Plater::SuppressSnapshots suppress(this);
5253 reset();
5254 // Save the names of active presets and project specific config into ProjectDirtyStateManager.
5256 // Make a copy of the active presets for detecting changes in preset values.
5257 wxGetApp().update_saved_preset_from_current_preset();
5258 // Update Project dirty state, update application title bar.
5260}
void take_snapshot(const std::string &snapshot_name)
Definition Plater.cpp:6891
void reset()
Definition Plater.cpp:6099
@ KEEP
Definition UnsavedChangesDialog.hpp:251
@ SAVE
Definition UnsavedChangesDialog.hpp:252

References _L, Slic3r::GUI::KEEP, p, Slic3r::UndoRedo::ProjectSeparator, reset(), reset_project_dirty_initial_presets(), Slic3r::GUI::SAVE, take_snapshot(), and update_project_dirty_from_presets().

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ object_menu()

wxMenu * Slic3r::GUI::Plater::object_menu ( )
7707{ return p->menus.object_menu(); }

References p.

Referenced by Slic3r::GUI::ObjectList::show_context_menu().

+ Here is the caller graph for this function:

◆ on_activate()

void Slic3r::GUI::Plater::on_activate ( )
7144{
7145 this->p->show_delayed_error_message();
7146}

References p.

Referenced by Slic3r::GUI::MainFrame::MainFrame().

+ Here is the caller graph for this function:

◆ on_config_change()

void Slic3r::GUI::Plater::on_config_change ( const DynamicPrintConfig config)
7008{
7009 bool update_scheduled = false;
7010 bool bed_shape_changed = false;
7011 for (auto opt_key : p->config->diff(config)) {
7012 if (opt_key == "filament_colour") {
7013 update_scheduled = true; // update should be scheduled (for update 3DScene) #2738
7014
7016 p->sidebar->obj_list()->update_extruder_colors();
7017 continue;
7018 }
7019 }
7020 if (opt_key == "material_colour") {
7021 update_scheduled = true; // update should be scheduled (for update 3DScene)
7022 }
7023
7024 p->config->set_key_value(opt_key, config.option(opt_key)->clone());
7025 if (opt_key == "printer_technology") {
7027 this->set_printer_technology(printer_technology);
7028 p->sidebar->show_sliced_info_sizer(false);
7029 p->reset_gcode_toolpaths();
7030 p->view3D->get_canvas3d()->reset_sequential_print_clearance();
7031 p->view3D->get_canvas3d()->set_sla_view_type(GLCanvas3D::ESLAViewType::Original);
7032 }
7033 else if (opt_key == "bed_shape" || opt_key == "bed_custom_texture" || opt_key == "bed_custom_model") {
7034 bed_shape_changed = true;
7035 update_scheduled = true;
7036 }
7037 else if (boost::starts_with(opt_key, "wipe_tower") ||
7038 // opt_key == "filament_minimal_purge_on_wipe_tower" // ? #ys_FIXME
7039 opt_key == "single_extruder_multi_material") {
7040 update_scheduled = true;
7041 }
7042 else if(opt_key == "variable_layer_height") {
7043 if (p->config->opt_bool("variable_layer_height") != true) {
7044 p->view3D->enable_layers_editing(false);
7045 p->view3D->set_as_dirty();
7046 }
7047 }
7048 else if(opt_key == "extruder_colour") {
7049 update_scheduled = true;
7050 p->sidebar->obj_list()->update_extruder_colors();
7051 }
7052 else if (opt_key == "max_print_height") {
7053 bed_shape_changed = true;
7054 update_scheduled = true;
7055 }
7056 else if (opt_key == "printer_model") {
7057 p->reset_gcode_toolpaths();
7058 // update to force bed selection(for texturing)
7059 bed_shape_changed = true;
7060 update_scheduled = true;
7061 }
7062 }
7063
7064 if (bed_shape_changed)
7065 set_bed_shape();
7066
7067 if (update_scheduled)
7068 update();
7069
7070 if (p->main_frame->is_loaded())
7071 this->p->schedule_background_process();
7072}
ENUM opt_enum(const t_config_option_key &opt_key) const
Definition Config.hpp:2294
virtual ConfigOption * clone() const =0
bool update_filament_colors_in_full_config()
Definition Plater.cpp:6987
bool set_printer_technology(PrinterTechnology printer_technology)
Definition Plater.cpp:7276
void set_bed_shape() const
Definition Plater.cpp:7074
PrinterTechnology
Definition Config.hpp:205
Slic3r::Polygons diff(const Slic3r::Polygon &subject, const Slic3r::Polygon &clip, ApplySafetyOffset do_safety_offset)
Definition ClipperUtils.cpp:672

References Slic3r::ConfigOption::clone(), config(), Slic3r::ConfigBase::opt_enum(), Slic3r::ConfigBase::option(), Slic3r::GUI::GLCanvas3D::Original, p, printer_technology(), set_bed_shape(), set_printer_technology(), update(), and update_filament_colors_in_full_config().

Referenced by Slic3r::GUI::MainFrame::init_tabpanel(), Slic3r::GUI::MainFrame::load_config(), Slic3r::GUI::MainFrame::on_config_changed(), Slic3r::GUI::MainFrame::on_presets_changed(), and Slic3r::GUI::MainFrame::on_value_changed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_extruders_change()

void Slic3r::GUI::Plater::on_extruders_change ( size_t  extruders_count)
6958{
6959 auto& choices = sidebar().combos_filament();
6960
6961 if (num_extruders == choices.size())
6962 return;
6963
6964 dynamic_cast<TabFilament*>(wxGetApp().get_tab(Preset::TYPE_FILAMENT))->update_extruder_combobox();
6965
6966 wxWindowUpdateLocker noUpdates_scrolled_panel(&sidebar()/*.scrolled_panel()*/);
6967
6968 size_t i = choices.size();
6969 while ( i < num_extruders )
6970 {
6971 PlaterPresetComboBox* choice/*{ nullptr }*/;
6972 sidebar().init_filament_combo(&choice, i);
6973 choices.push_back(choice);
6974
6975 // initialize selection
6976 choice->update();
6977 ++i;
6978 }
6979
6980 // remove unused choices if any
6981 sidebar().remove_unused_filament_combos(num_extruders);
6982
6983 sidebar().Layout();
6984 sidebar().scrolled_panel()->Refresh();
6985}
void init_filament_combo(PlaterPresetComboBox **combo, const int extr_idx)
Definition Plater.cpp:1007
wxScrolledWindow * scrolled_panel()
Definition Plater.cpp:1250
std::vector< PlaterPresetComboBox * > & combos_filament()
Definition Plater.cpp:1586
void remove_unused_filament_combos(const size_t current_extruder_count)
Definition Plater.cpp:1025

References Slic3r::GUI::Sidebar::combos_filament(), Slic3r::GUI::Sidebar::init_filament_combo(), Slic3r::GUI::Sidebar::remove_unused_filament_combos(), Slic3r::GUI::Sidebar::scrolled_panel(), sidebar(), Slic3r::Preset::TYPE_FILAMENT, and Slic3r::GUI::PlaterPresetComboBox::update().

Referenced by Slic3r::GUI::MainFrame::init_tabpanel(), and Slic3r::GUI::MainFrame::on_value_changed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=() [1/2]

Plater & Slic3r::GUI::Plater::operator= ( const Plater )
delete

◆ operator=() [2/2]

Plater & Slic3r::GUI::Plater::operator= ( Plater &&  )
delete

◆ part_menu()

wxMenu * Slic3r::GUI::Plater::part_menu ( )
7708{ return p->menus.part_menu(); }

References p.

Referenced by Slic3r::GUI::ObjectList::show_context_menu().

+ Here is the caller graph for this function:

◆ paste_from_clipboard()

void Slic3r::GUI::Plater::paste_from_clipboard ( )
7433{
7435 return;
7436
7437 Plater::TakeSnapshot snapshot(this, _L("Paste From Clipboard"));
7438
7439 // At first try to paste values from the ObjectList's clipboard
7440 // to check if Settings or Layers were copied
7441 // and then paste from the 3DCanvas's clipboard if not
7442 if (!p->sidebar->obj_list()->paste_from_clipboard())
7443 p->view3D->get_canvas3d()->get_selection().paste_from_clipboard();
7444}
bool can_paste_from_clipboard() const
Definition Plater.cpp:7616

References _L, can_paste_from_clipboard(), and p.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PopupMenu() [1/2]

bool Slic3r::GUI::Plater::PopupMenu ( wxMenu *  menu,
const wxPoint &  pos = wxDefaultPosition 
)
7686{
7687 // Don't want to wake up and trigger reslicing while tracking the pop-up menu.
7689 // When tracking a pop-up menu, postpone error messages from the slicing result.
7690 m_tracking_popup_menu = true;
7691 bool out = this->wxPanel::PopupMenu(menu, pos);
7692 m_tracking_popup_menu = false;
7694 // Don't know whether the CallAfter is necessary, but it should not hurt.
7695 // The menus likely sends out some commands, so we may be safer if the dialog is shown after the menu command is processed.
7696 wxString message = std::move(m_tracking_popup_menu_error_message);
7697 wxTheApp->CallAfter([message, this]() { show_error(this, message); });
7699 }
7700 return out;
7701}
friend class SuppressBackgroundProcessingUpdate
Definition Plater.hpp:507
wxString m_tracking_popup_menu_error_message
Definition Plater.hpp:500
bool m_tracking_popup_menu
Definition Plater.hpp:499

References m_tracking_popup_menu, m_tracking_popup_menu_error_message, and Slic3r::GUI::show_error().

Referenced by Slic3r::GUI::ObjectList::show_context_menu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PopupMenu() [2/2]

bool Slic3r::GUI::Plater::PopupMenu ( wxMenu *  menu,
int  x,
int  y 
)
inline
474{ return this->PopupMenu(menu, wxPoint(x, y)); }
bool PopupMenu(wxMenu *menu, const wxPoint &pos=wxDefaultPosition)
Definition Plater.cpp:7685

References PopupMenu().

Referenced by PopupMenu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ preview_zip_archive()

bool Slic3r::GUI::Plater::preview_zip_archive ( const boost::filesystem::path &  input_file)
5596{
5597 //std::vector<fs::path> unzipped_paths;
5598 std::vector<fs::path> non_project_paths;
5599 std::vector<fs::path> project_paths;
5600 try
5601 {
5602 mz_zip_archive archive;
5603 mz_zip_zero_struct(&archive);
5604
5605 if (!open_zip_reader(&archive, archive_path.string())) {
5606 // TRN %1% is archive path
5607 std::string err_msg = GUI::format(_u8L("Loading of a ZIP archive on path %1% has failed."), archive_path.string());
5608 throw Slic3r::FileIOError(err_msg);
5609 }
5610 mz_uint num_entries = mz_zip_reader_get_num_files(&archive);
5612 // selected_paths contains paths and its uncompressed size. The size is used to distinguish between files with same path.
5613 std::vector<std::pair<fs::path, size_t>> selected_paths;
5614 FileArchiveDialog dlg(static_cast<wxWindow*>(wxGetApp().mainframe), &archive, selected_paths);
5615 if (dlg.ShowModal() == wxID_OK)
5616 {
5617 std::string archive_path_string = archive_path.string();
5618 archive_path_string = archive_path_string.substr(0, archive_path_string.size() - 4);
5619 fs::path archive_dir(wxStandardPaths::Get().GetTempDir().utf8_str().data());
5620
5621 for (auto& path_w_size : selected_paths) {
5622 const fs::path& path = path_w_size.first;
5623 size_t size = path_w_size.second;
5624 // find path in zip archive
5625 for (mz_uint i = 0; i < num_entries; ++i) {
5626 if (mz_zip_reader_file_stat(&archive, i, &stat)) {
5627 if (size != stat.m_uncomp_size) // size must fit
5628 continue;
5629 wxString wname = boost::nowide::widen(stat.m_filename);
5630 std::string name = boost::nowide::narrow(wname);
5631 fs::path archive_path(name);
5632
5633 std::string extra(1024, 0);
5634 size_t extra_size = mz_zip_reader_get_filename_from_extra(&archive, i, extra.data(), extra.size());
5635 if (extra_size > 0) {
5636 archive_path = fs::path(extra.substr(0, extra_size));
5637 name = archive_path.string();
5638 }
5639
5640 if (archive_path.empty())
5641 continue;
5642 if (path != archive_path)
5643 continue;
5644 // decompressing
5645 try
5646 {
5647 std::replace(name.begin(), name.end(), '\\', '/');
5648 // rename if file exists
5649 std::string filename = path.filename().string();
5650 std::string extension = boost::filesystem::extension(path);
5651 std::string just_filename = filename.substr(0, filename.size() - extension.size());
5652 std::string final_filename = just_filename;
5653
5654 size_t version = 0;
5655 while (fs::exists(archive_dir / (final_filename + extension)))
5656 {
5657 ++version;
5658 final_filename = just_filename + "(" + std::to_string(version) + ")";
5659 }
5660 filename = final_filename + extension;
5661 fs::path final_path = archive_dir / filename;
5662 std::string buffer((size_t)stat.m_uncomp_size, 0);
5663 // Decompress action. We already has correct file index in stat structure.
5664 mz_bool res = mz_zip_reader_extract_to_mem(&archive, stat.m_file_index, (void*)buffer.data(), (size_t)stat.m_uncomp_size, 0);
5665 if (res == 0) {
5666 wxString error_log = GUI::format_wxstr(_L("Failed to unzip file to %1%: %2% "), final_path.string(), mz_zip_get_error_string(mz_zip_get_last_error(&archive)));
5667 BOOST_LOG_TRIVIAL(error) << error_log;
5668 show_error(nullptr, error_log);
5669 break;
5670 }
5671 // write buffer to file
5672 fs::fstream file(final_path, std::ios::out | std::ios::binary | std::ios::trunc);
5673 file.write(buffer.c_str(), buffer.size());
5674 file.close();
5675 if (!fs::exists(final_path)) {
5676 wxString error_log = GUI::format_wxstr(_L("Failed to find unzipped file at %1%. Unzipping of file has failed."), final_path.string());
5677 BOOST_LOG_TRIVIAL(error) << error_log;
5678 show_error(nullptr, error_log);
5679 break;
5680 }
5681 BOOST_LOG_TRIVIAL(info) << "Unzipped " << final_path;
5682 if (!boost::algorithm::iends_with(filename, ".3mf") && !boost::algorithm::iends_with(filename, ".amf")) {
5683 non_project_paths.emplace_back(final_path);
5684 break;
5685 }
5686 // if 3mf - read archive headers to find project file
5687 if ((boost::algorithm::iends_with(filename, ".3mf") && !is_project_3mf(final_path.string())) ||
5688 (boost::algorithm::iends_with(filename, ".amf") && !boost::algorithm::iends_with(filename, ".zip.amf"))) {
5689 non_project_paths.emplace_back(final_path);
5690 break;
5691 }
5692
5693 project_paths.emplace_back(final_path);
5694 break;
5695 }
5696 catch (const std::exception& e)
5697 {
5698 // ensure the zip archive is closed and rethrow the exception
5699 close_zip_reader(&archive);
5700 throw Slic3r::FileIOError(e.what());
5701 }
5702 }
5703 }
5704 }
5705 close_zip_reader(&archive);
5706 if (non_project_paths.size() + project_paths.size() != selected_paths.size())
5707 BOOST_LOG_TRIVIAL(error) << "Decompresing of archive did not retrieve all files. Expected files: "
5708 << selected_paths.size()
5709 << " Decopressed files: "
5710 << non_project_paths.size() + project_paths.size();
5711 } else {
5712 close_zip_reader(&archive);
5713 return false;
5714 }
5715
5716 }
5717 catch (const Slic3r::FileIOError& e) {
5718 // zip reader should be already closed or not even opened
5719 GUI::show_error(this, e.what());
5720 return false;
5721 }
5722 // none selected
5723 if (project_paths.empty() && non_project_paths.empty())
5724 {
5725 return false;
5726 }
5727#if 0
5728 // 1 project, 0 models - behave like drag n drop
5729 if (project_paths.size() == 1 && non_project_paths.empty())
5730 {
5731 wxArrayString aux;
5732 aux.Add(from_u8(project_paths.front().string()));
5733 load_files(aux);
5734 //load_files(project_paths, true, true);
5735 boost::system::error_code ec;
5736 fs::remove(project_paths.front(), ec);
5737 if (ec)
5738 BOOST_LOG_TRIVIAL(error) << ec.message();
5739 return true;
5740 }
5741 // 1 model (or more and other instances are not allowed), 0 projects - open geometry
5742 if (project_paths.empty() && (non_project_paths.size() == 1 || wxGetApp().app_config->get_bool("single_instance")))
5743 {
5744 load_files(non_project_paths, true, false);
5745 boost::system::error_code ec;
5746 fs::remove(non_project_paths.front(), ec);
5747 if (ec)
5748 BOOST_LOG_TRIVIAL(error) << ec.message();
5749 return true;
5750 }
5751
5752 bool delete_after = true;
5753
5754 LoadProjectsDialog dlg(project_paths);
5755 if (dlg.ShowModal() == wxID_OK) {
5757 switch (option)
5758 {
5760 load_files(project_paths, true, false);
5761 load_files(non_project_paths, true, false);
5762 break;
5763 }
5765 delete_after = false;
5766 for (const fs::path& path : project_paths) {
5767 wxString f = from_path(path);
5768 start_new_slicer(&f, false);
5769 }
5770 for (const fs::path& path : non_project_paths) {
5771 wxString f = from_path(path);
5772 start_new_slicer(&f, false);
5773 }
5774 break;
5775 }
5777 int pos = dlg.get_selected();
5778 assert(pos >= 0 && pos < project_paths.size());
5779 if (wxGetApp().can_load_project())
5780 load_project(from_path(project_paths[pos]));
5781 project_paths.erase(project_paths.begin() + pos);
5782 load_files(project_paths, true, false);
5783 load_files(non_project_paths, true, false);
5784 break;
5785 }
5787 int pos = dlg.get_selected();
5788 assert(pos >= 0 && pos < project_paths.size());
5789 std::vector<fs::path> aux;
5790 aux.push_back(project_paths[pos]);
5791 load_files(aux, false, true);
5792 project_paths.erase(project_paths.begin() + pos);
5793 load_files(project_paths, true, false);
5794 load_files(non_project_paths, true, false);
5795 break;
5796 }
5798 default:
5799 assert(false);
5800 break;
5801 }
5802 }
5803
5804 if (!delete_after)
5805 return true;
5806#else
5807 // 1 project file and some models - behave like drag n drop of 3mf and then load models
5808 if (project_paths.size() == 1)
5809 {
5810 wxArrayString aux;
5811 aux.Add(from_u8(project_paths.front().string()));
5812 bool loaded3mf = load_files(aux, true);
5813 load_files(non_project_paths, true, false);
5814 boost::system::error_code ec;
5815 if (loaded3mf) {
5816 fs::remove(project_paths.front(), ec);
5817 if (ec)
5818 BOOST_LOG_TRIVIAL(error) << ec.message();
5819 }
5820 for (const fs::path& path : non_project_paths) {
5821 // Delete file from temp file (path variable), it will stay only in app memory.
5822 boost::system::error_code ec;
5823 fs::remove(path, ec);
5824 if (ec)
5825 BOOST_LOG_TRIVIAL(error) << ec.message();
5826 }
5827 return true;
5828 }
5829
5830 // load all projects and all models as geometry
5831 load_files(project_paths, true, false);
5832 load_files(non_project_paths, true, false);
5833#endif // 0
5834
5835
5836 for (const fs::path& path : project_paths) {
5837 // Delete file from temp file (path variable), it will stay only in app memory.
5838 boost::system::error_code ec;
5839 fs::remove(path, ec);
5840 if (ec)
5841 BOOST_LOG_TRIVIAL(error) << ec.message();
5842 }
5843 for (const fs::path& path : non_project_paths) {
5844 // Delete file from temp file (path variable), it will stay only in app memory.
5845 boost::system::error_code ec;
5846 fs::remove(path, ec);
5847 if (ec)
5848 BOOST_LOG_TRIVIAL(error) << ec.message();
5849 }
5850
5851 return true;
5852}
LoadProjectOption
Definition Plater.cpp:5459
Definition getopt.h:102
char * version
Definition main.c:59
mz_uint mz_zip_reader_get_num_files(mz_zip_archive *pZip)
Definition miniz.c:7870
mz_zip_error mz_zip_get_last_error(mz_zip_archive *pZip)
Definition miniz.c:7765
const char * mz_zip_get_error_string(mz_zip_error mz_err)
Definition miniz.c:7778
void mz_zip_zero_struct(mz_zip_archive *pZip)
Definition miniz.c:3792
mz_bool mz_zip_reader_extract_to_mem(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags)
Definition miniz.c:4528
mz_bool mz_zip_reader_file_stat(mz_zip_archive *pZip, mz_uint file_index, mz_zip_archive_file_stat *pStat)
Definition miniz.c:7959
mz_uint mz_zip_reader_get_filename_from_extra(mz_zip_archive *pZip, mz_uint file_index, char *buffer, mz_uint extra_buf_size)
Definition miniz.c:7925
unsigned int mz_uint
Definition miniz.h:489
int mz_bool
Definition miniz.h:492
Definition miniz.h:1053
Definition miniz.h:924
std::string format(const char *fmt, TArgs &&... args)
Definition format.hpp:56
wxString from_u8(const std::string &str)
Definition GUI.cpp:437
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:14
bool open_zip_reader(mz_zip_archive *zip, const std::string &fname)
Definition miniz_extension.cpp:62
bool close_zip_reader(mz_zip_archive *zip)
Definition miniz_extension.cpp:72
constexpr auto size(const C &c) -> decltype(c.size())
Definition span.hpp:183
constexpr auto data(C &c) -> decltype(c.data())
Definition span.hpp:195
char * narrow(char *output, size_t output_size, wchar_t const *source)
Convert NULL terminated UTF source string to NULL terminated output string of size at most output_siz...
Definition convert.hpp:73
wchar_t * widen(wchar_t *output, size_t output_size, char const *source)
Convert NULL terminated UTF source string to NULL terminated output string of size at most output_siz...
Definition convert.hpp:95
static char error[256]
Definition tga.cpp:50
#define stat
Definition unistd.h:53

References _L, _u8L, Slic3r::GUI::LoadProjectsDialog::AllGeometry, Slic3r::GUI::LoadProjectsDialog::AllNewWindow, Slic3r::close_zip_reader(), error, Slic3r::f(), Slic3r::GUI::format(), Slic3r::GUI::format_wxstr(), Slic3r::GUI::from_path(), Slic3r::GUI::from_u8(), Slic3r::GUI::LoadProjectsDialog::get_action(), Slic3r::GUI::LoadProjectsDialog::get_selected(), Slic3r::is_project_3mf(), load_files(), load_project(), mz_zip_get_error_string(), mz_zip_get_last_error(), mz_zip_reader_extract_to_mem(), mz_zip_reader_file_stat(), mz_zip_reader_get_filename_from_extra(), mz_zip_reader_get_num_files(), mz_zip_zero_struct(), boost::nowide::narrow(), Slic3r::GUI::LoadProjectsDialog::OneConfig, Slic3r::GUI::LoadProjectsDialog::OneProject, Slic3r::open_zip_reader(), Slic3r::GUI::show_error(), Slic3r::GUI::start_new_slicer(), stat, Slic3r::GUI::LoadProjectsDialog::Unknown, version, and boost::nowide::widen().

Referenced by load_files().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printer_technology()

◆ redo()

void Slic3r::GUI::Plater::redo ( )
6898{ p->redo(); }

References p.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the caller graph for this function:

◆ redo_to()

void Slic3r::GUI::Plater::redo_to ( int  selection)
6910{
6911 if (selection == 0) {
6912 p->redo();
6913 return;
6914 }
6915
6916 const int idx = p->get_active_snapshot_index() + selection + 1;
6917 p->undo_redo_to(p->undo_redo_stack().snapshots()[idx].timestamp);
6918}

References p.

◆ refresh_print()

void Slic3r::GUI::Plater::refresh_print ( )
5434{
5435 p->preview->refresh_print();
5436}

References p.

Referenced by Slic3r::GUI::GUI_App::open_preferences().

+ Here is the caller graph for this function:

◆ reload_all_from_disk()

void Slic3r::GUI::Plater::reload_all_from_disk ( )
6698{
6699 p->reload_all_from_disk();
6700}

References p.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the caller graph for this function:

◆ reload_from_disk()

void Slic3r::GUI::Plater::reload_from_disk ( )
6688{
6689 p->reload_from_disk();
6690}

References p.

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_reload_from_disk(), and Slic3r::GUI::Plater::priv::reload_all_from_disk().

+ Here is the caller graph for this function:

◆ reload_gcode_from_disk()

void Slic3r::GUI::Plater::reload_gcode_from_disk ( )
5427{
5428 wxString filename(m_last_loaded_gcode);
5429 m_last_loaded_gcode.clear();
5430 load_gcode(filename);
5431}

References load_gcode(), and m_last_loaded_gcode.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_gcodeviewer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove()

void Slic3r::GUI::Plater::remove ( size_t  obj_idx)
6098{ p->remove(obj_idx); }

References p.

Referenced by Slic3r::GUI::GLGizmoEmboss::close(), convert_unit(), decrease_instances(), and Slic3r::GUI::Plater::priv::split_object().

+ Here is the caller graph for this function:

◆ remove_selected()

void Slic3r::GUI::Plater::remove_selected ( )
6111{
6112 if (p->get_selection().is_empty())
6113 return;
6114
6115 Plater::TakeSnapshot snapshot(this, _L("Delete Selected Objects"));
6117 p->view3D->delete_selected();
6118}
virtual void cancel_all()=0

References _L, Slic3r::GUI::Worker::cancel_all(), get_ui_job_worker(), and p.

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_delete(), Slic3r::GUI::GLGizmoEmboss::close(), and Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ replace_with_stl()

void Slic3r::GUI::Plater::replace_with_stl ( )
6693{
6694 p->replace_with_stl();
6695}

References p.

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_replace_with_stl().

+ Here is the caller graph for this function:

◆ reset()

void Slic3r::GUI::Plater::reset ( )
6099{ p->reset(); }

References p.

Referenced by new_project(), and reset_with_confirm().

+ Here is the caller graph for this function:

◆ reset_canvas_volumes()

void Slic3r::GUI::Plater::reset_canvas_volumes ( )
7265{
7266 p->reset_canvas_volumes();
7267}

References p.

Referenced by Slic3r::GUI::MainFrame::shutdown().

+ Here is the caller graph for this function:

◆ reset_gcode_toolpaths()

void Slic3r::GUI::Plater::reset_gcode_toolpaths ( )
7576{
7577 p->reset_gcode_toolpaths();
7578}

References p.

Referenced by Slic3r::GUI::Plater::priv::delete_all_objects_from_model(), load_gcode(), Slic3r::GUI::Plater::priv::reset(), reslice(), and Slic3r::GUI::Plater::priv::update_background_process().

+ Here is the caller graph for this function:

◆ reset_last_loaded_gcode()

void Slic3r::GUI::Plater::reset_last_loaded_gcode ( )
inline
408{ m_last_loaded_gcode = ""; }

References m_last_loaded_gcode.

◆ reset_project_dirty_after_save()

void Slic3r::GUI::Plater::reset_project_dirty_after_save ( )
5215{ p->reset_project_dirty_after_save(); }

References p.

Referenced by Slic3r::GUI::MainFrame::save_project_as().

+ Here is the caller graph for this function:

◆ reset_project_dirty_initial_presets()

void Slic3r::GUI::Plater::reset_project_dirty_initial_presets ( )
5216{ p->reset_project_dirty_initial_presets(); }

References p.

Referenced by load_project(), and new_project().

+ Here is the caller graph for this function:

◆ reset_with_confirm()

void Slic3r::GUI::Plater::reset_with_confirm ( )
6101{
6102 if (p->model.objects.empty() ||
6103 //wxMessageDialog(static_cast<wxWindow*>(this), _L("All objects will be removed, continue?"), wxString(SLIC3R_APP_NAME) + " - " + _L("Delete all"), wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxCENTRE).ShowModal() == wxID_YES)
6104 MessageDialog(static_cast<wxWindow*>(this), _L("All objects will be removed, continue?"), wxString(SLIC3R_APP_NAME) + " - " + _L("Delete all"), wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxCENTRE).ShowModal() == wxID_YES)
6105 reset();
6106}

References _L, p, and reset().

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reslice()

void Slic3r::GUI::Plater::reslice ( )
6721{
6722 // There is "invalid data" button instead "slice now"
6723 if (p->process_completed_with_error)
6724 return;
6725
6726 // In case SLA gizmo is in editing mode, refuse to continue
6727 // and notify user that he should leave it first.
6728 if (canvas3D()->get_gizmos_manager().is_in_editing_mode(true))
6729 return;
6730
6731 // Stop the running (and queued) UI jobs and only proceed if they actually
6732 // get stopped.
6733 unsigned timeout_ms = 10000;
6734 if (!stop_queue(this->get_ui_job_worker(), timeout_ms)) {
6735 BOOST_LOG_TRIVIAL(error) << "Could not stop UI job within "
6736 << timeout_ms << " milliseconds timeout!";
6737 return;
6738 }
6739
6740 if (printer_technology() == ptSLA) {
6741 for (auto& object : model().objects)
6742 if (object->sla_points_status == sla::PointsStatus::NoPoints)
6743 object->sla_points_status = sla::PointsStatus::Generating;
6744 }
6745
6746 //FIXME Don't reslice if export of G-code or sending to OctoPrint is running.
6747 // bitmask of UpdateBackgroundProcessReturnState
6748 unsigned int state = this->p->update_background_process(true);
6750 this->p->view3D->reload_scene(false);
6751 // If the SLA processing of just a single object's supports is running, restart slicing for the whole object.
6752 this->p->background_process.set_task(PrintBase::TaskParams());
6753 // Only restarts if the state is valid.
6754 this->p->restart_background_process(state | priv::UPDATE_BACKGROUND_PROCESS_FORCE_RESTART);
6755
6756 if ((state & priv::UPDATE_BACKGROUND_PROCESS_INVALID) != 0)
6757 return;
6758
6759 bool clean_gcode_toolpaths = true;
6760 if (p->background_process.running())
6761 {
6762 if (wxGetApp().get_mode() == comSimple)
6763 p->sidebar->set_btn_label(ActionButtonType::abReslice, _L("Slicing") + dots);
6764 else
6765 {
6766 p->sidebar->set_btn_label(ActionButtonType::abReslice, _L("Slice now"));
6767 p->show_action_buttons(false);
6768 }
6769 }
6770 else if (!p->background_process.empty() && !p->background_process.idle())
6771 p->show_action_buttons(true);
6772 else
6773 clean_gcode_toolpaths = false;
6774
6775 if (clean_gcode_toolpaths)
6777
6778 p->preview->reload_print(!clean_gcode_toolpaths);
6779}
bool stop_queue(Worker &w, unsigned timeout_ms=0)
Definition Worker.hpp:111
static wxString dots("…", wxConvUTF8)
PointsStatus
Definition SupportPoint.hpp:13
@ comSimple
Definition Config.hpp:198
@ UPDATE_BACKGROUND_PROCESS_REFRESH_SCENE
Definition Plater.cpp:1867
@ UPDATE_BACKGROUND_PROCESS_FORCE_RESTART
Definition Plater.cpp:1872

References _L, Slic3r::GUI::abReslice, canvas3D(), Slic3r::comSimple, Slic3r::GUI::dots(), error, Slic3r::sla::Generating, get_ui_job_worker(), model(), Slic3r::sla::NoPoints, Slic3r::Model::objects, p, printer_technology(), Slic3r::ptSLA, reset_gcode_toolpaths(), Slic3r::GUI::stop_queue(), Slic3r::GUI::Plater::priv::UPDATE_BACKGROUND_PROCESS_FORCE_RESTART, Slic3r::GUI::Plater::priv::UPDATE_BACKGROUND_PROCESS_INVALID, and Slic3r::GUI::Plater::priv::UPDATE_BACKGROUND_PROCESS_REFRESH_SCENE.

Referenced by Slic3r::GUI::MainFrame::reslice_now().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reslice_FFF_until_step()

void Slic3r::GUI::Plater::reslice_FFF_until_step ( PrintObjectStep  step,
const ModelObject object,
bool  postpone_error_messages = false 
)
6808{
6809 this->reslice_until_step_inner(PrintObjectStep(step), object, postpone_error_messages);
6810}
void reslice_until_step_inner(int step, const ModelObject &object, bool postpone_error_messages)
Definition Plater.cpp:6781
PrintObjectStep
Definition Print.hpp:68

References reslice_until_step_inner().

+ Here is the call graph for this function:

◆ reslice_SLA_until_step()

void Slic3r::GUI::Plater::reslice_SLA_until_step ( SLAPrintObjectStep  step,
const ModelObject object,
bool  postpone_error_messages = false 
)
6813{
6814 this->reslice_until_step_inner(SLAPrintObjectStep(step), object, postpone_error_messages);
6815}
SLAPrintObjectStep
Definition SLAPrint.hpp:27

References reslice_until_step_inner().

+ Here is the call graph for this function:

◆ reslice_until_step_inner()

void Slic3r::GUI::Plater::reslice_until_step_inner ( int  step,
const ModelObject object,
bool  postpone_error_messages 
)
private
6782{
6783 //FIXME Don't reslice if export of G-code or sending to OctoPrint is running.
6784 // bitmask of UpdateBackgroundProcessReturnState
6785 unsigned int state = this->p->update_background_process(true, postpone_error_messages);
6787 this->p->view3D->reload_scene(false);
6788
6789 if (this->p->background_process.empty() || (state & priv::UPDATE_BACKGROUND_PROCESS_INVALID))
6790 // Nothing to do on empty input or invalid configuration.
6791 return;
6792
6793 // Limit calculation to the single object only.
6794 PrintBase::TaskParams task;
6795 task.single_model_object = object.id();
6796 // If the background processing is not enabled, calculate supports just for the single instance.
6797 // Otherwise calculate everything, but start with the provided object.
6798 if (!this->p->background_processing_enabled()) {
6799 task.single_model_instance_only = true;
6800 task.to_object_step = step;
6801 }
6802 this->p->background_process.set_task(task);
6803 // and let the background processing start.
6804 this->p->restart_background_process(state | priv::UPDATE_BACKGROUND_PROCESS_FORCE_RESTART);
6805}
Coord step(const Coord &crd, Dir d)
Definition MarchingSquares.hpp:137

References Slic3r::ObjectID::id, p, Slic3r::PrintBase::TaskParams::single_model_instance_only, Slic3r::PrintBase::TaskParams::single_model_object, Slic3r::PrintBase::TaskParams::to_object_step, Slic3r::GUI::Plater::priv::UPDATE_BACKGROUND_PROCESS_FORCE_RESTART, Slic3r::GUI::Plater::priv::UPDATE_BACKGROUND_PROCESS_INVALID, and Slic3r::GUI::Plater::priv::UPDATE_BACKGROUND_PROCESS_REFRESH_SCENE.

Referenced by reslice_FFF_until_step(), and reslice_SLA_until_step().

+ Here is the caller graph for this function:

◆ save_project_if_dirty()

int Slic3r::GUI::Plater::save_project_if_dirty ( const wxString &  reason)
5214{ return p->save_project_if_dirty(reason); }

References p.

Referenced by Slic3r::GUI::MainFrame::MainFrame(), and Slic3r::GUI::GUI_App::can_load_project().

+ Here is the caller graph for this function:

◆ scale_selection_to_fit_print_volume()

void Slic3r::GUI::Plater::scale_selection_to_fit_print_volume ( )
6274{
6275 p->scale_selection_to_fit_print_volume();
6276}

References p.

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_scale_selection_to_fit_print_volume().

+ Here is the caller graph for this function:

◆ schedule_background_process()

void Slic3r::GUI::Plater::schedule_background_process ( bool  schedule = true)
7396{
7397 if (schedule)
7398 this->p->schedule_background_process();
7399
7400 this->p->suppressed_backround_processing_update = false;
7401}

References p.

Referenced by Slic3r::GUI::Plater::priv::load_model_objects(), and Slic3r::GUI::Plater::priv::update().

+ Here is the caller graph for this function:

◆ search()

void Slic3r::GUI::Plater::search ( bool  plater_is_active)
7447{
7448 if (plater_is_active) {
7449 if (is_preview_shown())
7450 return;
7451 // plater should be focused for correct navigation inside search window
7452 this->SetFocus();
7453
7454 wxKeyEvent evt;
7455#ifdef __APPLE__
7456 evt.m_keyCode = 'f';
7457#else /* __APPLE__ */
7458 evt.m_keyCode = WXK_CONTROL_F;
7459#endif /* __APPLE__ */
7460 evt.SetControlDown(true);
7461 canvas3D()->on_char(evt);
7462 }
7463 else {
7464 p->sidebar->check_and_update_searcher(true);
7465 p->sidebar->get_searcher().show_dialog();
7466 }
7467}
void on_char(wxKeyEvent &evt)
Definition GLCanvas3D.cpp:2854
bool is_preview_shown() const
Definition Plater.cpp:6080

References canvas3D(), is_preview_shown(), Slic3r::GUI::GLCanvas3D::on_char(), and p.

Referenced by Slic3r::GUI::SettingsDialog::SettingsDialog(), Slic3r::GUI::MainFrame::init_menubar_as_editor(), and Slic3r::GUI::Plater::priv::reload_from_disk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ search_string_getter()

bool Slic3r::GUI::Plater::search_string_getter ( int  idx,
const char **  label,
const char **  tooltip 
)
6946{
6947 const Search::OptionsSearcher& search_list = p->sidebar->get_searcher();
6948
6949 if (0 <= idx && (size_t)idx < search_list.size()) {
6950 search_list[idx].get_marked_label_and_tooltip(label, tooltip);
6951 return true;
6952 }
6953
6954 return false;
6955}

References p, and Slic3r::Search::OptionsSearcher::size().

+ Here is the call graph for this function:

◆ select_all()

void Slic3r::GUI::Plater::select_all ( )
6095{ p->select_all(); }

References p.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor(), and Slic3r::GUI::Plater::priv::reload_all_from_disk().

+ Here is the caller graph for this function:

◆ select_view()

void Slic3r::GUI::Plater::select_view ( const std::string &  direction)
6076{ p->select_view(direction); }

References p.

Referenced by Slic3r::GUI::MainFrame::select_view().

+ Here is the caller graph for this function:

◆ select_view_3D()

void Slic3r::GUI::Plater::select_view_3D ( const std::string &  name)
6078{ p->select_view_3D(name); }

References p.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the caller graph for this function:

◆ send_gcode()

void Slic3r::GUI::Plater::send_gcode ( )
6818{
6819 // if physical_printer is selected, send gcode for this printer
6820 DynamicPrintConfig* physical_printer_config = wxGetApp().preset_bundle->physical_printers.get_selected_printer_config();
6821 if (! physical_printer_config || p->model.objects.empty())
6822 return;
6823
6824 PrintHostJob upload_job(physical_printer_config);
6825 if (upload_job.empty())
6826 return;
6827
6828 // Obtain default output path
6829 fs::path default_output_file;
6830 try {
6831 // Update the background processing, so that the placeholder parser will get the correct values for the ouput file template.
6832 // Also if there is something wrong with the current configuration, a pop-up dialog will be shown and the export will not be performed.
6833 unsigned int state = this->p->update_restart_background_process(false, false);
6835 return;
6836 default_output_file = this->p->background_process.output_filepath_for_project(into_path(get_project_filename(".3mf")));
6837 } catch (const Slic3r::PlaceholderParserError& ex) {
6838 // Show the error with monospaced font.
6839 show_error(this, ex.what(), true);
6840 return;
6841 } catch (const std::exception& ex) {
6842 show_error(this, ex.what(), false);
6843 return;
6844 }
6845 default_output_file = fs::path(Slic3r::fold_utf8_to_ascii(default_output_file.string()));
6846
6847 // Repetier specific: Query the server for the list of file groups.
6848 wxArrayString groups;
6849 {
6850 wxBusyCursor wait;
6851 upload_job.printhost->get_groups(groups);
6852 }
6853 // PrusaLink specific: Query the server for the list of file groups.
6854 wxArrayString storage_paths;
6855 wxArrayString storage_names;
6856 {
6857 wxBusyCursor wait;
6858 try {
6859 upload_job.printhost->get_storage(storage_paths, storage_names);
6860 } catch (const Slic3r::IOError& ex) {
6861 show_error(this, ex.what(), false);
6862 return;
6863 }
6864 }
6865
6866 PrintHostSendDialog dlg(default_output_file, upload_job.printhost->get_post_upload_actions(), groups, storage_paths, storage_names);
6867 if (dlg.ShowModal() == wxID_OK) {
6868 upload_job.upload_data.upload_path = dlg.filename();
6869 upload_job.upload_data.post_action = dlg.post_action();
6870 upload_job.upload_data.group = dlg.group();
6871 upload_job.upload_data.storage = dlg.storage();
6872
6873 // Show "Is printer clean" dialog for PrusaConnect - Upload and print.
6874 if (std::string(upload_job.printhost->get_name()) == "PrusaConnect" && upload_job.upload_data.post_action == PrintHostPostUploadAction::StartPrint) {
6875 GUI::MessageDialog dlg(nullptr, _L("Is the printer ready? Is the print sheet in place, empty and clean?"), _L("Upload and Print"), wxOK | wxCANCEL);
6876 if (dlg.ShowModal() != wxID_OK)
6877 return;
6878 }
6879
6880 p->export_gcode(fs::path(), false, std::move(upload_job));
6881 }
6882}

References _L, Slic3r::PrintHostJob::empty(), Slic3r::GUI::PrintHostSendDialog::filename(), Slic3r::fold_utf8_to_ascii(), get_project_filename(), Slic3r::GUI::PrintHostSendDialog::group(), Slic3r::PrintHostUpload::group, Slic3r::GUI::into_path(), p, Slic3r::GUI::PrintHostSendDialog::post_action(), Slic3r::PrintHostUpload::post_action, Slic3r::PrintHostJob::printhost, Slic3r::GUI::show_error(), Slic3r::StartPrint, Slic3r::GUI::PrintHostSendDialog::storage(), Slic3r::PrintHostUpload::storage, Slic3r::GUI::Plater::priv::UPDATE_BACKGROUND_PROCESS_INVALID, Slic3r::PrintHostJob::upload_data, and Slic3r::PrintHostUpload::upload_path.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_bed_shape() [1/2]

void Slic3r::GUI::Plater::set_bed_shape ( ) const
7075{
7076 set_bed_shape(p->config->option<ConfigOptionPoints>("bed_shape")->values,
7077 p->config->option<ConfigOptionFloat>("max_print_height")->value,
7078 p->config->option<ConfigOptionString>("bed_custom_texture")->value,
7079 p->config->option<ConfigOptionString>("bed_custom_model")->value);
7080}

References p, set_bed_shape(), Slic3r::ConfigOptionSingle< T >::value, and Slic3r::ConfigOptionVector< T >::values.

Referenced by on_config_change(), set_bed_shape(), and set_default_bed_shape().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_bed_shape() [2/2]

void Slic3r::GUI::Plater::set_bed_shape ( const Pointfs shape,
const double  max_print_height,
const std::string &  custom_texture,
const std::string &  custom_model,
bool  force_as_custom = false 
) const
7083{
7084 p->set_bed_shape(shape, max_print_height, custom_texture, custom_model, force_as_custom);
7085}
max_print_height((ConfigOptionFloat, display_width))((ConfigOptionFloat

References Slic3r::max_print_height(), and p.

+ Here is the call graph for this function:

◆ set_current_canvas_as_dirty()

void Slic3r::GUI::Plater::set_current_canvas_as_dirty ( )
7255{
7256 p->set_current_canvas_as_dirty();
7257}

References p.

Referenced by Slic3r::GUI::MenuFactory::append_menu_item_printable(), and Slic3r::GUI::Mouse3DController::disconnect_device().

+ Here is the caller graph for this function:

◆ set_default_bed_shape()

void Slic3r::GUI::Plater::set_default_bed_shape ( ) const
7088{
7089 set_bed_shape({ { 0.0, 0.0 }, { 200.0, 0.0 }, { 200.0, 200.0 }, { 0.0, 200.0 } }, 0.0, {}, {}, true);
7090}

References set_bed_shape().

Referenced by load_gcode(), and Slic3r::GUI::MainFrame::update_layout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_keep_current_preview_type()

void Slic3r::GUI::Plater::set_keep_current_preview_type ( bool  value)
7674{
7675 p->preview->set_keep_current_preview_type(value);
7676}

References p.

◆ set_number_of_copies()

void Slic3r::GUI::Plater::set_number_of_copies ( )
6232{
6233 const auto obj_idxs = get_selection().get_object_idxs();
6234 if (obj_idxs.empty())
6235 return;
6236
6237 const size_t init_cnt = obj_idxs.size() == 1 ? p->model.objects[*obj_idxs.begin()]->instances.size() : 1;
6238 const int num = GetNumberFromUser( " ", _L("Enter the number of copies:"),
6239 _L("Copies of the selected object"), init_cnt, 0, 1000, this );
6240 if (num < 0)
6241 return;
6242 TakeSnapshot snapshot(this, wxString::Format(_L("Set numbers of copies to %d"), num));
6243
6244 // we need a copy made here because the selection changes at every call of increase_instances()
6245 Selection::ObjectIdxsToInstanceIdxsMap content = p->get_selection().get_content();
6246
6247 for (const auto& obj_idx : obj_idxs) {
6248 ModelObject* model_object = p->model.objects[obj_idx];
6249 const int diff = num - (int)model_object->instances.size();
6250 if (diff > 0) {
6251 if (auto obj_it = content.find(int(obj_idx)); obj_it != content.end())
6252 increase_instances(diff, int(obj_idx), *obj_it->second.rbegin());
6253 }
6254 else if (diff < 0)
6255 decrease_instances(-diff, int(obj_idx));
6256 }
6257}
std::set< unsigned int > get_object_idxs() const
Definition Selection.cpp:1799
static long GetNumberFromUser(const wxString &msg, const wxString &prompt, const wxString &title, long value, long min, long max, wxWindow *parent)
Definition Plater.cpp:6211

References _L, decrease_instances(), Slic3r::diff(), Slic3r::GUI::Selection::get_object_idxs(), get_selection(), Slic3r::GUI::GetNumberFromUser(), increase_instances(), Slic3r::ModelObject::instances, and p.

Referenced by Slic3r::GUI::MenuFactory::append_menu_items_instance_manipulation(), and Slic3r::GUI::MenuFactory::multi_selection_menu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_preview_layers_slider_values_range()

void Slic3r::GUI::Plater::set_preview_layers_slider_values_range ( int  bottom,
int  top 
)
7561{
7562 p->set_preview_layers_slider_values_range(bottom, top);
7563}

References p.

◆ set_printer_technology()

bool Slic3r::GUI::Plater::set_printer_technology ( PrinterTechnology  printer_technology)
7277{
7278 p->printer_technology = printer_technology;
7279 bool ret = p->background_process.select_technology(printer_technology);
7280 if (ret) {
7281 // Update the active presets.
7282 }
7283 //FIXME for SLA synchronize
7284 //p->background_process.apply(Model)!
7285
7286 if (printer_technology == ptSLA) {
7287 for (ModelObject* model_object : p->model.objects) {
7288 model_object->ensure_on_bed();
7289 }
7290 }
7291
7292 p->label_btn_export = printer_technology == ptFFF ? L("Export G-code") : L("Export");
7293 p->label_btn_send = printer_technology == ptFFF ? L("Send G-code") : L("Send to printer");
7294
7295 if (wxGetApp().mainframe != nullptr)
7296 wxGetApp().mainframe->update_menubar();
7297
7298 p->update_main_toolbar_tooltips();
7299
7300 p->notification_manager->set_fff(printer_technology == ptFFF);
7301 p->notification_manager->set_slicing_progress_hidden();
7302
7303 return ret;
7304}
#define L(s)
Definition I18N.hpp:18

References L, p, printer_technology(), Slic3r::ptFFF, and Slic3r::ptSLA.

Referenced by Slic3r::GUI::MainFrame::load_config(), Slic3r::GUI::GUI_App::load_current_presets(), and on_config_change().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_project_filename()

void Slic3r::GUI::Plater::set_project_filename ( const wxString &  filename)
7202{
7203 p->set_project_filename(filename);
7204}

References p.

Referenced by load_gcode(), Slic3r::GUI::GUI_App::post_init(), and Slic3r::GUI::Plater::priv::reset().

+ Here is the caller graph for this function:

◆ show_action_buttons() [1/2]

void Slic3r::GUI::Plater::show_action_buttons ( ) const
7421{ p->show_action_buttons(p->ready_to_slice); }

References p.

Referenced by Slic3r::GUI::Plater::priv::on_process_completed(), and Slic3r::GUI::Plater::priv::update_background_process().

+ Here is the caller graph for this function:

◆ show_action_buttons() [2/2]

void Slic3r::GUI::Plater::show_action_buttons ( const bool  is_ready_to_slice) const
7420{ p->show_action_buttons(ready_to_slice); }

References p.

Referenced by Slic3r::GUI::MainFrame::MainFrame().

+ Here is the caller graph for this function:

◆ show_illegal_characters_warning()

void Slic3r::GUI::Plater::show_illegal_characters_warning ( wxWindow *  parent)
static
160{
161 show_error(parent, _L("The provided name is not valid;") + "\n" +
162 _L("the following characters are not allowed:") + " <>:/\\|?*\"");
163}

References _L, and Slic3r::GUI::show_error().

Referenced by Slic3r::GUI::ObjectList::OnEditingDone(), and Slic3r::GUI::ObjectList::rename_item().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ show_legend()

void Slic3r::GUI::Plater::show_legend ( bool  show)
6088{ p->show_legend(show); }

References p.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor(), and Slic3r::GUI::MainFrame::init_menubar_as_gcodeviewer().

+ Here is the caller graph for this function:

◆ show_view3D_labels()

void Slic3r::GUI::Plater::show_view3D_labels ( bool  show)
6085{ p->show_view3D_labels(show); }

References p.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the caller graph for this function:

◆ sidebar()

Sidebar & Slic3r::GUI::Plater::sidebar ( )
5221{ return *p->sidebar; }

References p.

Referenced by Slic3r::GUI::MainFrame::bind_diff_dialog(), Slic3r::GUI::Plater::priv::can_decrease_instances(), Slic3r::GUI::Plater::priv::can_delete(), Slic3r::GUI::Plater::priv::can_delete_all(), Slic3r::GUI::Plater::priv::can_fix_through_netfabb(), Slic3r::GUI::Plater::priv::can_increase_instances(), Slic3r::GUI::Plater::priv::can_mirror(), Slic3r::GUI::Plater::priv::can_reload_from_disk(), Slic3r::GUI::Plater::priv::can_replace_with_stl(), Slic3r::GUI::Plater::priv::can_scale_to_print_volume(), Slic3r::GUI::Plater::priv::can_split(), Slic3r::GUI::Plater::priv::collapse_sidebar(), cut(), decrease_instances(), Slic3r::GUI::Plater::priv::delete_all_objects_from_model(), Slic3r::GUI::Plater::priv::delete_object_from_model(), Slic3r::GUI::FillBedJob::finalize(), increase_instances(), Slic3r::GUI::MainFrame::init_menubar_as_editor(), Slic3r::GUI::Plater::priv::object_list_changed(), on_extruders_change(), Slic3r::GUI::MainFrame::on_presets_changed(), Slic3r::GUI::Plater::priv::on_process_completed(), Slic3r::GUI::Plater::priv::on_select_preset(), Slic3r::GUI::Plater::priv::remove(), Slic3r::GUI::Plater::priv::replace_volume_with_stl(), Slic3r::GUI::Plater::priv::reset(), Slic3r::GUI::Plater::priv::select_all(), Slic3r::GUI::Plater::priv::show_action_buttons(), Slic3r::GUI::GUI_App::sidebar(), Slic3r::GUI::Plater::priv::take_snapshot(), Slic3r::GUI::Plater::priv::undo_redo_to(), Slic3r::GUI::Plater::priv::update(), Slic3r::GUI::Plater::priv::update_background_process(), Slic3r::GUI::MainFrame::update_layout(), and Slic3r::GUI::Plater::priv::update_ui_from_settings().

+ Here is the caller graph for this function:

◆ sla_object_menu()

wxMenu * Slic3r::GUI::Plater::sla_object_menu ( )
7710{ return p->menus.sla_object_menu(); }

References p.

Referenced by Slic3r::GUI::ObjectList::show_context_menu().

+ Here is the caller graph for this function:

◆ sla_print() [1/2]

SLAPrint & Slic3r::GUI::Plater::sla_print ( )
5227{ return p->sla_print; }

References p.

◆ sla_print() [2/2]

const SLAPrint & Slic3r::GUI::Plater::sla_print ( ) const
5226{ return p->sla_print; }

References p.

Referenced by Slic3r::GUI::MainFrame::can_export_supports(), Slic3r::GUI::get_arrange_poly(), Slic3r::GUI::Plater::priv::on_slicing_update(), and Slic3r::GUI::Preview::update_layers_slider().

+ Here is the caller graph for this function:

◆ split_object()

void Slic3r::GUI::Plater::split_object ( )
7417{ p->split_object(); }

References p.

Referenced by Slic3r::GUI::MenuFactory::append_menu_items_split(), and Slic3r::GUI::Plater::priv::on_action_split_objects().

+ Here is the caller graph for this function:

◆ split_volume()

void Slic3r::GUI::Plater::split_volume ( )
7418{ p->split_volume(); }

References p.

Referenced by Slic3r::GUI::MenuFactory::append_menu_items_split(), Slic3r::GUI::MenuFactory::create_part_menu(), and Slic3r::GUI::Plater::priv::on_action_split_volumes().

+ Here is the caller graph for this function:

◆ suppress_background_process()

void Slic3r::GUI::Plater::suppress_background_process ( const bool  stop_background_process)
7409{
7410 if (stop_background_process)
7411 this->p->background_process_timer.Stop();
7412
7413 this->p->suppressed_backround_processing_update = true;
7414}

References p.

◆ suppress_snapshots()

void Slic3r::GUI::Plater::suppress_snapshots ( )
private
6895{ p->suppress_snapshots(); }

References p.

Referenced by Slic3r::GUI::Plater::SuppressSnapshots::SuppressSnapshots(), Slic3r::GUI::Plater::TakeSnapshot::TakeSnapshot(), and Slic3r::GUI::Plater::TakeSnapshot::TakeSnapshot().

+ Here is the caller graph for this function:

◆ sys_color_changed()

void Slic3r::GUI::Plater::sys_color_changed ( )
7482{
7483 p->preview->sys_color_changed();
7484 p->sidebar->sys_color_changed();
7485
7486 p->menus.sys_color_changed();
7487
7488 Layout();
7489 GetParent()->Layout();
7490}

References p.

◆ take_snapshot() [1/4]

void Slic3r::GUI::Plater::take_snapshot ( const std::string &  snapshot_name)
6891{ p->take_snapshot(snapshot_name); }

References p.

Referenced by Slic3r::GUI::Plater::TakeSnapshot::TakeSnapshot(), Slic3r::GUI::Plater::TakeSnapshot::TakeSnapshot(), Slic3r::GUI::GLGizmoSimplify::apply_simplify(), priv::create_volume(), Slic3r::GUI::Plater::priv::enter_gizmos_stack(), Slic3r::GUI::Emboss::CreateObjectJob::finalize(), new_project(), and Slic3r::GUI::take_snapshot().

+ Here is the caller graph for this function:

◆ take_snapshot() [2/4]

void Slic3r::GUI::Plater::take_snapshot ( const std::string &  snapshot_name,
UndoRedo::SnapshotType  snapshot_type 
)
6893{ p->take_snapshot(snapshot_name, snapshot_type); }

References p.

◆ take_snapshot() [3/4]

void Slic3r::GUI::Plater::take_snapshot ( const wxString &  snapshot_name)
6892{ p->take_snapshot(snapshot_name); }

References p.

◆ take_snapshot() [4/4]

void Slic3r::GUI::Plater::take_snapshot ( const wxString &  snapshot_name,
UndoRedo::SnapshotType  snapshot_type 
)
6894{ p->take_snapshot(snapshot_name, snapshot_type); }

References p.

◆ text_part_menu()

wxMenu * Slic3r::GUI::Plater::text_part_menu ( )
7709{ return p->menus.text_part_menu(); }

References p.

Referenced by Slic3r::GUI::ObjectList::show_context_menu().

+ Here is the caller graph for this function:

◆ toggle_layers_editing()

void Slic3r::GUI::Plater::toggle_layers_editing ( bool  enable)
6316{
6317 if (canvas3D()->is_layers_editing_enabled() != enable)
6318 canvas3D()->force_main_toolbar_left_action(canvas3D()->get_main_toolbar_item_id("layersediting"));
6319}
void force_main_toolbar_left_action(int item_id)
Definition GLCanvas3D.hpp:944

References canvas3D(), and Slic3r::GUI::GLCanvas3D::force_main_toolbar_left_action().

+ Here is the call graph for this function:

◆ toggle_render_statistic_dialog()

void Slic3r::GUI::Plater::toggle_render_statistic_dialog ( )
7664{
7665 p->show_render_statistic_dialog = !p->show_render_statistic_dialog;
7666}

References p.

◆ unbind_canvas_event_handlers()

void Slic3r::GUI::Plater::unbind_canvas_event_handlers ( )
7260{
7261 p->unbind_canvas_event_handlers();
7262}

References p.

Referenced by Slic3r::GUI::MainFrame::shutdown().

+ Here is the caller graph for this function:

◆ undo()

void Slic3r::GUI::Plater::undo ( )
6897{ p->undo(); }

References p.

Referenced by Slic3r::GUI::MainFrame::init_menubar_as_editor().

+ Here is the caller graph for this function:

◆ undo_redo_stack_main()

const UndoRedo::Stack & Slic3r::GUI::Plater::undo_redo_stack_main ( ) const
7657{ return p->undo_redo_stack_main(); }

References p.

◆ undo_redo_string_getter()

bool Slic3r::GUI::Plater::undo_redo_string_getter ( const bool  is_undo,
int  idx,
const char **  out_text 
)
6920{
6921 const std::vector<UndoRedo::Snapshot>& ss_stack = p->undo_redo_stack().snapshots();
6922 const int idx_in_ss_stack = p->get_active_snapshot_index() + (is_undo ? -(++idx) : idx);
6923
6924 if (0 < idx_in_ss_stack && (size_t)idx_in_ss_stack < ss_stack.size() - 1) {
6925 *out_text = ss_stack[idx_in_ss_stack].name.c_str();
6926 return true;
6927 }
6928
6929 return false;
6930}

References p.

◆ undo_redo_topmost_string_getter()

void Slic3r::GUI::Plater::undo_redo_topmost_string_getter ( const bool  is_undo,
std::string &  out_text 
)
6933{
6934 const std::vector<UndoRedo::Snapshot>& ss_stack = p->undo_redo_stack().snapshots();
6935 const int idx_in_ss_stack = p->get_active_snapshot_index() + (is_undo ? -1 : 0);
6936
6937 if (0 < idx_in_ss_stack && (size_t)idx_in_ss_stack < ss_stack.size() - 1) {
6938 out_text = ss_stack[idx_in_ss_stack].name;
6939 return;
6940 }
6941
6942 out_text = "";
6943}

References p.

◆ undo_to()

void Slic3r::GUI::Plater::undo_to ( int  selection)
6900{
6901 if (selection == 0) {
6902 p->undo();
6903 return;
6904 }
6905
6906 const int idx = p->get_active_snapshot_index() - selection - 1;
6907 p->undo_redo_to(p->undo_redo_stack().snapshots()[idx].timestamp);
6908}

References p.

◆ update()

◆ update_filament_colors_in_full_config()

bool Slic3r::GUI::Plater::update_filament_colors_in_full_config ( )
6988{
6989 // There is a case, when we use filament_color instead of extruder_color (when extruder_color == "").
6990 // Thus plater config option "filament_colour" should be filled with filament_presets values.
6991 // Otherwise, on 3dScene will be used last edited filament color for all volumes with extruder_color == "".
6992 const auto& extruders_filaments = wxGetApp().preset_bundle->extruders_filaments;
6993 if (extruders_filaments.size() == 1 || !p->config->has("filament_colour"))
6994 return false;
6995
6996 const PresetCollection& filaments = wxGetApp().preset_bundle->filaments;
6997 std::vector<std::string> filament_colors;
6998 filament_colors.reserve(extruders_filaments.size());
6999
7000 for (const auto& extr_filaments : extruders_filaments)
7001 filament_colors.push_back(filaments.find_preset(extr_filaments.get_selected_preset_name(), true)->config.opt_string("filament_colour", (unsigned)0));
7002
7003 p->config->option<ConfigOptionStrings>("filament_colour")->values = filament_colors;
7004 return true;
7005}

References Slic3r::Preset::config, Slic3r::PresetCollection::find_preset(), Slic3r::ConfigBase::opt_string(), and p.

Referenced by on_config_change().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update_menus()

void Slic3r::GUI::Plater::update_menus ( )
7419{ p->menus.update(); }

References p.

Referenced by Slic3r::GUI::GUI_App::update_mode().

+ Here is the caller graph for this function:

◆ update_preview_moves_slider()

void Slic3r::GUI::Plater::update_preview_moves_slider ( )
7566{
7567 p->update_preview_moves_slider();
7568}

References p.

◆ update_project_dirty_from_presets()

void Slic3r::GUI::Plater::update_project_dirty_from_presets ( )
5213{ p->update_project_dirty_from_presets(); }

References p.

Referenced by load_project(), and new_project().

+ Here is the caller graph for this function:

◆ update_ui_from_settings()

void Slic3r::GUI::Plater::update_ui_from_settings ( )
6074{ p->update_ui_from_settings(); }

References p.

Referenced by Slic3r::GUI::MainFrame::update_ui_from_settings().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ SuppressBackgroundProcessingUpdate

Member Data Documentation

◆ m_last_loaded_gcode

wxString Slic3r::GUI::Plater::m_last_loaded_gcode
private

◆ m_tracking_popup_menu

bool Slic3r::GUI::Plater::m_tracking_popup_menu = false
private

Referenced by PopupMenu().

◆ m_tracking_popup_menu_error_message

wxString Slic3r::GUI::Plater::m_tracking_popup_menu_error_message
private

Referenced by PopupMenu().

◆ p

std::unique_ptr<priv> Slic3r::GUI::Plater::p
private

Referenced by allow_snapshots(), are_view3D_labels_shown(), arrange(), bring_instance_forward(), build_volume(), can_arrange(), can_copy_to_clipboard(), can_decrease_instances(), can_delete(), can_delete_all(), can_fix_through_netfabb(), can_increase_instances(), can_layers_editing(), can_mirror(), can_paste_from_clipboard(), can_redo(), can_reload_from_disk(), can_replace_with_stl(), can_scale_to_print_volume(), can_set_instance_to_object(), can_simplify(), can_split(), can_split_to_objects(), can_split_to_volumes(), can_undo(), canvas3D(), canvas3D(), changed_mesh(), changed_object(), changed_objects(), clear_undo_redo_stack_main(), collapse_sidebar(), config(), convert_unit(), copy_selection_to_clipboard(), cut(), cut(), decrease_instances(), default_menu(), delete_object_from_model(), deselect_all(), enable_collapse_toolbar(), enable_preview_moves_slider(), enable_view_toolbar(), enter_gizmos_stack(), export_3mf(), export_amf(), export_gcode(), export_stl_obj(), export_toolpaths_to_obj(), fff_print(), fff_print(), fill_bed_with_instances(), force_filament_cb_update(), force_filament_colors_update(), force_print_bed_update(), get_camera(), get_camera(), get_collapse_toolbar(), get_collapse_toolbar(), get_colors_for_color_print(), get_current_canvas3D(), get_extruder_colors_from_plater_config(), get_mouse3d_controller(), get_mouse3d_controller(), get_notification_manager(), get_notification_manager(), get_project_filename(), get_selected_object_idx(), get_selection(), get_ui_job_worker(), get_ui_job_worker(), get_view_toolbar(), get_view_toolbar(), has_toolpaths_to_export(), import_sl1_archive(), increase_instances(), init_collapse_toolbar(), init_notification_manager(), init_view_toolbar(), inside_snapshot_capture(), instance_menu(), is_background_process_update_scheduled(), is_export_gcode_scheduled(), is_legend_shown(), is_presets_dirty(), is_preview_loaded(), is_preview_shown(), is_project_dirty(), is_render_statistic_dialog_visible(), is_selection_empty(), is_sidebar_collapsed(), is_single_full_object_selection(), is_view3D_layers_editing_enabled(), is_view3D_shown(), layer_menu(), leave_gizmos_stack(), load_files(), load_gcode(), load_project(), mirror(), model(), model(), msw_rescale(), multi_selection_menu(), new_project(), object_menu(), on_activate(), on_config_change(), part_menu(), paste_from_clipboard(), printer_technology(), redo(), redo_to(), refresh_print(), reload_all_from_disk(), reload_from_disk(), remove(), remove_selected(), replace_with_stl(), reset(), reset_canvas_volumes(), reset_gcode_toolpaths(), reset_project_dirty_after_save(), reset_project_dirty_initial_presets(), reset_with_confirm(), reslice(), reslice_until_step_inner(), save_project_if_dirty(), scale_selection_to_fit_print_volume(), schedule_background_process(), search(), search_string_getter(), select_all(), select_view(), select_view_3D(), send_gcode(), set_bed_shape(), set_bed_shape(), Slic3r::GUI::Sidebar::set_btn_label(), set_current_canvas_as_dirty(), Slic3r::GUI::Plater::priv::set_current_panel(), set_keep_current_preview_type(), set_number_of_copies(), set_preview_layers_slider_values_range(), set_printer_technology(), set_project_filename(), show_action_buttons(), show_action_buttons(), show_legend(), show_view3D_labels(), sidebar(), sla_object_menu(), sla_print(), sla_print(), split_object(), split_volume(), suppress_background_process(), suppress_snapshots(), sys_color_changed(), take_snapshot(), take_snapshot(), take_snapshot(), take_snapshot(), text_part_menu(), toggle_render_statistic_dialog(), unbind_canvas_event_handlers(), undo(), undo_redo_stack_main(), undo_redo_string_getter(), undo_redo_topmost_string_getter(), undo_to(), update(), update_filament_colors_in_full_config(), update_menus(), update_preview_moves_slider(), update_project_dirty_from_presets(), and update_ui_from_settings().


The documentation for this class was generated from the following files: