Printing involves slicing and export of device dependent instructions. More...
#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/PrintBase.hpp>
Classes | |
| struct | TaskParams |
| struct | SlicingStatus |
Public Types | |
| enum | ApplyStatus { APPLY_STATUS_UNCHANGED , APPLY_STATUS_CHANGED , APPLY_STATUS_INVALIDATED } |
| enum | CancelStatus { NOT_CANCELED = 0 , CANCELED_BY_USER = 1 , CANCELED_INTERNAL = 2 } |
| typedef std::function< void(const SlicingStatus &)> | status_callback_type |
| typedef std::function< void()> | cancel_callback_type |
| using | Timestamp = uint64_t |
Public Member Functions | |
| PrintBase () | |
| virtual | ~PrintBase () |
| virtual PrinterTechnology | technology () const noexcept=0 |
| virtual void | clear ()=0 |
| virtual bool | empty () const =0 |
| virtual std::vector< ObjectID > | print_object_ids () const =0 |
| virtual StringObjectException | validate (std::vector< StringObjectException > *warnings=nullptr, Polygons *collison_polygons=nullptr, std::vector< std::pair< Polygon, float > > *height_polygons=nullptr) const |
| virtual ApplyStatus | apply (const Model &model, DynamicPrintConfig config, bool extruder_applied=false)=0 |
| const Model & | model () const |
| virtual void | set_task (const TaskParams ¶ms) |
| virtual void | process (long long *time_cost_with_cache=nullptr, bool use_cache=false)=0 |
| virtual int | export_cached_data (const std::string &dir_path, bool with_space=false) |
| virtual int | load_cached_data (const std::string &directory) |
| virtual void | finalize () |
| void | set_status_default () |
| void | set_status_silent () |
| void | set_status_callback (status_callback_type cb) |
| void | set_status (int percent, const std::string &message, unsigned int flags=SlicingStatus::DEFAULT, int warning_step=-1) const |
| void | set_cancel_callback (cancel_callback_type cancel_callback) |
| CancelStatus | cancel_status () const |
| bool | canceled () const |
| void | cancel () |
| void | cancel_internal () |
| void | restart () |
| virtual bool | finished () const =0 |
| const PlaceholderParser & | placeholder_parser () const |
| const DynamicPrintConfig & | full_print_config () const |
| virtual std::string | output_filename (const std::string &filename_base=std::string()) const =0 |
| std::string | output_filepath (const std::string &path, const std::string &filename_base=std::string()) const |
| int | get_plate_index () const |
| void | set_plate_index (int index) |
| bool | get_no_check_flag () const |
| void | set_no_check_flag (bool no_check) |
| std::string | get_plate_name () const |
| void | set_plate_name (const std::string &name) |
| ObjectID | id () const |
| virtual Timestamp | timestamp () const |
Protected Attributes | |
| Model | m_model |
| DynamicPrintConfig | m_full_print_config |
| DynamicPrintConfig | m_ori_full_print_config |
| PlaceholderParser | m_placeholder_parser |
| int | m_plate_index { 0 } |
| bool | m_no_check = false |
| std::string | m_plate_name |
| status_callback_type | m_status_callback |
Private Member Functions | |
| template<class Archive> | |
| void | serialize (Archive &ar) |
Static Private Member Functions | |
| static ObjectID | generate_new_id () |
| template<class Archive> | |
| static void | load_and_construct (Archive &ar, cereal::construct< ObjectBase > &construct) |
Private Attributes | |
| std::atomic< CancelStatus > | m_cancel_status |
| cancel_callback_type | m_cancel_callback = [](){} |
| std::mutex | m_state_mutex |
| friend | PrintTryCancel |
| ObjectID | m_id |
Static Private Attributes | |
| static size_t | s_last_id = 0 |
Friends | |
| class | PrintObjectBase |
| class | BackgroundSlicingProcess |
Printing involves slicing and export of device dependent instructions.
Every technology has a potentially different set of requirements for slicing, support structures and output print instructions. The pipeline however remains roughly the same: slice -> convert to instructions -> send to printer
The PrintBase class will abstract this flow for different technologies.
| typedef std::function<void()> Slic3r::PrintBase::cancel_callback_type |
| typedef std::function<void(const SlicingStatus&)> Slic3r::PrintBase::status_callback_type |
|
inherited |
| Enumerator | |
|---|---|
| APPLY_STATUS_UNCHANGED | |
| APPLY_STATUS_CHANGED | |
| APPLY_STATUS_INVALIDATED | |
| Enumerator | |
|---|---|
| NOT_CANCELED | |
| CANCELED_BY_USER | |
| CANCELED_INTERNAL | |
|
inline |
References m_full_print_config, m_placeholder_parser, and restart().
Referenced by Slic3r::PrintBase::SlicingStatus::SlicingStatus().
|
inlinevirtual |
|
pure virtual |
Implemented in Slic3r::Print, and Slic3r::SLAPrint.
References model().
Referenced by Slic3r::GUI::CalibUtils::process_and_store_3mf(), and Slic3r::CLI::run().
|
inlineprotectedvirtualinherited |
Reimplemented in Slic3r::Model, Slic3r::ModelObject, and Slic3r::ModelVolume.
References set_new_unique_id().
|
inlineprotected |
References m_cancel_callback.
|
inline |
References CANCELED_BY_USER, and m_cancel_status.
Referenced by Slic3r::GUI::GLGizmoFdmSupports::invalid_support_volumes(), and Slic3r::GUI::GLGizmoFdmSupports::on_shutdown().
|
inlineprotected |
References m_cancel_callback.
Referenced by Slic3r::PrintObjectBase::cancel_callback(), Slic3r::PrintBaseWithState< PrintStep, psCount >::invalidate_all_steps(), Slic3r::PrintBaseWithState< PrintStep, psCount >::invalidate_step(), Slic3r::PrintBaseWithState< PrintStep, psCount >::invalidate_steps(), and set_cancel_callback().
|
inline |
References CANCELED_INTERNAL, and m_cancel_status.
|
inline |
References m_cancel_status.
|
inline |
References m_cancel_status, and NOT_CANCELED.
Referenced by Slic3r::GCode::do_export(), and Slic3r::plugin_hooks::anonymous_namespace{PluginHooks.cpp}::install_slicing_pipeline_hook().
|
pure virtual |
Implemented in Slic3r::Print, and Slic3r::SLAPrint.
References clear().
Referenced by clear().
|
inlineprotectedinherited |
References ObjectBase(), id(), and m_id.
Referenced by Slic3r::CutObjectBase::copy().
|
pure virtual |
Implemented in Slic3r::Print, and Slic3r::SLAPrint.
References empty().
Referenced by empty(), and Slic3r::CLI::run().
|
inlinevirtual |
Reimplemented in Slic3r::Print.
Referenced by Slic3r::CLI::run().
|
inlinevirtual |
Reimplemented in Slic3r::SLAPrint.
|
pure virtual |
Implemented in Slic3r::Print, and Slic3r::SLAPrint.
|
inline |
References m_full_print_config.
Referenced by Slic3r::ToolOrdering::ToolOrdering(), Slic3r::GCode::_do_export(), Slic3r::GCode::append_full_config(), Slic3r::WipeTowerIntegration::append_tcr(), Slic3r::anonymous_namespace{SL1.cpp}::fill_iniconf(), Slic3r::anonymous_namespace{SL1.cpp}::fill_slicerconf(), Slic3r::plugin_hooks::anonymous_namespace{PluginHooks.cpp}::install_slicing_pipeline_hook(), Slic3r::BackgroundSlicingProcess::prepare_upload(), Slic3r::BackgroundSlicingProcess::process_sla(), Slic3r::SlicingPipelinePluginCapability::RegisterBindings(), and Slic3r::BeltGCode::write_belt_header().
|
inlinestaticprivateinherited |
References s_last_id.
Referenced by ObjectBase(), and set_new_unique_id().
|
inline |
References m_no_check.
|
inline |
References m_plate_index.
Referenced by Slic3r::GCode::_do_export(), Slic3r::GCode::append_full_config(), Slic3r::estimated_wipe_tower_footprint(), Slic3r::get_wipe_tower_extrusions_extents(), Slic3r::layered_print_cleareance_valid(), and Slic3r::GCode::process_layer().
|
inline |
References m_plate_name.
Referenced by Slic3r::GCode::_do_export().
|
inlineinherited |
References m_id.
Referenced by Slic3r::CutObjectBase::CutObjectBase(), Slic3r::Model::Model(), Slic3r::ModelInstance::ModelInstance(), Slic3r::ModelMaterial::ModelMaterial(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), ObjectBase(), Slic3r::PrintBase::SlicingStatus::SlicingStatus(), Slic3r::PrintBase::SlicingStatus::SlicingStatus(), Slic3r::_BBS_3MF_Exporter::_add_cut_information_file_to_archive(), Slic3r::_BBS_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::_BBS_3MF_Exporter::_add_slice_info_config_file_to_archive(), Slic3r::GUI::Plater::priv::actualize_slicing_warnings(), Slic3r::ModelObjectStatusDB::add(), Slic3r::ModelObjectStatusDB::add_if_new(), Slic3r::Model::add_object(), Slic3r::append_and_translate(), Slic3r::SLAPrint::apply(), Slic3r::GUI::calc_distance(), Slic3r::GUI::calc_surface_offset(), Slic3r::check_model_ids_equal(), Slic3r::check_model_ids_validity(), Slic3r::GUI::GLGizmoTextureDisplacement::close_image_adjust(), Slic3r::Model::collect_reusable_objects(), Slic3r::ModelObject::convert_units(), copy_id(), Slic3r::PrintObjectStatusDB::count(), anonymous_namespace{RaycastManager.cpp}::create_key(), Slic3r::GUI::create_meshes(), anonymous_namespace{EmbossJob.cpp}::create_volume(), Slic3r::GUI::Emboss::create_volume_sources(), Slic3r::GUI::GLGizmoPainterBase::data_changed(), Slic3r::GCode::do_export(), Slic3r::GUI::PartPlate::duplicate_all_instance(), Slic3r::GUI::PartPlateList::duplicate_plate(), Slic3r::GUI::PartPlate::estimate_wipe_tower_footprint(), Slic3r::Print::export_cached_data(), Slic3r::GUI::Plater::export_stl(), Slic3r::find_volume_extents(), Slic3r::PreciseSeam::detail::fragment_location(), Slic3r::GUI::Plater::priv::generate_first_layer_bbox(), Slic3r::ModelObjectStatusDB::get(), Slic3r::Model::get_backup_path(), Slic3r::GUI::GLCanvas3D::get_empty_cells(), Slic3r::ModelInstance::get_labeled_id(), Slic3r::GUI::get_model_volume(), Slic3r::PrintObjectStatusDB::get_range(), Slic3r::GUI::get_selected_volume(), Slic3r::GUI::get_volume(), Slic3r::CutObjectBase::has_same_id(), Slic3r::UndoRedo::StackImpl::immutable_object_id_impl(), Slic3r::GUI::GLGizmoFdmSupports::init_print_instance(), Slic3r::CutObjectBase::is_equal(), Slic3r::GUI::GLGizmoSVG::is_svg_object(), Slic3r::ModelVolume::is_the_only_one_part(), Slic3r::GUI::IMSlider::IsNewPrint(), Slic3r::ModelObject::load(), load_and_construct(), Slic3r::Print::load_cached_data(), Slic3r::GLVolumeCollection::load_object_auxiliary(), Slic3r::GLVolumeCollection::load_object_volume(), Slic3r::GUI::GCodeViewer::load_shells(), Slic3r::UndoRedo::StackImpl::load_snapshot(), Slic3r::GUI::GLCanvas3D::CenterOfMass::model_markers(), Slic3r::model_property_changed(), Slic3r::model_volume_list_changed(), Slic3r::model_volume_list_copy_configs(), Slic3r::ModelConfigObject::object_id_and_timestamp_match(), Slic3r::ObjectWithTimestamp::object_id_and_timestamp_match(), Slic3r::GUI::GLGizmoEmboss::on_mouse_change_selection(), Slic3r::GUI::GLGizmoSimplify::on_render_input_window(), Slic3r::GUI::GLGizmoTextureDisplacement::open_image_adjust(), Slic3r::CutObjectBase::operator<(), Slic3r::Model::operator=(), Slic3r::ModelObject::operator=(), Slic3r::ModelObject::operator=(), Slic3r::CutObjectBase::operator==(), Slic3r::outer_inner_brim_area(), Slic3r::GUI::GLGizmoTextureDisplacement::painted_area_mm2(), Slic3r::GUI::GLGizmoCut3D::perform_cut(), anonymous_namespace{GLGizmoEmboss.cpp}::prepare_volumes_to_slice(), Slic3r::GUI::GLGizmoTextureDisplacement::preview_part(), Slic3r::GCode::process_layer(), Slic3r::GUI::NotificationManager::push_slicing_warning_notification(), Slic3r::GUI::GLGizmoTextureDisplacement::queue_preview_job(), Slic3r::GUI::queue_texture_displacement_debug(), Slic3r::GUI::GLGizmoEmboss::re_emboss(), Slic3r::GUI::GLGizmoTextureDisplacement::rebuild_other_paint_overlay(), Slic3r::GUI::GLGizmoTextureDisplacement::rebuild_painted_colors(), Slic3r::GUI::GLCanvas3D::reload_scene(), Slic3r::_BBS_Backup_Manager::remove_backup(), Slic3r::Model::remove_backup_path_if_exist(), Slic3r::GUI::GLGizmoTextureDisplacement::render_image_adjust_window(), Slic3r::CLI::run(), Slic3r::GUI::GLCanvas3D::LayersEditing::select_object(), Slic3r::ModelMaterial::serialize(), Slic3r::Model::set_backup_path(), Slic3r::GUI::GLGizmoBrimEars::set_brim_data(), Slic3r::GUI::PartPlate::set_hover_id(), Slic3r::GUI::GLGizmoEmboss::set_volume_by_selection(), Slic3r::GUI::GLGizmoSVG::set_volume_by_selection(), Slic3r::sla_instances(), Slic3r::slices_to_regions(), Slic3r::ModelObject::split(), anonymous_namespace{EmbossJob.cpp}::start_create_volume_on_surface_job(), anonymous_namespace{SurfaceDrag.cpp}::start_dragging(), Slic3r::GUI::Emboss::start_update_volume(), Slic3r::UndoRedo::StackImpl::take_snapshot(), Slic3r::GUI::texture_displacement_bake_volume(), Slic3r::GUI::GLGizmoPainterBase::update_contours(), anonymous_namespace{EmbossJob.cpp}::update_name_in_list(), Slic3r::GUI::ObjectList::update_name_in_model(), Slic3r::GUI::update_object_cut_id(), Slic3r::GUI::GLGizmoTextureDisplacement::v2_recommendation(), Slic3r::verify_update_print_object_regions(), wipe_tower_instance_id, and wipe_tower_object_id.
|
inlinestaticprivateinherited |
|
inlinevirtual |
Reimplemented in Slic3r::Print.
Referenced by Slic3r::CLI::run().
|
inlineprotected |
References PrintTryCancel.
|
inline |
References m_model.
Referenced by Slic3r::ToolOrdering::ToolOrdering(), Slic3r::GUI::Plater::priv::actualize_object_warnings(), apply(), Slic3r::ToolOrdering::assign_custom_gcodes(), Slic3r::GCode::do_export(), Slic3r::Print::sequential_print_clearance_valid(), and Slic3r::sort_object_instances_by_model_order().
|
pure virtual |
Implemented in Slic3r::Print, and Slic3r::SLAPrint.
Referenced by Slic3r::Print::output_filename(), Slic3r::SLAPrint::output_filename(), and output_filepath().
|
protected |
References Slic3r::ConfigOptionString, Slic3r::format(), L, Slic3r::DynamicConfig::opt_string(), placeholder_parser(), Slic3r::PlaceholderParser::process(), Slic3r::DynamicConfig::set_key_value(), update_object_placeholders(), Slic3r::PlaceholderParser::update_timestamp(), and Slic3r::PlaceholderParser::update_user_name().
| std::string Slic3r::PrintBase::output_filepath | ( | const std::string & | path, |
| const std::string & | filename_base = std::string() ) const |
References m_model, and output_filename().
|
inline |
References m_placeholder_parser.
Referenced by Slic3r::GCode::_do_export(), and output_filename().
|
pure virtual |
Implemented in Slic3r::Print, and Slic3r::SLAPrint.
References print_object_ids().
Referenced by Slic3r::GUI::Plater::priv::actualize_slicing_warnings(), and print_object_ids().
|
pure virtual |
Implemented in Slic3r::Print, and Slic3r::SLAPrint.
Referenced by Slic3r::CLI::run().
|
inline |
References m_cancel_status, and NOT_CANCELED.
Referenced by PrintBase(), and Slic3r::GUI::GLGizmoFdmSupports::run_thread().
|
inlineprivateinherited |
|
inline |
References cancel_callback(), and m_cancel_callback.
|
inlineprotectedinherited |
References m_id.
Referenced by Slic3r::CutObjectBase::invalidate().
|
inlineprotectedinherited |
References generate_new_id(), and m_id.
Referenced by Slic3r::ModelVolume::ModelVolume(), Slic3r::Model::assign_new_unique_ids_recursive(), Slic3r::ModelVolume::assign_new_unique_ids_recursive(), assign_new_unique_ids_recursive(), Slic3r::CutObjectBase::init(), Slic3r::ModelMaterial::set_new_unique_id(), Slic3r::ModelObject::set_new_unique_id(), and Slic3r::ModelVolume::set_new_unique_id().
|
inline |
References m_no_check.
Referenced by Slic3r::CLI::run().
|
inline |
References m_plate_index.
|
inline |
References m_plate_name.
| void Slic3r::PrintBase::set_status | ( | int | percent, |
| const std::string & | message, | ||
| unsigned int | flags = SlicingStatus::DEFAULT, | ||
| int | warning_step = -1 ) const |
References m_status_callback.
Referenced by Slic3r::TreeSupport3D::generate_support_areas(), Slic3r::SLAPrint::StatusReporter::operator()(), Slic3r::GCode::process_layers(), and Slic3r::GUI::GLGizmoFdmSupports::run_thread().
|
inline |
References m_status_callback.
Referenced by Slic3r::CLI::run().
|
inline |
References m_status_callback.
|
inline |
References m_status_callback.
Referenced by anonymous_namespace{OrcaSlicer_profile_validator.cpp}::slice_two_color_cube_and_export().
|
inlinevirtual |
Reimplemented in Slic3r::SLAPrint.
|
inlineprotected |
References m_state_mutex.
Referenced by Slic3r::PrintBaseWithState< PrintStep, psCount >::active_step_add_warning(), Slic3r::PrintBaseWithState< PrintStep, psCount >::is_step_done(), Slic3r::PrintBaseWithState< PrintStep, psCount >::set_done(), Slic3r::PrintBaseWithState< PrintStep, psCount >::set_started(), Slic3r::PrintObjectBase::state_mutex(), Slic3r::PrintBaseWithState< PrintStep, psCount >::step_state_with_timestamp(), and Slic3r::PrintBaseWithState< PrintStep, psCount >::step_state_with_warnings().
|
protected |
References m_status_callback, and PrintObjectBase.
Referenced by Slic3r::PrintBaseWithState< PrintStep, psCount >::active_step_add_warning(), Slic3r::PrintBaseWithState< PrintStep, psCount >::set_done(), and Slic3r::PrintObjectBase::status_update_warnings().
|
protected |
References m_status_callback, and PrintObjectBase.
|
pure virtualnoexcept |
Implemented in Slic3r::Print, and Slic3r::SLAPrint.
|
inlineprotected |
References m_cancel_status.
Referenced by Slic3r::GCode::_do_export(), Slic3r::GCode::process_layers(), Slic3r::PrintBaseWithState< PrintStep, psCount >::set_done(), and Slic3r::PrintBaseWithState< PrintStep, psCount >::set_started().
|
inlinevirtualinherited |
Reimplemented in Slic3r::ModelConfigObject, and Slic3r::ObjectWithTimestamp.
|
protected |
References Slic3r::ConfigOptionString, Slic3r::ModelInstance::get_scaling_factor(), Slic3r::ModelObject::input_file, Slic3r::ModelObject::instances, Slic3r::ModelInstance::is_printable(), m_model, Slic3r::ModelObject::name, Slic3r::DynamicConfig::set_key_value(), Slic3r::X, Slic3r::Y, and Slic3r::Z.
Referenced by Slic3r::GCode::_do_export(), and output_filename().
|
inlinevirtual |
Reimplemented in Slic3r::Print, and Slic3r::SLAPrint.
References validate().
Referenced by Slic3r::CLI::run(), and validate().
|
friend |
References BackgroundSlicingProcess.
Referenced by BackgroundSlicingProcess.
|
friend |
References PrintObjectBase.
Referenced by Slic3r::PrintBase::SlicingStatus::SlicingStatus(), PrintObjectBase, status_update_warnings(), and status_update_warnings().
|
private |
Referenced by call_cancel_callback(), cancel_callback(), and set_cancel_callback().
|
private |
Referenced by cancel(), cancel_internal(), cancel_status(), canceled(), restart(), and throw_if_canceled().
|
protected |
Referenced by PrintBase(), and full_print_config().
|
privateinherited |
Referenced by ObjectBase(), ObjectBase(), ObjectBase(), copy_id(), id(), serialize(), set_invalid_id(), and set_new_unique_id().
|
protected |
Referenced by model(), output_filepath(), and update_object_placeholders().
|
protected |
Referenced by get_no_check_flag(), and set_no_check_flag().
|
protected |
|
protected |
Referenced by PrintBase(), and placeholder_parser().
|
protected |
Referenced by get_plate_index(), and set_plate_index().
|
protected |
Referenced by get_plate_name(), and set_plate_name().
|
mutableprivate |
Referenced by state_mutex().
|
protected |
|
private |
Referenced by make_try_cancel().
|
staticprivateinherited |
Referenced by generate_new_id().