OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::SLAPrintObject Class Reference

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

Inheritance diagram for Slic3r::SLAPrintObject:
Collaboration diagram for Slic3r::SLAPrintObject:

Classes

struct  Instance
class  SliceRecord
class  SupportData
class  HollowingData

Public Types

typedef PrintState< SLAPrintObjectStep, COUNT > PrintObjectState
using Timestamp

Public Member Functions

 SLAPrintObject (const SLAPrintObject &)=delete
SLAPrintObject & operator= (const SLAPrintObject &)=delete
const SLAPrintObjectConfig & config () const
const Transform3d & trafo () const
bool is_left_handed () const
const std::vector< Instance > & instances () const
bool has_mesh (SLAPrintObjectStep step) const
TriangleMesh get_mesh (SLAPrintObjectStep step) const
const TriangleMesh & support_mesh () const
const TriangleMesh & pad_mesh () const
const indexed_triangle_set & hollowed_interior_mesh () const
const TriangleMesh & get_mesh_to_print () const
const TriangleMesh & get_mesh_to_slice () const
const TriangleMesh & transformed_mesh () const
sla::SupportPoints transformed_support_points () const
sla::DrainHoles transformed_drainhole_points () const
double get_elevation () const
double get_current_elevation () const
const std::vector< sla::SupportPoint > & get_support_points () const
const std::vector< SliceRecord > & get_slice_index () const
const SliceRecord & closest_slice_to_print_level (coord_t print_level, coord_t max_epsilon=std::numeric_limits< coord_t >::max()) const
const SliceRecord & closest_slice_to_slice_level (float slice_level, float max_epsilon=std::numeric_limits< float >::max()) const
SLAPrint * print ()
const SLAPrint * print () const
bool is_step_done (SLAPrintObjectStep step) const
PrintStateBase::StateWithTimeStamp step_state_with_timestamp (SLAPrintObjectStep step) const
PrintStateBase::StateWithWarnings step_state_with_warnings (SLAPrintObjectStep step) const
const ModelObject * model_object () const
ModelObject * model_object ()
ObjectID id () const
virtual Timestamp timestamp () const

Protected Member Functions

 SLAPrintObject (SLAPrint *print, ModelObject *model_object)
 ~SLAPrintObject ()
void config_apply (const ConfigBase &other, bool ignore_nonexistent=false)
void config_apply_only (const ConfigBase &other, const t_config_option_keys &keys, bool ignore_nonexistent=false)
void set_trafo (const Transform3d &trafo, bool left_handed)
template<class InstVec>
void set_instances (InstVec &&instances)
bool invalidate_step (SLAPrintObjectStep step)
bool invalidate_all_steps ()
bool invalidate_state_by_config_options (const std::vector< t_config_option_key > &opt_keys)
bool set_started (SLAPrintObjectStep step)
PrintStateBase::TimeStamp set_done (SLAPrintObjectStep step)
bool invalidate_steps (StepTypeIterator step_begin, StepTypeIterator step_end)
bool invalidate_steps (std::initializer_list< SLAPrintObjectStep > il)
bool invalidate_all_steps_without_cancel ()
bool is_step_started_unguarded (SLAPrintObjectStep step) const
bool is_step_done_unguarded (SLAPrintObjectStep step) const
void active_step_add_warning (PrintStateBase::WarningLevel warning_level, const std::string &message, PrintStateBase::SlicingNotificationType message_id=PrintStateBase::SlicingDefaultNotification)
void throw_if_canceled ()
void status_update_warnings (PrintBase *print, int step, PrintStateBase::WarningLevel warning_level, const std::string &message, PrintStateBase::SlicingNotificationType message_id=PrintStateBase::SlicingDefaultNotification)
void emptylayer_update_msg (PrintBase *print, int type, const std::string &message, bool overwrite)
void set_new_unique_id ()
void set_invalid_id ()
void copy_id (const ObjectBase &rhs)
virtual void assign_new_unique_ids_recursive ()

Static Protected Member Functions

static std::mutex & state_mutex (PrintBase *print)
static std::function< void()> cancel_callback (PrintBase *print)

Protected Attributes

std::vector< bool > m_stepmask
friend PrintType
SLAPrint * m_print
ModelObject * m_model_object

Private Types

using Inherited = _SLAPrintObjectBase

Private Member Functions

const std::vector< ExPolygons > & get_model_slices () const
const std::vector< ExPolygons > & get_support_slices () const
void serialize (Archive &ar)

Static Private Member Functions

template<class T>
static T level (const SliceRecord &sr)
template<class T>
static SliceRecord create_slice_record (T val)
template<class Container, class T>
static auto closest_slice_record (Container &cont, T lvl, T eps=std::numeric_limits< T >::max()) -> decltype(cont.begin())
static ObjectID generate_new_id ()
static void load_and_construct (Archive &ar, cereal::construct< ObjectBase > &construct)

Private Attributes

SLAPrintObjectConfig m_config
Transform3d m_trafo = Transform3d::Identity()
bool m_left_handed = false
std::vector< Instance > m_instances
std::vector< ExPolygons > m_model_slices
std::vector< SliceRecord > m_slice_index
std::vector< float > m_model_height_levels
CachedObject< TriangleMesh > m_transformed_rmesh
std::unique_ptr< SupportData > m_supportdata
std::unique_ptr< HollowingData > m_hollowing_data
PrintState< SLAPrintObjectStep, COUNT > m_state
ObjectID m_id

Static Private Attributes

static size_t s_last_id

Friends

class SLAPrint

Detailed Description


Class Documentation

◆ Slic3r::SLAPrintObject::HollowingData

class Slic3r::SLAPrintObject::HollowingData
Collaboration diagram for Slic3r::SLAPrintObject::HollowingData:
Class Members
TriangleMesh hollow_mesh_with_holes
TriangleMesh hollow_mesh_with_holes_trimmed
InteriorPtr interior

Member Typedef Documentation

◆ Inherited

◆ PrintObjectState

typedef PrintState<SLAPrintObjectStep, COUNT> Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, COUNT >::PrintObjectState
inherited

◆ Timestamp

Constructor & Destructor Documentation

◆ SLAPrintObject() [1/2]

Slic3r::SLAPrintObject::SLAPrintObject ( const SLAPrintObject & )
delete

References SLAPrintObject().

Referenced by SLAPrintObject(), operator=(), Slic3r::SLAPrintObject::SliceRecord::print_obj(), Slic3r::SLAPrintObject::SliceRecord::set_model_slice_idx(), and Slic3r::SLAPrintObject::SliceRecord::set_support_slice_idx().

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

◆ SLAPrintObject() [2/2]

Slic3r::SLAPrintObject::SLAPrintObject ( SLAPrint * print,
ModelObject * model_object )
protected
924 , m_stepmask(slaposCount, true)
925 , m_transformed_rmesh([this](TriangleMesh &obj) {
926 obj = m_model_object->raw_mesh();
927 if (!obj.empty()) {
928 obj.transform(m_trafo);
929 }
930 })
931{}
const ModelObject * model_object() const
Definition PrintBase.hpp:346
ModelObject * m_model_object
Definition PrintBase.hpp:362
std::vector< bool > m_stepmask
Definition SLAPrint.hpp:307
CachedObject< TriangleMesh > m_transformed_rmesh
Definition SLAPrint.hpp:330
_SLAPrintObjectBase Inherited
Definition SLAPrint.hpp:68
Transform3d m_trafo
Definition SLAPrint.hpp:314
@ slaposCount
Definition SLAPrint.hpp:50

References Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, slaposCount >::m_model_object, m_stepmask, m_transformed_rmesh, Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, slaposCount >::model_object(), Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, slaposCount >::print(), Slic3r::slaposCount, and SLAPrint.

Here is the call graph for this function:

◆ ~SLAPrintObject()

Slic3r::SLAPrintObject::~SLAPrintObject ( )
protected
933{}

Member Function Documentation

◆ active_step_add_warning()

void Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, COUNT >::active_step_add_warning ( PrintStateBase::WarningLevel warning_level,
const std::string & message,
PrintStateBase::SlicingNotificationType message_id = PrintStateBase::SlicingDefaultNotification )
inlineprotectedinherited
675 {
677 if (active_step.second)
679 }
Definition PrintBase.hpp:635
void active_step_add_warning(PrintStateBase::WarningLevel warning_level, const std::string &message, PrintStateBase::SlicingNotificationType message_id=PrintStateBase::SlicingDefaultNotification)
Definition PrintBase.hpp:674
void status_update_warnings(PrintBase *print, int step, PrintStateBase::WarningLevel warning_level, const std::string &message, PrintStateBase::SlicingNotificationType message_id=PrintStateBase::SlicingDefaultNotification)
Definition PrintBase.cpp:165

◆ assign_new_unique_ids_recursive()

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

◆ cancel_callback()

std::function< void()> Slic3r::PrintObjectBase::cancel_callback ( PrintBase * print)
staticprotectedinherited
161{
162 return print->cancel_callback();
163}
static std::function< void()> cancel_callback(PrintBase *print)
Definition PrintBase.cpp:160

◆ closest_slice_record()

template<class Container, class T>
auto Slic3r::SLAPrintObject::closest_slice_record ( Container & cont,
T lvl,
T eps = std::numeric_limits<T>::max() )->decltype(cont.begin())
inlinestaticprivate
212 {
213 if(cont.empty()) return cont.end();
214 if(cont.size() == 1 && std::abs(level<T>(cont.front()) - lvl) > eps)
215 return cont.end();
216
217 SliceRecord query = create_slice_record(lvl);
218
219 auto it = std::lower_bound(cont.begin(), cont.end(), query,
220 [](const SliceRecord& r1,
221 const SliceRecord& r2)
222 {
223 return level<T>(r1) < level<T>(r2);
224 });
225
226 if(it == cont.end()) return it;
227
228 T diff = std::abs(level<T>(*it) - lvl);
229
230 if(it != cont.begin()) {
231 auto it_prev = std::prev(it);
232 T diff_prev = std::abs(level<T>(*it_prev) - lvl);
233 if(diff_prev < diff) { diff = diff_prev; it = it_prev; }
234 }
235
236 if(diff > eps) it = cont.end();
237
238 return it;
239 }
Definition SLAPrint.hpp:136
static T level(const SliceRecord &sr)
Definition SLAPrint.hpp:187
static SliceRecord create_slice_record(T val)
Definition SLAPrint.hpp:194
Slic3r::Polygons diff(const Slic3r::Polygon &subject, const Slic3r::Polygon &clip, ApplySafetyOffset do_safety_offset)
Definition ClipperUtils.cpp:731

References create_slice_record(), Slic3r::diff(), and level().

Referenced by closest_slice_to_print_level(), closest_slice_to_slice_level(), and Slic3r::SLAPrint::Steps::slice_model().

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

◆ closest_slice_to_print_level()

const SliceRecord & Slic3r::SLAPrintObject::closest_slice_to_print_level ( coord_t print_level,
coord_t max_epsilon = std::numeric_limits<coord_t>::max() ) const
inline
266 {
267 auto it = closest_slice_record(m_slice_index, print_level, max_epsilon);
268 return it == m_slice_index.end() ? SliceRecord::EMPTY : *it;
269 }
static const SliceRecord EMPTY
Definition SLAPrint.hpp:141
std::vector< SliceRecord > m_slice_index
Definition SLAPrint.hpp:325
static auto closest_slice_record(Container &cont, T lvl, T eps=std::numeric_limits< T >::max()) -> decltype(cont.begin())
Definition SLAPrint.hpp:208

References closest_slice_record(), Slic3r::SLAPrintObject::SliceRecord::EMPTY, and m_slice_index.

Referenced by Slic3r::GUI::GLCanvas3D::_render_sla_slices().

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

◆ closest_slice_to_slice_level()

const SliceRecord & Slic3r::SLAPrintObject::closest_slice_to_slice_level ( float slice_level,
float max_epsilon = std::numeric_limits<float>::max() ) const
inline
277 {
278 auto it = closest_slice_record(m_slice_index, slice_level, max_epsilon);
279 return it == m_slice_index.end() ? SliceRecord::EMPTY : *it;
280 }

References closest_slice_record(), Slic3r::SLAPrintObject::SliceRecord::EMPTY, and m_slice_index.

Here is the call graph for this function:

◆ config()

const SLAPrintObjectConfig & Slic3r::SLAPrintObject::config ( ) const
inline
76{ return m_config; }
SLAPrintObjectConfig m_config
Definition SLAPrint.hpp:311

References m_config.

Referenced by Slic3r::SLAPrintStatistics::finalize_output_path(), Slic3r::SLAPrint::Steps::slice_model(), Slic3r::SLAPrint::Steps::slice_supports(), Slic3r::SLAPrint::Steps::support_points(), and Slic3r::SLAPrint::Steps::support_tree().

Here is the caller graph for this function:

◆ config_apply()

void Slic3r::SLAPrintObject::config_apply ( const ConfigBase & other,
bool ignore_nonexistent = false )
inlineprotected
289{ m_config.apply(other, ignore_nonexistent); }

References m_config.

◆ config_apply_only()

void Slic3r::SLAPrintObject::config_apply_only ( const ConfigBase & other,
const t_config_option_keys & keys,
bool ignore_nonexistent = false )
inlineprotected
291 { m_config.apply_only(other, keys, ignore_nonexistent); }

References m_config.

◆ copy_id()

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

◆ create_slice_record()

template<class T>
SliceRecord Slic3r::SLAPrintObject::create_slice_record ( T val)
inlinestaticprivate
195 {
196 static_assert(std::is_arithmetic<T>::value, "Arithmetic only!");
197 return std::is_integral<T>::value
198 ? SliceRecord{coord_t(val), 0.f, 0.f}
199 : SliceRecord{0, float(val), 0.f};
200 }
int64_t coord_t
Definition libslic3r.h:48

Referenced by closest_slice_record().

Here is the caller graph for this function:

◆ emptylayer_update_msg()

void Slic3r::PrintObjectBase::emptylayer_update_msg ( PrintBase * print,
int type,
const std::string & message,
bool overwrite )
protectedinherited

◆ generate_new_id()

ObjectID Slic3r::ObjectBase::generate_new_id ( )
inlinestaticprivateinherited
100{ return ObjectID(++ s_last_id); }

◆ get_current_elevation()

double Slic3r::SLAPrintObject::get_current_elevation ( ) const
1061{
1062 if (is_zero_elevation(m_config)) return 0.;
1063
1064 bool has_supports = is_step_done(slaposSupportTree);
1065 bool has_pad = is_step_done(slaposPad);
1066
1067 if(!has_supports && !has_pad)
1068 return 0;
1069 else if(has_supports && !has_pad) {
1070 return m_config.support_object_elevation.getFloat();
1071 }
1072
1073 return get_elevation();
1074}
bool is_step_done(SLAPrintObjectStep step) const
Definition PrintBase.hpp:641
double get_elevation() const
Definition SLAPrint.cpp:1041
@ slaposPad
Definition SLAPrint.hpp:48
@ slaposSupportTree
Definition SLAPrint.hpp:47
bool is_zero_elevation(const SLAPrintObjectConfig &c)
Definition SLAPrint.cpp:57

References get_elevation(), Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, slaposCount >::is_step_done(), Slic3r::is_zero_elevation(), m_config, Slic3r::slaposPad, and Slic3r::slaposSupportTree.

Here is the call graph for this function:

◆ get_elevation()

double Slic3r::SLAPrintObject::get_elevation ( ) const
1041 {
1042 if (is_zero_elevation(m_config)) return 0.;
1043
1044 bool en = m_config.supports_enable.getBool();
1045
1046 double ret = en ? m_config.support_object_elevation.getFloat() : 0.;
1047
1048 if(m_config.pad_enable.getBool()) {
1049 // Normally the elevation for the pad itself would be the thickness of
1050 // its walls but currently it is half of its thickness. Whatever it
1051 // will be in the future, we provide the config to the get_pad_elevation
1052 // method and we will have the correct value
1053 sla::PadConfig pcfg = make_pad_cfg(m_config);
1054 if(!pcfg.embed_object) ret += pcfg.required_elevation();
1055 }
1056
1057 return ret;
1058}
sla::PadConfig make_pad_cfg(const SLAPrintObjectConfig &c)
Definition SLAPrint.cpp:119

References Slic3r::sla::PadConfig::embed_object, Slic3r::is_zero_elevation(), m_config, Slic3r::make_pad_cfg(), and Slic3r::sla::PadConfig::required_elevation().

Referenced by get_current_elevation(), and Slic3r::SLAPrint::Steps::slice_model().

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

◆ get_mesh()

TriangleMesh Slic3r::SLAPrintObject::get_mesh ( SLAPrintObjectStep step) const
1144{
1145 switch (step) {
1146 case slaposSupportTree:
1147 return this->support_mesh();
1148 case slaposPad:
1149 return this->pad_mesh();
1150 case slaposDrillHoles:
1151 if (m_hollowing_data)
1152 return get_mesh_to_print();
1153 [[fallthrough]];
1154 default:
1155 return TriangleMesh();
1156 }
1157}
const TriangleMesh & support_mesh() const
Definition SLAPrint.cpp:1159
std::unique_ptr< HollowingData > m_hollowing_data
Definition SLAPrint.hpp:371
const TriangleMesh & get_mesh_to_print() const
Definition SLAPrint.hpp:107
const TriangleMesh & pad_mesh() const
Definition SLAPrint.cpp:1167
@ slaposDrillHoles
Definition SLAPrint.hpp:44

References get_mesh_to_print(), m_hollowing_data, pad_mesh(), Slic3r::slaposDrillHoles, Slic3r::slaposPad, Slic3r::slaposSupportTree, and support_mesh().

Referenced by Slic3r::GLVolumeCollection::load_object_auxiliary().

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

◆ get_mesh_to_print()

const TriangleMesh & Slic3r::SLAPrintObject::get_mesh_to_print ( ) const
inline
107 {
108 return (m_hollowing_data && is_step_done(slaposDrillHoles)) ? m_hollowing_data->hollow_mesh_with_holes_trimmed : transformed_mesh();
109 }
const TriangleMesh & transformed_mesh() const
Definition SLAPrint.cpp:1184

References Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, slaposCount >::is_step_done(), m_hollowing_data, Slic3r::slaposDrillHoles, and transformed_mesh().

Referenced by Slic3r::GUI::Plater::export_stl(), get_mesh(), Slic3r::SLAPrint::Steps::slice_model(), and Slic3r::SLAPrint::Steps::support_points().

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

◆ get_mesh_to_slice()

const TriangleMesh & Slic3r::SLAPrintObject::get_mesh_to_slice ( ) const
inline
111 {
112 return (m_hollowing_data && is_step_done(slaposDrillHoles)) ? m_hollowing_data->hollow_mesh_with_holes : transformed_mesh();
113 }

References Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, slaposCount >::is_step_done(), m_hollowing_data, Slic3r::slaposDrillHoles, and transformed_mesh().

Referenced by Slic3r::SLAPrint::Steps::slice_model().

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

◆ get_model_slices()

const std::vector< ExPolygons > & Slic3r::SLAPrintObject::get_model_slices ( ) const
inlineprivate
241{ return m_model_slices; }
std::vector< ExPolygons > m_model_slices
Definition SLAPrint.hpp:321

References m_model_slices.

Referenced by Slic3r::SLAPrint::Steps::support_points().

Here is the caller graph for this function:

◆ get_slice_index()

const std::vector< SliceRecord > & Slic3r::SLAPrintObject::get_slice_index ( ) const
inline
256 {
257 return m_slice_index;
258 }

References m_slice_index.

Referenced by Slic3r::GUI::GLCanvas3D::_render_sla_slices(), and Slic3r::SLAPrint::Steps::initialize_printer_input().

Here is the caller graph for this function:

◆ get_support_points()

const std::vector< sla::SupportPoint > & Slic3r::SLAPrintObject::get_support_points ( ) const
1106{
1108}
std::unique_ptr< SupportData > m_supportdata
Definition SLAPrint.hpp:360
const std::vector< sla::SupportPoint > EMPTY_SUPPORT_POINTS
Definition SLAPrint.cpp:1100

References m_supportdata.

◆ get_support_slices()

const std::vector< ExPolygons > & Slic3r::SLAPrintObject::get_support_slices ( ) const
private
1111{
1112 // assert(is_step_done(slaposSliceSupports));
1113 if (!m_supportdata) return EMPTY_SLICES;
1114 return m_supportdata->support_slices;
1115}
const std::vector< ExPolygons > EMPTY_SLICES
Definition SLAPrint.cpp:1096

References m_supportdata.

◆ has_mesh()

bool Slic3r::SLAPrintObject::has_mesh ( SLAPrintObjectStep step) const
1130{
1131 switch (step) {
1132 case slaposDrillHoles:
1133 return m_hollowing_data && !m_hollowing_data->hollow_mesh_with_holes.empty();
1134 case slaposSupportTree:
1135 return ! this->support_mesh().empty();
1136 case slaposPad:
1137 return ! this->pad_mesh().empty();
1138 default:
1139 return false;
1140 }
1141}
bool empty() const
Definition TriangleMesh.hpp:146

References Slic3r::TriangleMesh::empty(), m_hollowing_data, pad_mesh(), Slic3r::slaposDrillHoles, Slic3r::slaposPad, Slic3r::slaposSupportTree, and support_mesh().

Here is the call graph for this function:

◆ hollowed_interior_mesh()

const indexed_triangle_set & Slic3r::SLAPrintObject::hollowed_interior_mesh ( ) const
1176{
1177 if (m_hollowing_data && m_hollowing_data->interior &&
1178 m_config.hollowing_enable.getBool())
1179 return sla::get_mesh(*m_hollowing_data->interior);
1180
1181 return EMPTY_TRIANGLE_SET;
1182}
const indexed_triangle_set EMPTY_TRIANGLE_SET
Definition SLAPrint.cpp:1098
indexed_triangle_set & get_mesh(Interior &interior)
Definition Hollowing.cpp:69

References Slic3r::sla::get_mesh(), m_config, and m_hollowing_data.

Here is the call graph for this function:

◆ id()

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

Referenced by Slic3r::SLAPrintObject::SliceRecord::set_model_slice_idx(), and Slic3r::SLAPrintObject::SliceRecord::set_support_slice_idx().

Here is the caller graph for this function:

◆ instances()

const std::vector< Instance > & Slic3r::SLAPrintObject::instances ( ) const
inline
90{ return m_instances; }
std::vector< Instance > m_instances
Definition SLAPrint.hpp:318

References m_instances.

Referenced by Slic3r::GUI::GLCanvas3D::_render_sla_slices(), Slic3r::get_all_polygons(), and set_instances().

Here is the caller graph for this function:

◆ invalidate_all_steps()

bool Slic3r::SLAPrintObject::invalidate_all_steps ( )
protected
1035{
1036 const bool inherited_invalidated = Inherited::invalidate_all_steps();
1037 const bool print_invalidated = m_print->invalidate_all_steps();
1038 return inherited_invalidated || print_invalidated;
1039}

References Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, slaposCount >::invalidate_all_steps(), and Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, slaposCount >::m_print.

Referenced by invalidate_step().

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

◆ invalidate_all_steps_without_cancel()

bool Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, COUNT >::invalidate_all_steps_without_cancel ( )
inlineprotectedinherited
667 { return m_state.invalidate_all([](){}); }

◆ invalidate_state_by_config_options()

bool Slic3r::SLAPrintObject::invalidate_state_by_config_options ( const std::vector< t_config_option_key > & opt_keys)
protected
938{
939 if (opt_keys.empty())
940 return false;
941
942 std::vector<SLAPrintObjectStep> steps;
943 bool invalidated = false;
944 for (const t_config_option_key &opt_key : opt_keys) {
945 if ( opt_key == "hollowing_enable"
946 || opt_key == "hollowing_min_thickness"
947 || opt_key == "hollowing_quality"
948 || opt_key == "hollowing_closing_distance"
949 ) {
950 steps.emplace_back(slaposHollowing);
951 } else if (
952 opt_key == "layer_height"
953 || opt_key == "faded_layers"
954 || opt_key == "pad_enable"
955 || opt_key == "pad_wall_thickness"
956 || opt_key == "supports_enable"
957 || opt_key == "support_object_elevation"
958 || opt_key == "pad_around_object"
959 || opt_key == "pad_around_object_everywhere"
960 || opt_key == "slice_closing_radius") {
961 steps.emplace_back(slaposObjectSlice);
962 } else if (
963 opt_key == "support_points_density_relative"
964 || opt_key == "support_points_minimal_distance") {
965 steps.emplace_back(slaposSupportPoints);
966 } else if (
967 opt_key == "support_head_front_diameter"
968 || opt_key == "support_head_penetration"
969 || opt_key == "support_head_width"
970 || opt_key == "support_pillar_diameter"
971 || opt_key == "support_small_pillar_diameter_percent"
972 || opt_key == "support_max_bridges_on_pillar"
973 || opt_key == "support_pillar_connection_mode"
974 || opt_key == "support_buildplate_only"
975 || opt_key == "support_base_diameter"
976 || opt_key == "support_base_height"
977 || opt_key == "support_critical_angle"
978 || opt_key == "support_max_bridge_length"
979 || opt_key == "support_max_pillar_link_distance"
980 || opt_key == "support_base_safety_distance"
981 ) {
982 steps.emplace_back(slaposSupportTree);
983 } else if (
984 opt_key == "pad_wall_height"
985 || opt_key == "pad_brim_size"
986 || opt_key == "pad_max_merge_distance"
987 || opt_key == "pad_wall_slope"
988 || opt_key == "pad_edge_radius"
989 || opt_key == "pad_object_gap"
990 || opt_key == "pad_object_connector_stride"
991 || opt_key == "pad_object_connector_width"
992 || opt_key == "pad_object_connector_penetration"
993 ) {
994 steps.emplace_back(slaposPad);
995 } else {
996 // All keys should be covered.
997 assert(false);
998 }
999 }
1000
1002 for (SLAPrintObjectStep step : steps)
1003 invalidated |= this->invalidate_step(step);
1004 return invalidated;
1005}
bool invalidate_step(SLAPrintObjectStep step)
Definition SLAPrint.cpp:1007
std::string t_config_option_key
Definition Config.hpp:96
SLAPrintObjectStep
Definition SLAPrint.hpp:42
@ slaposObjectSlice
Definition SLAPrint.hpp:45
@ slaposHollowing
Definition SLAPrint.hpp:43
@ slaposSupportPoints
Definition SLAPrint.hpp:46
void sort_remove_duplicates(std::vector< T > &vec)
Definition libslic3r.h:231

References invalidate_step(), Slic3r::slaposHollowing, Slic3r::slaposObjectSlice, Slic3r::slaposPad, Slic3r::slaposSupportPoints, Slic3r::slaposSupportTree, and Slic3r::sort_remove_duplicates().

Here is the call graph for this function:

◆ invalidate_step()

bool Slic3r::SLAPrintObject::invalidate_step ( SLAPrintObjectStep step)
protected
1008{
1009 bool invalidated = Inherited::invalidate_step(step);
1010 // propagate to dependent steps
1011 if (step == slaposHollowing) {
1012 invalidated |= this->invalidate_all_steps();
1013 } else if (step == slaposDrillHoles) {
1015 invalidated |= m_print->invalidate_step(slapsMergeSlicesAndEval);
1016 } else if (step == slaposObjectSlice) {
1018 invalidated |= m_print->invalidate_step(slapsMergeSlicesAndEval);
1019 } else if (step == slaposSupportPoints) {
1021 invalidated |= m_print->invalidate_step(slapsMergeSlicesAndEval);
1022 } else if (step == slaposSupportTree) {
1023 invalidated |= this->invalidate_steps({ slaposPad, slaposSliceSupports });
1024 invalidated |= m_print->invalidate_step(slapsMergeSlicesAndEval);
1025 } else if (step == slaposPad) {
1026 invalidated |= this->invalidate_steps({slaposSliceSupports});
1027 invalidated |= m_print->invalidate_step(slapsMergeSlicesAndEval);
1028 } else if (step == slaposSliceSupports) {
1029 invalidated |= m_print->invalidate_step(slapsMergeSlicesAndEval);
1030 }
1031 return invalidated;
1032}
bool invalidate_step(SLAPrintObjectStep step)
Definition PrintBase.hpp:657
bool invalidate_steps(StepTypeIterator step_begin, StepTypeIterator step_end)
Definition PrintBase.hpp:660
bool invalidate_all_steps()
Definition SLAPrint.cpp:1034
@ slaposSliceSupports
Definition SLAPrint.hpp:49
@ slapsMergeSlicesAndEval
Definition SLAPrint.hpp:37

References invalidate_all_steps(), Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, slaposCount >::invalidate_step(), Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, slaposCount >::invalidate_steps(), Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, slaposCount >::m_print, Slic3r::slaposDrillHoles, Slic3r::slaposHollowing, Slic3r::slaposObjectSlice, Slic3r::slaposPad, Slic3r::slaposSliceSupports, Slic3r::slaposSupportPoints, Slic3r::slaposSupportTree, and Slic3r::slapsMergeSlicesAndEval.

Referenced by invalidate_state_by_config_options().

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

◆ invalidate_steps() [1/2]

bool Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, COUNT >::invalidate_steps ( std::initializer_list< SLAPrintObjectStep > il)
inlineprotectedinherited
663 { return m_state.invalidate_multiple(il.begin(), il.end(), PrintObjectBase::cancel_callback(m_print)); }

◆ invalidate_steps() [2/2]

bool Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, COUNT >::invalidate_steps ( StepTypeIterator step_begin,
StepTypeIterator step_end )
inlineprotectedinherited
661 { return m_state.invalidate_multiple(step_begin, step_end, PrintObjectBase::cancel_callback(m_print)); }

Referenced by Slic3r::SLAPrintObject::invalidate_step().

Here is the caller graph for this function:

◆ is_left_handed()

bool Slic3r::SLAPrintObject::is_left_handed ( ) const
inline
78{ return m_left_handed; }
bool m_left_handed
Definition SLAPrint.hpp:316

References m_left_handed.

Referenced by Slic3r::GUI::GLCanvas3D::_render_sla_slices(), and Slic3r::get_all_polygons().

Here is the caller graph for this function:

◆ is_step_done()

bool Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, COUNT >::is_step_done ( SLAPrintObjectStep step) const
inlineinherited

Referenced by Slic3r::SLAPrintObject::get_current_elevation(), Slic3r::SLAPrintObject::get_mesh_to_print(), and Slic3r::SLAPrintObject::get_mesh_to_slice().

Here is the caller graph for this function:

◆ is_step_done_unguarded()

bool Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, COUNT >::is_step_done_unguarded ( SLAPrintObjectStep step) const
inlineprotectedinherited
670{ return m_state.is_done_unguarded(step); }

◆ is_step_started_unguarded()

bool Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, COUNT >::is_step_started_unguarded ( SLAPrintObjectStep step) const
inlineprotectedinherited
669{ return m_state.is_started_unguarded(step); }

◆ level()

template<class T>
T Slic3r::SLAPrintObject::level ( const SliceRecord & sr)
inlinestaticprivate
188 {
189 static_assert(std::is_arithmetic<T>::value, "Arithmetic only!");
190 return std::is_integral<T>::value ? T(sr.print_level())
191 : T(sr.slice_level());
192 }

References Slic3r::SLAPrintObject::SliceRecord::print_level(), and Slic3r::SLAPrintObject::SliceRecord::slice_level().

Referenced by closest_slice_record().

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

◆ load_and_construct()

void Slic3r::ObjectBase::load_and_construct ( Archive & ar,
cereal::construct< ObjectBase > & construct )
inlinestaticprivateinherited
109{ ObjectID id; ar(id); construct(id); }

◆ model_object() [1/2]

◆ model_object() [2/2]

const ModelObject * Slic3r::PrintObjectBase::model_object ( ) const
inlineinherited
346{ return m_model_object; }

Referenced by Slic3r::SLAPrintObject::SLAPrintObject(), and Slic3r::SLAPrintObject::SLAPrint.

Here is the caller graph for this function:

◆ operator=()

SLAPrintObject & Slic3r::SLAPrintObject::operator= ( const SLAPrintObject & )
delete

References SLAPrintObject().

Here is the call graph for this function:

◆ pad_mesh()

const TriangleMesh & Slic3r::SLAPrintObject::pad_mesh ( ) const
1168{
1169 if(m_config.pad_enable.getBool() && m_supportdata)
1170 return m_supportdata->pad_mesh;
1171
1172 return EMPTY_MESH;
1173}
const TriangleMesh EMPTY_MESH
Definition SLAPrint.cpp:1097

References m_config, and m_supportdata.

Referenced by get_mesh(), and has_mesh().

Here is the caller graph for this function:

◆ print() [1/2]

SLAPrint * Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, COUNT >::print ( )
inlineinherited
637{ return m_print; }

Referenced by Slic3r::SLAPrintObject::SLAPrintObject(), and Slic3r::SLAPrintObject::SLAPrint.

Here is the caller graph for this function:

◆ print() [2/2]

const SLAPrint * Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, COUNT >::print ( ) const
inlineinherited
638{ return m_print; }

◆ serialize()

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

◆ set_done()

650 {
652 if (status.second)
654 return status.first;
655 }
PrintStateBase::TimeStamp set_done(PrintObjectStepEnum step)
Definition PrintBase.hpp:650

◆ set_instances()

template<class InstVec>
void Slic3r::SLAPrintObject::set_instances ( InstVec && instances)
inlineprotected
297{ m_instances = std::forward<InstVec>(instances); }
const std::vector< Instance > & instances() const
Definition SLAPrint.hpp:90

References instances(), and m_instances.

Here is the call graph for this function:

◆ set_invalid_id()

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

◆ set_new_unique_id()

void Slic3r::ObjectBase::set_new_unique_id ( )
inlineprotectedinherited

◆ set_started()

bool Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, COUNT >::set_started ( SLAPrintObjectStep step)
inlineprotectedinherited
bool set_started(PrintObjectStepEnum step)
Definition PrintBase.hpp:648

◆ set_trafo()

void Slic3r::SLAPrintObject::set_trafo ( const Transform3d & trafo,
bool left_handed )
inlineprotected
293 {
294 m_transformed_rmesh.invalidate([this, &trafo, left_handed](){ m_trafo = trafo; m_left_handed = left_handed; });
295 }
const Transform3d & trafo() const
Definition SLAPrint.hpp:77

References m_left_handed, m_trafo, m_transformed_rmesh, and trafo().

Here is the call graph for this function:

◆ state_mutex()

std::mutex & Slic3r::PrintObjectBase::state_mutex ( PrintBase * print)
staticprotectedinherited
156{
157 return print->state_mutex();
158}
static std::mutex & state_mutex(PrintBase *print)
Definition PrintBase.cpp:155

◆ status_update_warnings()

◆ step_state_with_timestamp()

PrintStateBase::StateWithTimeStamp Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, COUNT >::step_state_with_timestamp ( SLAPrintObjectStep step) const
inlineinherited
642{ return m_state.state_with_timestamp(step, PrintObjectBase::state_mutex(m_print)); }

◆ step_state_with_warnings()

PrintStateBase::StateWithWarnings Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, COUNT >::step_state_with_warnings ( SLAPrintObjectStep step) const
inlineinherited
643{ return m_state.state_with_warnings(step, PrintObjectBase::state_mutex(m_print)); }

◆ support_mesh()

const TriangleMesh & Slic3r::SLAPrintObject::support_mesh ( ) const
1160{
1161 if(m_config.supports_enable.getBool() && m_supportdata)
1162 return m_supportdata->tree_mesh;
1163
1164 return EMPTY_MESH;
1165}

References m_config, and m_supportdata.

Referenced by get_mesh(), has_mesh(), and Slic3r::SLAPrint::Steps::support_tree().

Here is the caller graph for this function:

◆ throw_if_canceled()

void Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, COUNT >::throw_if_canceled ( )
inlineprotectedinherited
684{ if (m_print->canceled()) throw CanceledException(); }

◆ timestamp()

virtual Timestamp Slic3r::ObjectBase::timestamp ( ) const
inlinevirtualinherited
74{ return 0; }

◆ trafo()

const Transform3d & Slic3r::SLAPrintObject::trafo ( ) const
inline
77{ return m_trafo; }

References m_trafo.

Referenced by Slic3r::SLAPrint::apply(), Slic3r::GLVolumeCollection::load_object_auxiliary(), set_trafo(), transformed_drainhole_points(), and transformed_support_points().

Here is the caller graph for this function:

◆ transformed_drainhole_points()

sla::DrainHoles Slic3r::SLAPrintObject::transformed_drainhole_points ( ) const
1210{
1211 assert(m_model_object != nullptr);
1212 auto pts = m_model_object->sla_drain_holes;
1213 auto tr = trafo().cast<float>();
1214 auto sc = m_model_object->instances.front()->get_scaling_factor().cast<float>();
1215 for (sla::DrainHole &hl : pts) {
1216 hl.pos = tr * hl.pos;
1217 hl.normal = tr * hl.normal - tr.translation();
1218
1219 // The normal scales as a covector (and we must also
1220 // undo the damage already done).
1221 hl.normal = Vec3f(hl.normal(0)/(sc(0)*sc(0)),
1222 hl.normal(1)/(sc(1)*sc(1)),
1223 hl.normal(2)/(sc(2)*sc(2)));
1224
1225 // Now shift the hole a bit above the object and make it deeper to
1226 // compensate for it. This is to avoid problems when the hole is placed
1227 // on (nearly) flat surface.
1228 hl.pos -= hl.normal.normalized() * sla::HoleStickOutLength;
1229 hl.height += sla::HoleStickOutLength;
1230 }
1231
1232 return pts;
1233}
constexpr float HoleStickOutLength
Definition Hollowing.hpp:76
Eigen::Matrix< float, 3, 1, Eigen::DontAlign > Vec3f
Definition Point.hpp:65

References Slic3r::sla::HoleStickOutLength, Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, slaposCount >::m_model_object, and trafo().

Here is the call graph for this function:

◆ transformed_mesh()

const TriangleMesh & Slic3r::SLAPrintObject::transformed_mesh ( ) const
1184 {
1185 // we need to transform the raw mesh...
1186 // currently all the instances share the same x and y rotation and scaling
1187 // so we have to extract those from e.g. the first instance and apply to the
1188 // raw mesh. This is also true for the support points.
1189 // BUT: when the support structure is spawned for each instance than it has
1190 // to omit the X, Y rotation and scaling as those have been already applied
1191 // or apply an inverse transformation on the support structure after it
1192 // has been created.
1193
1194 return m_transformed_rmesh.get();
1195}

References m_transformed_rmesh.

Referenced by Slic3r::SLAPrint::Steps::generate_pad(), get_mesh_to_print(), get_mesh_to_slice(), and Slic3r::SLAPrint::Steps::hollow_model().

Here is the caller graph for this function:

◆ transformed_support_points()

sla::SupportPoints Slic3r::SLAPrintObject::transformed_support_points ( ) const
1198{
1199 assert(m_model_object != nullptr);
1200 auto spts = m_model_object->sla_support_points;
1201 auto tr = trafo().cast<float>();
1202 for (sla::SupportPoint& suppt : spts) {
1203 suppt.pos = tr * suppt.pos;
1204 }
1205
1206 return spts;
1207}

References Slic3r::PrintObjectBaseWithState< SLAPrint, SLAPrintObjectStep, slaposCount >::m_model_object, and trafo().

Referenced by Slic3r::SLAPrint::Steps::support_points().

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

◆ SLAPrint

Member Data Documentation

◆ m_config

◆ m_hollowing_data

◆ m_id

◆ m_instances

std::vector<Instance> Slic3r::SLAPrintObject::m_instances
private

Referenced by instances(), and set_instances().

◆ m_left_handed

bool Slic3r::SLAPrintObject::m_left_handed = false
private

Referenced by is_left_handed(), and set_trafo().

◆ m_model_height_levels

std::vector<float> Slic3r::SLAPrintObject::m_model_height_levels
private

◆ m_model_object

◆ m_model_slices

std::vector<ExPolygons> Slic3r::SLAPrintObject::m_model_slices
private

◆ m_print

◆ m_slice_index

◆ m_state

◆ m_stepmask

std::vector<bool> Slic3r::SLAPrintObject::m_stepmask
protected

◆ m_supportdata

◆ m_trafo

Transform3d Slic3r::SLAPrintObject::m_trafo = Transform3d::Identity()
private

Referenced by set_trafo(), and trafo().

◆ m_transformed_rmesh

CachedObject<TriangleMesh> Slic3r::SLAPrintObject::m_transformed_rmesh
mutableprivate

◆ PrintType

◆ s_last_id

size_t Slic3r::ObjectBase::s_last_id
staticprivateinherited

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