Added cache for sequential printing clearance contours into class Print to avoid calculate them twice when needed.
-Fixed conflicts after cherry-picking 056d703573
This commit is contained in:
parent
a68e48b454
commit
77da892927
@ -469,11 +469,13 @@ std::string Print::validate(std::string* warning) const
|
|||||||
return _u8L("The supplied settings will cause an empty print.");
|
return _u8L("The supplied settings will cause an empty print.");
|
||||||
|
|
||||||
if (m_config.complete_objects) {
|
if (m_config.complete_objects) {
|
||||||
if (! sequential_print_horizontal_clearance_valid(*this))
|
if (!sequential_print_horizontal_clearance_valid(*this, const_cast<Polygons*>(&m_sequential_print_clearance_polygons)))
|
||||||
return _u8L("Some objects are too close; your extruder will collide with them.");
|
return _u8L("Some objects are too close; your extruder will collide with them.");
|
||||||
if (! sequential_print_vertical_clearance_valid(*this))
|
if (!sequential_print_vertical_clearance_valid(*this))
|
||||||
return _u8L("Some objects are too tall and cannot be printed without extruder collisions.");
|
return _u8L("Some objects are too tall and cannot be printed without extruder collisions.");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
const_cast<Polygons*>(&m_sequential_print_clearance_polygons)->clear();
|
||||||
|
|
||||||
if (m_config.avoid_crossing_perimeters && m_config.avoid_crossing_curled_overhangs) {
|
if (m_config.avoid_crossing_perimeters && m_config.avoid_crossing_curled_overhangs) {
|
||||||
return _u8L("Avoid crossing perimeters option and avoid crossing curled overhangs option cannot be both enabled together.");
|
return _u8L("Avoid crossing perimeters option and avoid crossing curled overhangs option cannot be both enabled together.");
|
||||||
|
@ -609,6 +609,7 @@ public:
|
|||||||
const PrintRegion& get_print_region(size_t idx) const { return *m_print_regions[idx]; }
|
const PrintRegion& get_print_region(size_t idx) const { return *m_print_regions[idx]; }
|
||||||
const ToolOrdering& get_tool_ordering() const { return m_wipe_tower_data.tool_ordering; }
|
const ToolOrdering& get_tool_ordering() const { return m_wipe_tower_data.tool_ordering; }
|
||||||
|
|
||||||
|
const Polygons& get_sequential_print_clearance_polygons() const { return m_sequential_print_clearance_polygons; }
|
||||||
static bool sequential_print_horizontal_clearance_valid(const Print& print, Polygons* polygons = nullptr);
|
static bool sequential_print_horizontal_clearance_valid(const Print& print, Polygons* polygons = nullptr);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -658,6 +659,9 @@ private:
|
|||||||
// Estimated print time, filament consumed.
|
// Estimated print time, filament consumed.
|
||||||
PrintStatistics m_print_statistics;
|
PrintStatistics m_print_statistics;
|
||||||
|
|
||||||
|
// Cache to store sequential print clearance polygons
|
||||||
|
Polygons m_sequential_print_clearance_polygons;
|
||||||
|
|
||||||
// To allow GCode to set the Print's GCodeExport step status.
|
// To allow GCode to set the Print's GCodeExport step status.
|
||||||
friend class GCode;
|
friend class GCode;
|
||||||
// To allow GCodeProcessor to emit warnings.
|
// To allow GCodeProcessor to emit warnings.
|
||||||
|
@ -3306,11 +3306,9 @@ unsigned int Plater::priv::update_background_process(bool force_validation, bool
|
|||||||
return_state |= UPDATE_BACKGROUND_PROCESS_INVALID;
|
return_state |= UPDATE_BACKGROUND_PROCESS_INVALID;
|
||||||
if (printer_technology == ptFFF) {
|
if (printer_technology == ptFFF) {
|
||||||
const Print* print = background_process.fff_print();
|
const Print* print = background_process.fff_print();
|
||||||
Polygons polygons;
|
const Polygons polygons = print->get_sequential_print_clearance_polygons();
|
||||||
if (print->config().complete_objects)
|
view3D->get_canvas3d()->set_sequential_print_clearance_visible(!polygons.empty());
|
||||||
Print::sequential_print_horizontal_clearance_valid(*print, &polygons);
|
view3D->get_canvas3d()->set_sequential_print_clearance_render_fill(!polygons.empty());
|
||||||
view3D->get_canvas3d()->set_sequential_print_clearance_visible(true);
|
|
||||||
view3D->get_canvas3d()->set_sequential_print_clearance_render_fill(true);
|
|
||||||
view3D->get_canvas3d()->set_sequential_print_clearance_polygons(polygons);
|
view3D->get_canvas3d()->set_sequential_print_clearance_polygons(polygons);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user