OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::PrintBase Class Referenceabstract

Printing involves slicing and export of device dependent instructions. More...

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/PrintBase.hpp>

Inheritance diagram for Slic3r::PrintBase:
Collaboration diagram for Slic3r::PrintBase:

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 &params)
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 Member Functions

std::mutex & state_mutex () const
std::function< void()> cancel_callback ()
void call_cancel_callback ()
void status_update_warnings (int step, PrintStateBase::WarningLevel warning_level, const std::string &message, const PrintObjectBase *print_object=nullptr, PrintStateBase::SlicingNotificationType message_id=PrintStateBase::SlicingDefaultNotification)
void status_update_warnings (int step, PrintStateBase::WarningLevel warning_level, const std::string &message, PrintObjectBase &object, PrintStateBase::SlicingNotificationType message_id=PrintStateBase::SlicingDefaultNotification)
void throw_if_canceled () const
PrintTryCancel make_try_cancel () const
std::string output_filename (const std::string &format, const std::string &default_ext, const std::string &filename_base, const DynamicConfig *config_override=nullptr) const
void update_object_placeholders (DynamicConfig &config, const std::string &default_ext) const
void set_new_unique_id ()
void set_invalid_id ()
void copy_id (const ObjectBase &rhs)
virtual void assign_new_unique_ids_recursive ()

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

Detailed Description

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.

Member Typedef Documentation

◆ cancel_callback_type

typedef std::function<void()> Slic3r::PrintBase::cancel_callback_type

◆ status_callback_type

typedef std::function<void(const SlicingStatus&)> Slic3r::PrintBase::status_callback_type

◆ Timestamp

using Slic3r::ObjectBase::Timestamp = uint64_t
inherited

Member Enumeration Documentation

◆ ApplyStatus

Enumerator
APPLY_STATUS_UNCHANGED 
APPLY_STATUS_CHANGED 
APPLY_STATUS_INVALIDATED 
410 {
411 // No change after the Print::apply() call.
413 // Some of the Print / PrintObject / PrintObjectInstance data was changed,
414 // but no result was invalidated (only data influencing not yet calculated results were changed).
416 // Some data was changed, which in turn invalidated already calculated steps.
418 };
@ APPLY_STATUS_UNCHANGED
Definition PrintBase.hpp:412
@ APPLY_STATUS_CHANGED
Definition PrintBase.hpp:415
@ APPLY_STATUS_INVALIDATED
Definition PrintBase.hpp:417

◆ CancelStatus

Enumerator
NOT_CANCELED 
CANCELED_BY_USER 
CANCELED_INTERNAL 
498 {
499 // No cancelation, background processing should run.
500 NOT_CANCELED = 0,
501 // Canceled by user from the user interface (user pressed the "Cancel" button or user closed the application).
503 // Canceled internally from Print::apply() through the Print/PrintObject::invalidate_step() or ::invalidate_all_steps().
505 };
@ NOT_CANCELED
Definition PrintBase.hpp:500
@ CANCELED_INTERNAL
Definition PrintBase.hpp:504
@ CANCELED_BY_USER
Definition PrintBase.hpp:502

Constructor & Destructor Documentation

◆ PrintBase()

Slic3r::PrintBase::PrintBase ( )
inline
void restart()
Definition PrintBase.hpp:513
DynamicPrintConfig m_full_print_config
Definition PrintBase.hpp:562
PlaceholderParser m_placeholder_parser
Definition PrintBase.hpp:564

References m_full_print_config, m_placeholder_parser, and restart().

Referenced by Slic3r::PrintBase::SlicingStatus::SlicingStatus().

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

◆ ~PrintBase()

virtual Slic3r::PrintBase::~PrintBase ( )
inlinevirtual
394{}

Member Function Documentation

◆ apply()

virtual ApplyStatus Slic3r::PrintBase::apply ( const Model & model,
DynamicPrintConfig config,
bool extruder_applied = false )
pure virtual

Implemented in Slic3r::Print, and Slic3r::SLAPrint.

References model().

Referenced by Slic3r::GUI::CalibUtils::process_and_store_3mf(), and Slic3r::CLI::run().

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

◆ assign_new_unique_ids_recursive()

virtual void Slic3r::ObjectBase::assign_new_unique_ids_recursive ( )
inlineprotectedvirtualinherited

Reimplemented in Slic3r::Model, Slic3r::ModelObject, and Slic3r::ModelVolume.

95{ this->set_new_unique_id(); }
void set_new_unique_id()
Definition ObjectID.hpp:89

References set_new_unique_id().

Here is the call graph for this function:

◆ call_cancel_callback()

void Slic3r::PrintBase::call_cancel_callback ( )
inlineprotected
cancel_callback_type m_cancel_callback
Definition PrintBase.hpp:580

References m_cancel_callback.

◆ cancel()

void Slic3r::PrintBase::cancel ( )
inline
std::atomic< CancelStatus > m_cancel_status
Definition PrintBase.hpp:577

References CANCELED_BY_USER, and m_cancel_status.

Referenced by Slic3r::GUI::GLGizmoFdmSupports::invalid_support_volumes(), and Slic3r::GUI::GLGizmoFdmSupports::on_shutdown().

Here is the caller graph for this function:

◆ cancel_callback()

std::function< void()> Slic3r::PrintBase::cancel_callback ( )
inlineprotected

◆ cancel_internal()

void Slic3r::PrintBase::cancel_internal ( )
inline

◆ cancel_status()

CancelStatus Slic3r::PrintBase::cancel_status ( ) const
inline
506{ return m_cancel_status.load(std::memory_order_acquire); }

References m_cancel_status.

◆ canceled()

bool Slic3r::PrintBase::canceled ( ) const
inline
508{ return m_cancel_status.load(std::memory_order_acquire) != NOT_CANCELED; }

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().

Here is the caller graph for this function:

◆ clear()

virtual void Slic3r::PrintBase::clear ( )
pure virtual

Implemented in Slic3r::Print, and Slic3r::SLAPrint.

References clear().

Referenced by clear().

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

◆ copy_id()

void Slic3r::ObjectBase::copy_id ( const ObjectBase & rhs)
inlineprotectedinherited
92{ m_id = rhs.id(); }
ObjectID m_id
Definition ObjectID.hpp:98

References ObjectBase(), id(), and m_id.

Referenced by Slic3r::CutObjectBase::copy().

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

◆ empty()

virtual bool Slic3r::PrintBase::empty ( ) const
pure virtual

Implemented in Slic3r::Print, and Slic3r::SLAPrint.

References empty().

Referenced by empty(), and Slic3r::CLI::run().

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

◆ export_cached_data()

virtual int Slic3r::PrintBase::export_cached_data ( const std::string & dir_path,
bool with_space = false )
inlinevirtual

Reimplemented in Slic3r::Print.

437{ return 0;}

Referenced by Slic3r::CLI::run().

Here is the caller graph for this function:

◆ finalize()

virtual void Slic3r::PrintBase::finalize ( )
inlinevirtual

Reimplemented in Slic3r::SLAPrint.

441{}

◆ finished()

virtual bool Slic3r::PrintBase::finished ( ) const
pure virtual

Implemented in Slic3r::Print, and Slic3r::SLAPrint.

◆ full_print_config()

◆ generate_new_id()

ObjectID Slic3r::ObjectBase::generate_new_id ( )
inlinestaticprivateinherited
100{ return ObjectID(++ s_last_id); }
static size_t s_last_id
Definition ObjectID.hpp:101

References s_last_id.

Referenced by ObjectBase(), and set_new_unique_id().

Here is the caller graph for this function:

◆ get_no_check_flag()

bool Slic3r::PrintBase::get_no_check_flag ( ) const
inline
528{ return m_no_check; }
bool m_no_check
Definition PrintBase.hpp:568

References m_no_check.

◆ get_plate_index()

int Slic3r::PrintBase::get_plate_index ( ) const
inline
526{ return m_plate_index; }
int m_plate_index
Definition PrintBase.hpp:567

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().

Here is the caller graph for this function:

◆ get_plate_name()

std::string Slic3r::PrintBase::get_plate_name ( ) const
inline
532{ return m_plate_name; }
std::string m_plate_name
Definition PrintBase.hpp:571

References m_plate_name.

Referenced by Slic3r::GCode::_do_export().

Here is the caller graph for this function:

◆ id()

ObjectID Slic3r::ObjectBase::id ( ) const
inlineinherited
69{ return m_id; }

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.

◆ load_and_construct()

template<class Archive>
void Slic3r::ObjectBase::load_and_construct ( Archive & ar,
cereal::construct< ObjectBase > & construct )
inlinestaticprivateinherited
109{ ObjectID id; ar(id); construct(id); }
ObjectID id() const
Definition ObjectID.hpp:69

References id().

Here is the call graph for this function:

◆ load_cached_data()

virtual int Slic3r::PrintBase::load_cached_data ( const std::string & directory)
inlinevirtual

Reimplemented in Slic3r::Print.

438{ return 0;}

Referenced by Slic3r::CLI::run().

Here is the caller graph for this function:

◆ make_try_cancel()

PrintTryCancel Slic3r::PrintBase::make_try_cancel ( ) const
inlineprotected
554{ return PrintTryCancel(this); }
friend PrintTryCancel
Definition PrintBase.hpp:587

References PrintTryCancel.

◆ model()

const Model & Slic3r::PrintBase::model ( ) const
inline
420{ return m_model; }
Model m_model
Definition PrintBase.hpp:561

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().

Here is the caller graph for this function:

◆ output_filename() [1/2]

virtual std::string Slic3r::PrintBase::output_filename ( const std::string & filename_base = std::string()) const
pure virtual

Implemented in Slic3r::Print, and Slic3r::SLAPrint.

Referenced by Slic3r::Print::output_filename(), Slic3r::SLAPrint::output_filename(), and output_filepath().

Here is the caller graph for this function:

◆ output_filename() [2/2]

std::string Slic3r::PrintBase::output_filename ( const std::string & format,
const std::string & default_ext,
const std::string & filename_base,
const DynamicConfig * config_override = nullptr ) const
protected
82{
83 DynamicConfig cfg;
84 if (config_override != nullptr)
85 cfg = *config_override;
86 cfg.set_key_value("version", new ConfigOptionString(std::string(SoftFever_VERSION)));
89 this->update_object_placeholders(cfg, default_ext);
90 if (! filename_base.empty()) {
91 cfg.set_key_value("input_filename", new ConfigOptionString(filename_base + default_ext));
92 cfg.set_key_value("input_filename_base", new ConfigOptionString(filename_base));
93 }
94 try {
95 boost::filesystem::path filename = format.empty() ?
96 cfg.opt_string("input_filename_base") + default_ext :
97 this->placeholder_parser().process(format, 0, &cfg);
98 if (filename.extension().empty())
99 filename.replace_extension(default_ext);
100 return filename.string();
101 } catch (std::runtime_error &err) {
102 throw Slic3r::PlaceholderParserError(L("Processing of the filename_format template failed.") + "\n" + err.what());
103 }
104}
#define L(s)
Definition ExtrusionEntity.cpp:25
void update_user_name()
Definition PlaceholderParser.hpp:88
std::string process(const std::string &templ, unsigned int current_extruder_id, const DynamicConfig *config_override, DynamicConfig *config_outputs, ContextData *context) const
Definition PlaceholderParser.cpp:2682
void update_timestamp()
Definition PlaceholderParser.hpp:85
void update_object_placeholders(DynamicConfig &config, const std::string &default_ext) const
Definition PrintBase.cpp:37
const PlaceholderParser & placeholder_parser() const
Definition PrintBase.hpp:517
zaa_minimize_perimeter_height ConfigOptionString
Definition PrintConfig.hpp:1702
std::string format(const char *fmt, TArgs &&... args)
Definition format.hpp:45

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().

Here is the call graph for this function:

◆ output_filepath()

std::string Slic3r::PrintBase::output_filepath ( const std::string & path,
const std::string & filename_base = std::string() ) const
107{
108 // if we were supplied no path, generate an automatic one based on our first object's input file
109 if (path.empty())
110 // get the first input file name
111 return (boost::filesystem::path(m_model.propose_export_file_name_and_path()).parent_path() / this->output_filename(filename_base)).make_preferred().string();
112
113 // if we were supplied a directory, use it and append our automatically generated filename
114 boost::filesystem::path p(path);
115 if (boost::filesystem::is_directory(p))
116 return (p / this->output_filename(filename_base)).make_preferred().string();
117
118 // if we were supplied a file which is not a directory, use it
119 return path;
120}
virtual std::string output_filename(const std::string &filename_base=std::string()) const =0

References m_model, and output_filename().

Here is the call graph for this function:

◆ placeholder_parser()

const PlaceholderParser & Slic3r::PrintBase::placeholder_parser ( ) const
inline
517{ return m_placeholder_parser; }

References m_placeholder_parser.

Referenced by Slic3r::GCode::_do_export(), and output_filename().

Here is the caller graph for this function:

◆ print_object_ids()

virtual std::vector< ObjectID > Slic3r::PrintBase::print_object_ids ( ) const
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().

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

◆ process()

virtual void Slic3r::PrintBase::process ( long long * time_cost_with_cache = nullptr,
bool use_cache = false )
pure virtual

Implemented in Slic3r::Print, and Slic3r::SLAPrint.

Referenced by Slic3r::CLI::run().

Here is the caller graph for this function:

◆ restart()

void Slic3r::PrintBase::restart ( )
inline

References m_cancel_status, and NOT_CANCELED.

Referenced by PrintBase(), and Slic3r::GUI::GLGizmoFdmSupports::run_thread().

Here is the caller graph for this function:

◆ serialize()

template<class Archive>
void Slic3r::ObjectBase::serialize ( Archive & ar)
inlineprivateinherited
108{ ar(m_id); }

References m_id.

◆ set_cancel_callback()

void Slic3r::PrintBase::set_cancel_callback ( cancel_callback_type cancel_callback)
inline
std::function< void()> cancel_callback()
Definition PrintBase.hpp:539

References cancel_callback(), and m_cancel_callback.

Here is the call graph for this function:

◆ set_invalid_id()

void Slic3r::ObjectBase::set_invalid_id ( )
inlineprotectedinherited
90{ m_id = 0; }

References m_id.

Referenced by Slic3r::CutObjectBase::invalidate().

Here is the caller graph for this function:

◆ set_new_unique_id()

void Slic3r::ObjectBase::set_new_unique_id ( )
inlineprotectedinherited
89{ m_id = generate_new_id(); }
static ObjectID generate_new_id()
Definition ObjectID.hpp:100

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().

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

◆ set_no_check_flag()

void Slic3r::PrintBase::set_no_check_flag ( bool no_check)
inline
529{ m_no_check = no_check; }

References m_no_check.

Referenced by Slic3r::CLI::run().

Here is the caller graph for this function:

◆ set_plate_index()

void Slic3r::PrintBase::set_plate_index ( int index)
inline
527{ m_plate_index = index; }

References m_plate_index.

◆ set_plate_name()

void Slic3r::PrintBase::set_plate_name ( const std::string & name)
inline
533{ m_plate_name = name; }

References m_plate_name.

◆ set_status()

void Slic3r::PrintBase::set_status ( int percent,
const std::string & message,
unsigned int flags = SlicingStatus::DEFAULT,
int warning_step = -1 ) const
124{
126 m_status_callback(SlicingStatus(percent, message, flags, warning_step));
127 else
128 BOOST_LOG_TRIVIAL(debug) <<boost::format("Percent %1%: %2%\n")%percent %message.c_str();
129}
status_callback_type m_status_callback
Definition PrintBase.hpp:574
Definition PrintBase.hpp:443

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().

Here is the caller graph for this function:

◆ set_status_callback()

void Slic3r::PrintBase::set_status_callback ( status_callback_type cb)
inline
488{ m_status_callback = cb; }

References m_status_callback.

Referenced by Slic3r::CLI::run().

Here is the caller graph for this function:

◆ set_status_default()

void Slic3r::PrintBase::set_status_default ( )
inline
484{ m_status_callback = nullptr; }

References m_status_callback.

◆ set_status_silent()

void Slic3r::PrintBase::set_status_silent ( )
inline
486{ m_status_callback = [](const SlicingStatus&){}; }

References m_status_callback.

Referenced by anonymous_namespace{OrcaSlicer_profile_validator.cpp}::slice_two_color_cube_and_export().

Here is the caller graph for this function:

◆ set_task()

virtual void Slic3r::PrintBase::set_task ( const TaskParams & params)
inlinevirtual

Reimplemented in Slic3r::SLAPrint.

434{}

◆ state_mutex()

◆ status_update_warnings() [1/2]

void Slic3r::PrintBase::status_update_warnings ( int step,
PrintStateBase::WarningLevel warning_level,
const std::string & message,
const PrintObjectBase * print_object = nullptr,
PrintStateBase::SlicingNotificationType message_id = PrintStateBase::SlicingDefaultNotification )
protected
133{
134 if (this->m_status_callback) {
135 auto status = print_object ? SlicingStatus(*print_object, step, message, message_id, warning_level) : SlicingStatus(*this, step, message, message_id, warning_level);
136 m_status_callback(status);
137 }
138 else if (! message.empty())
139 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", Print warning: %1%\n")% message.c_str();
140}
void step(Coord &crd, const Dir d, const long n=1)
Definition MarchingSquares.hpp:213

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().

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

◆ status_update_warnings() [2/2]

void Slic3r::PrintBase::status_update_warnings ( int step,
PrintStateBase::WarningLevel warning_level,
const std::string & message,
PrintObjectBase & object,
PrintStateBase::SlicingNotificationType message_id = PrintStateBase::SlicingDefaultNotification )
protected
145{
146 //BBS: add object it into slicing status
147 if (this->m_status_callback) {
148 m_status_callback(SlicingStatus(object, step, message, message_id, warning_level));
149 }
150 else if (!message.empty())
151 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", PrintObject warning: %1%\n")% message.c_str();
152}

References m_status_callback, and PrintObjectBase.

Here is the call graph for this function:

◆ technology()

virtual PrinterTechnology Slic3r::PrintBase::technology ( ) const
pure virtualnoexcept

Implemented in Slic3r::Print, and Slic3r::SLAPrint.

◆ throw_if_canceled()

void Slic3r::PrintBase::throw_if_canceled ( ) const
inlineprotected
552{ if (m_cancel_status.load(std::memory_order_acquire)) throw CanceledException(); }

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().

Here is the caller graph for this function:

◆ timestamp()

virtual Timestamp Slic3r::ObjectBase::timestamp ( ) const
inlinevirtualinherited

Reimplemented in Slic3r::ModelConfigObject, and Slic3r::ObjectWithTimestamp.

74{ return 0; }

◆ update_object_placeholders()

void Slic3r::PrintBase::update_object_placeholders ( DynamicConfig & config,
const std::string & default_ext ) const
protected
38{
39 // get the first input file name
40 std::string input_file;
41 std::string first_object_name;
42 std::vector<std::string> v_scale;
43 int num_objects = 0;
44 int num_instances = 0;
45 for (const ModelObject *model_object : m_model.objects) {
46 ModelInstance *printable = nullptr;
47 for (ModelInstance *model_instance : model_object->instances)
48 if (model_instance->is_printable()) {
49 printable = model_instance;
50 ++ num_instances;
51 }
52 if (printable) {
53 ++ num_objects;
54 if (num_objects == 1)
55 first_object_name = model_object->name;
56 // CHECK_ME -> Is the following correct ?
57 v_scale.push_back("x:" + boost::lexical_cast<std::string>(printable->get_scaling_factor(X) * 100) +
58 "% y:" + boost::lexical_cast<std::string>(printable->get_scaling_factor(Y) * 100) +
59 "% z:" + boost::lexical_cast<std::string>(printable->get_scaling_factor(Z) * 100) + "%");
60 if (input_file.empty())
61 input_file = model_object->name.empty() ? model_object->input_file : model_object->name;
62 }
63 }
64
65 config.set_key_value("num_objects", new ConfigOptionInt(num_objects));
66 config.set_key_value("num_instances", new ConfigOptionInt(num_instances));
67
68 config.set_key_value("scale", new ConfigOptionStrings(v_scale));
69 config.set_key_value("first_object_name", new ConfigOptionString(first_object_name));
70 if (! input_file.empty()) {
71 // get basename with and without suffix
72 const std::string input_filename = boost::filesystem::path(input_file).filename().string();
73 const std::string input_filename_base = input_filename.substr(0, input_filename.find_last_of("."));
74 config.set_key_value("input_filename", new ConfigOptionString(input_filename_base + default_ext));
75 config.set_key_value("input_filename_base", new ConfigOptionString(input_filename_base));
76 }
77}
@ Y
Definition libslic3r.h:142
@ Z
Definition libslic3r.h:143
@ X
Definition libslic3r.h:141

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().

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

◆ validate()

virtual StringObjectException Slic3r::PrintBase::validate ( std::vector< StringObjectException > * warnings = nullptr,
Polygons * collison_polygons = nullptr,
std::vector< std::pair< Polygon, float > > * height_polygons = nullptr ) const
inlinevirtual

Reimplemented in Slic3r::Print, and Slic3r::SLAPrint.

408{ return {}; }

References validate().

Referenced by Slic3r::CLI::run(), and validate().

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

◆ BackgroundSlicingProcess

friend class BackgroundSlicingProcess
friend

◆ PrintObjectBase

Member Data Documentation

◆ m_cancel_callback

cancel_callback_type Slic3r::PrintBase::m_cancel_callback = [](){}
private

◆ m_cancel_status

std::atomic<CancelStatus> Slic3r::PrintBase::m_cancel_status
private

◆ m_full_print_config

DynamicPrintConfig Slic3r::PrintBase::m_full_print_config
protected

Referenced by PrintBase(), and full_print_config().

◆ m_id

ObjectID Slic3r::ObjectBase::m_id
privateinherited

◆ m_model

Model Slic3r::PrintBase::m_model
protected

◆ m_no_check

bool Slic3r::PrintBase::m_no_check = false
protected

◆ m_ori_full_print_config

DynamicPrintConfig Slic3r::PrintBase::m_ori_full_print_config
protected

◆ m_placeholder_parser

PlaceholderParser Slic3r::PrintBase::m_placeholder_parser
protected

Referenced by PrintBase(), and placeholder_parser().

◆ m_plate_index

int Slic3r::PrintBase::m_plate_index { 0 }
protected
567{ 0 };

Referenced by get_plate_index(), and set_plate_index().

◆ m_plate_name

std::string Slic3r::PrintBase::m_plate_name
protected

Referenced by get_plate_name(), and set_plate_name().

◆ m_state_mutex

std::mutex Slic3r::PrintBase::m_state_mutex
mutableprivate

Referenced by state_mutex().

◆ m_status_callback

◆ PrintTryCancel

friend Slic3r::PrintBase::PrintTryCancel
private

Referenced by make_try_cancel().

◆ s_last_id

size_t Slic3r::ObjectBase::s_last_id = 0
staticprivateinherited

Referenced by generate_new_id().


The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/PrintBase.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/PrintBase.cpp