From 0e6950ab2531a687f2d4225bce86b229499e9c20 Mon Sep 17 00:00:00 2001 From: supermerill Date: Mon, 1 Jun 2020 00:54:38 +0200 Subject: [PATCH] fix builds: renamed enum option adjust mac build list. --- .github/workflows/ccpp_mac.yml | 6 ---- src/PrusaSlicer.cpp | 2 +- src/libslic3r/Model.cpp | 2 ++ src/libslic3r/Print.cpp | 52 +++++++++++++++++----------------- src/libslic3r/PrintBase.hpp | 4 +-- src/libslic3r/SLAPrint.cpp | 14 ++++----- src/slic3r/GUI/Plater.cpp | 4 +-- 7 files changed, 40 insertions(+), 44 deletions(-) diff --git a/.github/workflows/ccpp_mac.yml b/.github/workflows/ccpp_mac.yml index 34b776b92..75b803454 100644 --- a/.github/workflows/ccpp_mac.yml +++ b/.github/workflows/ccpp_mac.yml @@ -96,12 +96,6 @@ jobs: cp -f src/superslicer SuperSlicer/SuperSlicer.app/Contents/MacOS/superslicer chmod u+x SuperSlicer/SuperSlicer.app/Contents/MacOS/superslicer tar -cvf SuperSlicer.tar SuperSlicer -# just to see what's inside. to remove - - name: Upload artifact - uses: actions/upload-artifact@v1.0.0 - with: - name: build_folder - path: build - name: create dmg working-directory: ./build run: | diff --git a/src/PrusaSlicer.cpp b/src/PrusaSlicer.cpp index 0beb2df68..cfd2ebbe8 100644 --- a/src/PrusaSlicer.cpp +++ b/src/PrusaSlicer.cpp @@ -428,7 +428,7 @@ int CLI::run(int argc, char **argv) } print->apply(model, m_print_config); std::pair err = print->validate(); - if (err.first != PrintBase::PrintValidationError::None) { + if (err.first != PrintBase::PrintValidationError::pveNone) { boost::nowide::cerr << err.second << std::endl; return 1; } diff --git a/src/libslic3r/Model.cpp b/src/libslic3r/Model.cpp index 7c4327d93..5ca6a9947 100644 --- a/src/libslic3r/Model.cpp +++ b/src/libslic3r/Model.cpp @@ -1,5 +1,7 @@ #include "Model.hpp" #include "Geometry.hpp" +#include "Polygon.hpp" +#include "ClipperUtils.hpp" #include "Print.hpp" #include "MTUtils.hpp" diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 6b3e66735..1b01238c1 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1280,16 +1280,16 @@ static inline bool sequential_print_vertical_clearance_valid(const Print &print) std::pair Print::validate() const { if (m_objects.empty()) - return { PrintBase::PrintValidationError::WrongPosition, L("All objects are outside of the print volume.") }; + return { PrintBase::PrintValidationError::pveWrongPosition, L("All objects are outside of the print volume.") }; if (extruders().empty()) - return { PrintBase::PrintValidationError::NoPrint, L("The supplied settings will cause an empty print.") }; + return { PrintBase::PrintValidationError::pveNoPrint, L("The supplied settings will cause an empty print.") }; if (m_config.complete_objects) { if (! sequential_print_horizontal_clearance_valid(*this)) - return { PrintBase::PrintValidationError::WrongPosition, L("Some objects are too close; your extruder will collide with them.") }; + return { PrintBase::PrintValidationError::pveWrongPosition, L("Some objects are too close; your extruder will collide with them.") }; if (! sequential_print_vertical_clearance_valid(*this)) - return { PrintBase::PrintValidationError::WrongPosition,L("Some objects are too tall and cannot be printed without extruder collisions.") }; + return { PrintBase::PrintValidationError::pveWrongPosition,L("Some objects are too tall and cannot be printed without extruder collisions.") }; } if (m_config.spiral_vase) { @@ -1298,14 +1298,14 @@ std::pair Print::validate() const total_copies_count += object->instances().size(); // #4043 if (total_copies_count > 1 && ! m_config.complete_objects.value) - return { PrintBase::PrintValidationError::WrongSettings,L("The Spiral Vase option can only be used when printing a single object.") }; + return { PrintBase::PrintValidationError::pveWrongSettings,L("The Spiral Vase option can only be used when printing a single object.") }; assert(m_objects.size() == 1 || config().complete_objects.value); size_t num_regions = 0; for (const std::vector> &volumes_per_region : m_objects.front()->region_volumes) if (! volumes_per_region.empty()) ++ num_regions; if (num_regions > 1) - return { PrintBase::PrintValidationError::WrongSettings,L("The Spiral Vase option can only be used when printing single material objects.") }; + return { PrintBase::PrintValidationError::pveWrongSettings,L("The Spiral Vase option can only be used when printing single material objects.") }; } if (this->has_wipe_tower() && ! m_objects.empty()) { @@ -1318,21 +1318,21 @@ std::pair Print::validate() const double filament_diam = m_config.filament_diameter.get_at(extruder_idx); if (nozzle_diam - EPSILON > first_nozzle_diam || nozzle_diam + EPSILON < first_nozzle_diam || std::abs((filament_diam-first_filament_diam)/first_filament_diam) > 0.1) - return { PrintBase::PrintValidationError::WrongSettings,L("The wipe tower is only supported if all extruders have the same nozzle diameter " + return { PrintBase::PrintValidationError::pveWrongSettings,L("The wipe tower is only supported if all extruders have the same nozzle diameter " "and use filaments of the same diameter.") }; } if (m_config.gcode_flavor != gcfRepRap && m_config.gcode_flavor != gcfRepetier && m_config.gcode_flavor != gcfMarlin && m_config.gcode_flavor != gcfKlipper) - return { PrintBase::PrintValidationError::WrongSettings,L("The Wipe Tower is currently only supported for the Marlin, RepRap/Sprinter and Repetier G-code flavors.") }; + return { PrintBase::PrintValidationError::pveWrongSettings,L("The Wipe Tower is currently only supported for the Marlin, RepRap/Sprinter and Repetier G-code flavors.") }; if (! m_config.use_relative_e_distances) - return { PrintBase::PrintValidationError::WrongSettings,L("The Wipe Tower is currently only supported with the relative extruder addressing (use_relative_e_distances=1).") }; + return { PrintBase::PrintValidationError::pveWrongSettings,L("The Wipe Tower is currently only supported with the relative extruder addressing (use_relative_e_distances=1).") }; if (m_config.ooze_prevention) - return { PrintBase::PrintValidationError::WrongSettings,L("Ooze prevention is currently not supported with the wipe tower enabled.") }; + return { PrintBase::PrintValidationError::pveWrongSettings,L("Ooze prevention is currently not supported with the wipe tower enabled.") }; if (m_config.use_volumetric_e) - return { PrintBase::PrintValidationError::WrongSettings,L("The Wipe Tower currently does not support volumetric E (use_volumetric_e=0).") }; + return { PrintBase::PrintValidationError::pveWrongSettings,L("The Wipe Tower currently does not support volumetric E (use_volumetric_e=0).") }; if (m_config.complete_objects && extruders().size() > 1) - return { PrintBase::PrintValidationError::WrongSettings,L("The Wipe Tower is currently not supported for multimaterial sequential prints.") }; + return { PrintBase::PrintValidationError::pveWrongSettings,L("The Wipe Tower is currently not supported for multimaterial sequential prints.") }; if (m_objects.size() > 1) { bool has_custom_layering = false; @@ -1353,15 +1353,15 @@ std::pair Print::validate() const const SlicingParameters &slicing_params = object->slicing_parameters(); if (std::abs(slicing_params.first_print_layer_height - slicing_params0.first_print_layer_height) > EPSILON || std::abs(slicing_params.layer_height - slicing_params0.layer_height ) > EPSILON) - return { PrintBase::PrintValidationError::WrongSettings,L("The Wipe Tower is only supported for multiple objects if they have equal layer heights") }; + return { PrintBase::PrintValidationError::pveWrongSettings,L("The Wipe Tower is only supported for multiple objects if they have equal layer heights") }; if (slicing_params.raft_layers() != slicing_params0.raft_layers()) - return { PrintBase::PrintValidationError::WrongSettings,L("The Wipe Tower is only supported for multiple objects if they are printed over an equal number of raft layers") }; + return { PrintBase::PrintValidationError::pveWrongSettings,L("The Wipe Tower is only supported for multiple objects if they are printed over an equal number of raft layers") }; if (object->config().support_material_contact_distance_type != m_objects.front()->config().support_material_contact_distance_type || object->config().support_material_contact_distance_top != m_objects.front()->config().support_material_contact_distance_top || object->config().support_material_contact_distance_bottom != m_objects.front()->config().support_material_contact_distance_bottom) - return { PrintBase::PrintValidationError::WrongSettings,L("The Wipe Tower is only supported for multiple objects if they are printed with the same support_material_contact_distance") }; + return { PrintBase::PrintValidationError::pveWrongSettings,L("The Wipe Tower is only supported for multiple objects if they are printed with the same support_material_contact_distance") }; if (! equal_layering(slicing_params, slicing_params0)) - return { PrintBase::PrintValidationError::WrongSettings,L("The Wipe Tower is only supported for multiple objects if they are sliced equally.") }; + return { PrintBase::PrintValidationError::pveWrongSettings,L("The Wipe Tower is only supported for multiple objects if they are sliced equally.") }; if (has_custom_layering) { PrintObject::update_layer_height_profile(*object->model_object(), slicing_params, layer_height_profiles[i]); if (*(layer_height_profiles[i].end()-2) > *(layer_height_profiles[tallest_object_idx].end()-2)) @@ -1403,7 +1403,7 @@ std::pair Print::validate() const } while (ref_z == next_ref_z); } if (std::abs(this_height - ref_height) > EPSILON) - return { PrintBase::PrintValidationError::WrongSettings,L("The Wipe tower is only supported if all objects have the same variable layer height") }; + return { PrintBase::PrintValidationError::pveWrongSettings,L("The Wipe tower is only supported if all objects have the same variable layer height") }; i += 2; } } @@ -1452,7 +1452,7 @@ std::pair Print::validate() const // The object has some form of support and either support_material_extruder or support_material_interface_extruder // will be printed with the current tool without a forced tool change. Play safe, assert that all object nozzles // are of the same diameter. - return { PrintBase::PrintValidationError::WrongSettings,L("Printing with multiple extruders of differing nozzle diameters. " + return { PrintBase::PrintValidationError::pveWrongSettings,L("Printing with multiple extruders of differing nozzle diameters. " "If support is to be printed with the current extruder (support_material_extruder == 0 or support_material_interface_extruder == 0), " "all nozzles have to be of the same diameter.") }; } @@ -1460,11 +1460,11 @@ std::pair Print::validate() const if (object->config().support_material_contact_distance_type == zdNone) { // Soluble interface if (! object->config().support_material_synchronize_layers) - return { PrintBase::PrintValidationError::WrongSettings,L("For the Wipe Tower to work with the soluble supports, the support layers need to be synchronized with the object layers.") }; + return { PrintBase::PrintValidationError::pveWrongSettings,L("For the Wipe Tower to work with the soluble supports, the support layers need to be synchronized with the object layers.") }; } else { // Non-soluble interface if (object->config().support_material_extruder != 0 || object->config().support_material_interface_extruder != 0) - return { PrintBase::PrintValidationError::WrongSettings,L("The Wipe Tower currently supports the non-soluble supports only if they are printed with the current extruder without triggering a tool change. " + return { PrintBase::PrintValidationError::pveWrongSettings,L("The Wipe Tower currently supports the non-soluble supports only if they are printed with the current extruder without triggering a tool change. " "(both support_material_extruder and support_material_interface_extruder need to be set to 0).") }; } } @@ -1486,27 +1486,27 @@ std::pair Print::validate() const first_layer_min_nozzle_diameter = min_nozzle_diameter; } if (first_layer_height > first_layer_min_nozzle_diameter) - return { PrintBase::PrintValidationError::WrongSettings,L("First layer height can't be greater than nozzle diameter") }; + return { PrintBase::PrintValidationError::pveWrongSettings,L("First layer height can't be greater than nozzle diameter") }; // validate layer_height double layer_height = object->config().layer_height.value; if (layer_height > min_nozzle_diameter) - return { PrintBase::PrintValidationError::WrongSettings,L("Layer height can't be greater than nozzle diameter") }; + return { PrintBase::PrintValidationError::pveWrongSettings,L("Layer height can't be greater than nozzle diameter") }; // Validate extrusion widths. std::string err_msg; if (! validate_extrusion_width(object->config(), "extrusion_width", layer_height, err_msg)) - return { PrintBase::PrintValidationError::WrongSettings,err_msg }; + return { PrintBase::PrintValidationError::pveWrongSettings,err_msg }; if ((object->config().support_material || object->config().raft_layers > 0) && ! validate_extrusion_width(object->config(), "support_material_extrusion_width", layer_height, err_msg)) - return { PrintBase::PrintValidationError::WrongSettings,err_msg }; + return { PrintBase::PrintValidationError::pveWrongSettings,err_msg }; for (const char *opt_key : { "perimeter_extrusion_width", "external_perimeter_extrusion_width", "infill_extrusion_width", "solid_infill_extrusion_width", "top_infill_extrusion_width" }) for (size_t i = 0; i < object->region_volumes.size(); ++ i) if (! object->region_volumes[i].empty() && ! validate_extrusion_width(this->get_region(i)->config(), opt_key, layer_height, err_msg)) - return { PrintBase::PrintValidationError::WrongSettings, err_msg }; + return { PrintBase::PrintValidationError::pveWrongSettings, err_msg }; } } - return { PrintValidationError::None, std::string() }; + return { PrintValidationError::pveNone, std::string() }; } #if 0 diff --git a/src/libslic3r/PrintBase.hpp b/src/libslic3r/PrintBase.hpp index e2220bcf1..c91fb0c07 100644 --- a/src/libslic3r/PrintBase.hpp +++ b/src/libslic3r/PrintBase.hpp @@ -229,10 +229,10 @@ public: // or after apply() over a model, where no object is printable (all outside the print volume). virtual bool empty() const = 0; - enum class PrintValidationError {None,WrongPosition,NoPrint,WrongSettings}; + enum PrintValidationError {pveNone, pveWrongPosition, pveNoPrint, pveWrongSettings}; // Validate the print, return empty string if valid, return error if process() cannot (or should not) be started. - virtual std::pair validate() const { return { PrintValidationError::None, std::string() }; } + virtual std::pair validate() const { return { PrintValidationError::pveNone, std::string() }; } enum ApplyStatus { // No change after the Print::apply() call. diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index bb50946df..565718c84 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -612,7 +612,7 @@ std::pair SLAPrint::validate() con if(supports_en && mo->sla_points_status == sla::PointsStatus::UserModified && mo->sla_support_points.empty()) - return { PrintBase::PrintValidationError::WrongSettings, L("Cannot proceed without support points! " + return { PrintBase::PrintValidationError::pveWrongSettings, L("Cannot proceed without support points! " "Add support points or disable support generation.") }; sla::SupportConfig cfg = make_support_cfg(po->config()); @@ -623,13 +623,13 @@ std::pair SLAPrint::validate() con sla::PadConfig::EmbedObject &builtinpad = padcfg.embed_object; if(supports_en && !builtinpad.enabled && elv < cfg.head_fullwidth()) - return { PrintBase::PrintValidationError::WrongSettings, L( + return { PrintBase::PrintValidationError::pveWrongSettings, L( "Elevation is too low for object. Use the \"Pad around " "object\" feature to print the object without elevation.") }; if(supports_en && builtinpad.enabled && cfg.pillar_base_safety_distance_mm < builtinpad.object_gap_mm) { - return { PrintBase::PrintValidationError::WrongSettings, L( + return { PrintBase::PrintValidationError::pveWrongSettings, L( "The endings of the support pillars will be deployed on the " "gap between the object and the pad. 'Support base safety " "distance' has to be greater than the 'Pad object gap' " @@ -637,7 +637,7 @@ std::pair SLAPrint::validate() con } std::string pval = padcfg.validate(); - if (!pval.empty()) return { PrintBase::PrintValidationError::WrongSettings, pval }; + if (!pval.empty()) return { PrintBase::PrintValidationError::pveWrongSettings, pval }; } double expt_max = m_printer_config.max_exposure_time.getFloat(); @@ -645,16 +645,16 @@ std::pair SLAPrint::validate() con double expt_cur = m_material_config.exposure_time.getFloat(); if (expt_cur < expt_min || expt_cur > expt_max) - return { PrintBase::PrintValidationError::WrongSettings, L("Exposition time is out of printer profile bounds.") }; + return { PrintBase::PrintValidationError::pveWrongSettings, L("Exposition time is out of printer profile bounds.") }; double iexpt_max = m_printer_config.max_initial_exposure_time.getFloat(); double iexpt_min = m_printer_config.min_initial_exposure_time.getFloat(); double iexpt_cur = m_material_config.initial_exposure_time.getFloat(); if (iexpt_cur < iexpt_min || iexpt_cur > iexpt_max) - return { PrintBase::PrintValidationError::WrongSettings, L("Initial exposition time is out of printer profile bounds.") }; + return { PrintBase::PrintValidationError::pveWrongSettings, L("Initial exposition time is out of printer profile bounds.") }; - return { PrintBase::PrintValidationError::None, "" }; + return { PrintBase::PrintValidationError::pveNone, "" }; } bool SLAPrint::invalidate_step(SLAPrintStep step) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index e2cfb0191..1cc2b317c 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3168,7 +3168,7 @@ unsigned int Plater::priv::update_background_process(bool force_validation, bool // The state of the Print changed, and it is non-zero. Let's validate it and give the user feedback on errors. std::pair err = this->background_process.validate(); this->get_current_canvas3D()->show_print_warning(""); - if (err.first == PrintBase::PrintValidationError::None) { + if (err.first == PrintBase::PrintValidationError::pveNone) { if (invalidated != Print::APPLY_STATUS_UNCHANGED && this->background_processing_enabled()) return_state |= UPDATE_BACKGROUND_PROCESS_RESTART; } else { @@ -3178,7 +3178,7 @@ unsigned int Plater::priv::update_background_process(bool force_validation, bool while (p->GetParent()) p = p->GetParent(); auto *top_level_wnd = dynamic_cast(p); - if ( (err.first == PrintBase::PrintValidationError::WrongPosition || err.first == PrintBase::PrintValidationError::NoPrint) && top_level_wnd && top_level_wnd->IsActive()) { + if ( (err.first == PrintBase::PrintValidationError::pveWrongPosition || err.first == PrintBase::PrintValidationError::pveNoPrint) && top_level_wnd && top_level_wnd->IsActive()) { this->get_current_canvas3D()->show_print_warning(err.second); } else if (!postpone_error_messages && top_level_wnd && top_level_wnd->IsActive()) { // The error returned from the Print needs to be translated into the local language.