Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::PrintBase Class Referenceabstract

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

#include <src/libslic3r/PrintBase.hpp>

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

Classes

struct  SlicingStatus
 
struct  TaskParams
 

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< ObjectIDprint_object_ids () const =0
 
virtual std::string validate (std::vector< std::string > *warnings=nullptr) const
 
virtual ApplyStatus apply (const Model &model, DynamicPrintConfig config)=0
 
const Modelmodel () const
 
virtual void set_task (const TaskParams &params)=0
 
virtual void process ()=0
 
virtual void finalize ()=0
 
virtual void cleanup ()=0
 
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)
 
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 PlaceholderParserplaceholder_parser () const
 
const DynamicPrintConfigfull_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
 
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)
 
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
 
PlaceholderParser m_placeholder_parser
 
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< CancelStatusm_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

◆ status_callback_type

◆ Timestamp

Member Enumeration Documentation

◆ ApplyStatus

Enumerator
APPLY_STATUS_UNCHANGED 
APPLY_STATUS_CHANGED 
APPLY_STATUS_INVALIDATED 
423 {
424 // No change after the Print::apply() call.
426 // Some of the Print / PrintObject / PrintObjectInstance data was changed,
427 // but no result was invalidated (only data influencing not yet calculated results were changed).
429 // Some data was changed, which in turn invalidated already calculated steps.
431 };
@ APPLY_STATUS_UNCHANGED
Definition PrintBase.hpp:425
@ APPLY_STATUS_CHANGED
Definition PrintBase.hpp:428
@ APPLY_STATUS_INVALIDATED
Definition PrintBase.hpp:430

◆ CancelStatus

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

Constructor & Destructor Documentation

◆ PrintBase()

Slic3r::PrintBase::PrintBase ( )
inline
void restart()
Definition PrintBase.hpp:518
DynamicPrintConfig m_full_print_config
Definition PrintBase.hpp:554
PlaceholderParser m_placeholder_parser
Definition PrintBase.hpp:555

References restart().

+ Here is the call graph for this function:

◆ ~PrintBase()

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

Member Function Documentation

◆ apply()

virtual ApplyStatus Slic3r::PrintBase::apply ( const Model model,
DynamicPrintConfig  config 
)
pure virtual

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

Referenced by Slic3r::BackgroundSlicingProcess::apply(), and Slic3r::CLI::run().

+ 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.

79{ this->set_new_unique_id(); }
void set_new_unique_id()
Definition ObjectID.hpp:73

References Slic3r::ObjectBase::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:564

References m_cancel_callback.

Referenced by Slic3r::SLAPrint::apply(), and Slic3r::PrintBaseWithState< PrintStepEnumType, COUNT >::set_task_impl().

+ Here is the caller graph for this function:

◆ cancel()

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

References CANCELED_BY_USER, and m_cancel_status.

Referenced by Slic3r::BackgroundSlicingProcess::stop().

+ 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

References CANCELED_INTERNAL, and m_cancel_status.

Referenced by Slic3r::BackgroundSlicingProcess::stop_internal().

+ Here is the caller graph for this function:

◆ cancel_status()

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

References m_cancel_status.

Referenced by Slic3r::BackgroundSlicingProcess::thread_proc().

+ Here is the caller graph for this function:

◆ canceled()

bool Slic3r::PrintBase::canceled ( ) const
inline

◆ cleanup()

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

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

Referenced by Slic3r::BackgroundSlicingProcess::thread_proc().

+ Here is the caller graph for this function:

◆ clear()

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

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

Referenced by Slic3r::BackgroundSlicingProcess::reset().

+ Here is the caller graph for this function:

◆ copy_id()

void Slic3r::ObjectBase::copy_id ( const ObjectBase rhs)
inlineprotectedinherited
76{ m_id = rhs.id(); }
ObjectID m_id
Definition ObjectID.hpp:82
size_t id
Definition ObjectID.hpp:37

References Slic3r::ObjectBase::id(), and Slic3r::ObjectBase::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.

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

+ Here is the caller graph for this function:

◆ finalize()

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

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

Referenced by Slic3r::BackgroundSlicingProcess::thread_proc().

+ Here is the caller graph for this function:

◆ finished()

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

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

Referenced by Slic3r::BackgroundSlicingProcess::finished().

+ Here is the caller graph for this function:

◆ full_print_config()

◆ generate_new_id()

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

References Slic3r::ObjectBase::s_last_id.

Referenced by Slic3r::ObjectBase::set_new_unique_id().

+ Here is the caller graph for this function:

◆ id()

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

References Slic3r::ObjectBase::m_id.

Referenced by 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::_3MF_Importer::_load_model_from_file(), Slic3r::GUI::Plater::priv::actualize_slicing_warnings(), Slic3r::ModelObjectStatusDB::add(), Slic3r::ModelObjectStatusDB::add_if_new(), Slic3r::Print::apply(), Slic3r::SLAPrint::apply(), Slic3r::GUI::GLGizmoFdmSupports::apply_data_from_backend(), Slic3r::ModelVolume::check(), Slic3r::check_model_ids_equal(), Slic3r::ModelObject::convert_units(), Slic3r::ObjectBase::copy_id(), Slic3r::PrintObjectStatusDB::count(), anonymous_namespace{RaycastManager.cpp}::create_key(), priv::create_volume(), Slic3r::GUI::Emboss::create_volume_sources(), Slic3r::GUI::GLGizmoHollow::data_changed(), Slic3r::GUI::GLGizmoPainterBase::data_changed(), Slic3r::GUI::GLGizmoSlaSupports::data_changed(), Slic3r::Model::delete_object(), Slic3r::GUI::Plater::export_stl_obj(), Slic3r::ModelObjectStatusDB::get(), Slic3r::GUI::get_arrange_poly(), Slic3r::GUI::GLGizmoSlaSupports::get_data_from_backend(), Slic3r::PrintObjectStatusDB::get_range(), Slic3r::GUI::GLGizmoFdmSupports::has_backend_supports(), Slic3r::GUI::GLGizmoSlaSupports::has_backend_supports(), Slic3r::CutObjectBase::has_same_id(), Slic3r::UndoRedo::StackImpl::immutable_object_id_impl(), Slic3r::GUI::GLGizmoSimplify::init_model(), Slic3r::inner_brim_area(), Slic3r::ModelObject::is_cut(), Slic3r::CutObjectBase::is_equal(), Slic3r::ObjectBase::load_and_construct(), Slic3r::UndoRedo::StackImpl::load_snapshot(), Slic3r::GUI::ObjectList::merge(), 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::CommonGizmosDataObjects::SelectionInfo::on_update(), Slic3r::CutObjectBase::operator<(), Slic3r::Model::operator=(), Slic3r::ModelObject::operator=(), Slic3r::ModelObject::operator=(), Slic3r::CutObjectBase::operator==(), Slic3r::GUI::GLGizmoCut3D::perform_cut(), Slic3r::GUI::GLGizmoEmboss::process(), Slic3r::GUI::processed_objects_idxs(), Slic3r::GUI::GLCanvas3D::reload_scene(), Slic3r::GUI::GLCanvas3D::LayersEditing::select_object(), Slic3r::ModelMaterial::serialize(), Slic3r::SLAPrintObject::SliceRecord::set_model_slice_idx(), Slic3r::SLAPrintObject::SliceRecord::set_support_slice_idx(), Slic3r::slices_to_regions(), Slic3r::ModelObject::split(), Slic3r::UndoRedo::StackImpl::take_snapshot(), Slic3r::top_level_outer_brim_area(), Slic3r::GUI::update_object_cut_id(), and anonymous_namespace{EmbossJob.cpp}::update_volume_name().

◆ load_and_construct()

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

References Slic3r::ObjectBase::id().

+ Here is the call graph for this function:

◆ make_try_cancel()

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

References PrintTryCancel.

Referenced by Slic3r::Print::process().

+ Here is the caller graph for this function:

◆ model()

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

References m_model.

Referenced by Slic3r::ToolOrdering::ToolOrdering(), Slic3r::GUI::Plater::priv::actualize_object_warnings(), Slic3r::SLAPrint::apply(), Slic3r::ToolOrdering::assign_custom_gcodes(), Slic3r::GUI::GLCanvas3D::reload_scene(), Slic3r::sort_object_instances_by_model_order(), and Slic3r::DoExport::validate_custom_gcode().

+ 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
61{
62 DynamicConfig cfg;
63 if (config_override != nullptr)
64 cfg = *config_override;
65 cfg.set_key_value("version", new ConfigOptionString(std::string(SLIC3R_VERSION)));
67 this->update_object_placeholders(cfg, default_ext);
68 if (! filename_base.empty()) {
69 cfg.set_key_value("input_filename", new ConfigOptionString(filename_base + default_ext));
70 cfg.set_key_value("input_filename_base", new ConfigOptionString(filename_base));
71 }
72 try {
73 boost::filesystem::path filename = format.empty() ?
74 cfg.opt_string("input_filename_base") + default_ext :
75 this->placeholder_parser().process(format, 0, &cfg);
76 if (filename.extension().empty())
77 filename = boost::filesystem::change_extension(filename, default_ext);
78 return filename.string();
79 } catch (std::runtime_error &err) {
80 throw Slic3r::PlaceholderParserError(_u8L("Failed processing of the output_filename_format template.") + "\n" + err.what());
81 }
82}
#define _u8L(s)
macro used to mark string used at localization, return same string
Definition SLAPrint.cpp:29
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:2344
void update_timestamp()
Definition PlaceholderParser.hpp:72
void update_object_placeholders(DynamicConfig &config, const std::string &default_ext) const
Definition PrintBase.cpp:20
const PlaceholderParser & placeholder_parser() const
Definition PrintBase.hpp:522
std::string format(const char *fmt, TArgs &&... args)
Definition format.hpp:44

References _u8L, Slic3r::format(), Slic3r::ConfigBase::opt_string(), placeholder_parser(), Slic3r::PlaceholderParser::process(), Slic3r::DynamicConfig::set_key_value(), update_object_placeholders(), and Slic3r::PlaceholderParser::update_timestamp().

+ 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
85{
86 // if we were supplied no path, generate an automatic one based on our first object's input file
87 if (path.empty())
88 // get the first input file name
89 return (boost::filesystem::path(m_model.propose_export_file_name_and_path()).parent_path() / this->output_filename(filename_base)).make_preferred().string();
90
91 // if we were supplied a directory, use it and append our automatically generated filename
92 boost::filesystem::path p(path);
93 if (boost::filesystem::is_directory(p))
94 return (p / this->output_filename(filename_base)).make_preferred().string();
95
96 // if we were supplied a file which is not a directory, use it
97 return path;
98}
std::string propose_export_file_name_and_path() const
Definition Model.cpp:585
virtual std::string output_filename(const std::string &filename_base=std::string()) const =0

References m_model, output_filename(), and Slic3r::Model::propose_export_file_name_and_path().

Referenced by Slic3r::Print::export_gcode(), Slic3r::BackgroundSlicingProcess::output_filepath_for_project(), and Slic3r::CLI::run().

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

◆ placeholder_parser()

const PlaceholderParser & Slic3r::PrintBase::placeholder_parser ( ) const
inline
522{ 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.

Referenced by Slic3r::GUI::Plater::priv::actualize_slicing_warnings().

+ Here is the caller graph for this function:

◆ process()

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

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

Referenced by Slic3r::BackgroundSlicingProcess::process_fff(), Slic3r::BackgroundSlicingProcess::process_sla(), and 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::BackgroundSlicingProcess::thread_proc().

+ Here is the caller graph for this function:

◆ serialize()

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

References Slic3r::ObjectBase::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:535

References cancel_callback(), and m_cancel_callback.

Referenced by Slic3r::BackgroundSlicingProcess::start(), Slic3r::BackgroundSlicingProcess::stop(), and Slic3r::BackgroundSlicingProcess::stop_internal().

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

◆ set_invalid_id()

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

References Slic3r::ObjectBase::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
73{ m_id = generate_new_id(); }
static ObjectID generate_new_id()
Definition ObjectID.hpp:84

References Slic3r::ObjectBase::generate_new_id(), and Slic3r::ObjectBase::m_id.

Referenced by Slic3r::ModelVolume::ModelVolume(), Slic3r::Model::assign_new_unique_ids_recursive(), Slic3r::ObjectBase::assign_new_unique_ids_recursive(), Slic3r::ModelObject::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_status()

void Slic3r::PrintBase::set_status ( int  percent,
const std::string &  message,
unsigned int  flags = SlicingStatus::DEFAULT 
)
inline
492 {
493 if (m_status_callback) m_status_callback(SlicingStatus(percent, message, flags));
494 else printf("%d => %s\n", percent, message.c_str());
495 }
status_callback_type m_status_callback
Definition PrintBase.hpp:558

References m_status_callback.

Referenced by Slic3r::Print::alert_when_supports_needed(), Slic3r::Print::export_gcode(), Slic3r::BackgroundSlicingProcess::finalize_gcode(), Slic3r::PrintObject::make_perimeters(), Slic3r::SLAPrint::StatusReporter::operator()(), Slic3r::BackgroundSlicingProcess::prepare_upload(), Slic3r::Print::process(), Slic3r::BackgroundSlicingProcess::process_fff(), and Slic3r::BackgroundSlicingProcess::process_sla().

+ Here is the caller graph for this function:

◆ set_status_callback()

void Slic3r::PrintBase::set_status_callback ( status_callback_type  cb)
inline
490{ 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
486{ m_status_callback = nullptr; }

References m_status_callback.

◆ set_status_silent()

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

References m_status_callback.

◆ set_task()

virtual void Slic3r::PrintBase::set_task ( const TaskParams params)
pure virtual

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

Referenced by Slic3r::BackgroundSlicingProcess::set_task().

+ Here is the caller graph for this function:

◆ state_mutex()

std::mutex & Slic3r::PrintBase::state_mutex ( ) const
inlineprotected

◆ status_update_warnings()

void Slic3r::PrintBase::status_update_warnings ( int  step,
PrintStateBase::WarningLevel  warning_level,
const std::string &  message,
const PrintObjectBase print_object = nullptr 
)
protected
101{
102 if (m_status_callback) {
103 auto status = print_object ? SlicingStatus(*print_object, step) : SlicingStatus(*this, step);
104 m_status_callback(status);
105 }
106 else if (! message.empty())
107 printf("%s warning: %s\n", print_object ? "print_object" : "print", message.c_str());
108}
Coord step(const Coord &crd, Dir d)
Definition MarchingSquares.hpp:137

References m_status_callback.

Referenced by Slic3r::PrintBaseWithState< PrintStepEnumType, COUNT >::active_step_add_warning(), Slic3r::PrintBaseWithState< PrintStepEnumType, COUNT >::set_done(), and Slic3r::PrintObjectBase::status_update_warnings().

+ Here is the caller graph for this function:

◆ technology()

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

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

Referenced by Slic3r::BackgroundSlicingProcess::apply(), Slic3r::BackgroundSlicingProcess::current_printer_technology(), and Slic3r::BackgroundSlicingProcess::select_technology().

+ Here is the caller graph for this function:

◆ throw_if_canceled()

◆ timestamp()

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

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

60{ return 0; }

Referenced by Slic3r::GUI::Plater::priv::undo_redo_to().

+ Here is the caller graph for this function:

◆ update_object_placeholders()

void Slic3r::PrintBase::update_object_placeholders ( DynamicConfig config,
const std::string &  default_ext 
) const
protected
21{
22 // get the first input file name
23 std::string input_file;
24 std::vector<std::string> v_scale;
25 int num_objects = 0;
26 int num_instances = 0;
27 for (const ModelObject *model_object : m_model.objects) {
28 ModelInstance *printable = nullptr;
29 for (ModelInstance *model_instance : model_object->instances)
30 if (model_instance->is_printable()) {
31 printable = model_instance;
32 ++ num_instances;
33 }
34 if (printable) {
35 ++ num_objects;
36 // CHECK_ME -> Is the following correct ?
37 v_scale.push_back("x:" + boost::lexical_cast<std::string>(printable->get_scaling_factor(X) * 100) +
38 "% y:" + boost::lexical_cast<std::string>(printable->get_scaling_factor(Y) * 100) +
39 "% z:" + boost::lexical_cast<std::string>(printable->get_scaling_factor(Z) * 100) + "%");
40 if (input_file.empty())
41 input_file = model_object->name.empty() ? model_object->input_file : model_object->name;
42 }
43 }
44
45 config.set_key_value("num_objects", new ConfigOptionInt(num_objects));
46 config.set_key_value("num_instances", new ConfigOptionInt(num_instances));
47
48 config.set_key_value("scale", new ConfigOptionStrings(v_scale));
49 if (! input_file.empty()) {
50 // get basename with and without suffix
51 const std::string input_filename = boost::filesystem::path(input_file).filename().string();
52 const std::string input_filename_base = input_filename.substr(0, input_filename.find_last_of("."));
53 config.set_key_value("input_filename", new ConfigOptionString(input_filename_base + default_ext));
54 config.set_key_value("input_filename_base", new ConfigOptionString(input_filename_base));
55 }
56}
if(!(yy_init))
Definition lexer.c:1190
@ Y
Definition libslic3r.h:99
@ Z
Definition libslic3r.h:100
@ X
Definition libslic3r.h:98

References Slic3r::ModelInstance::get_scaling_factor(), m_model, Slic3r::Model::objects, 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 std::string Slic3r::PrintBase::validate ( std::vector< std::string > *  warnings = nullptr) const
inlinevirtual

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

421{ return std::string(); }

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

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ BackgroundSlicingProcess

friend class BackgroundSlicingProcess
friend

◆ PrintObjectBase

friend class PrintObjectBase
friend

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

◆ m_id

◆ m_model

◆ m_placeholder_parser

PlaceholderParser Slic3r::PrintBase::m_placeholder_parser
protected

◆ 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

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