From b83e16dbddecc8cb80d7b58f82476c8aec825b11 Mon Sep 17 00:00:00 2001 From: Ocraftyone Date: Mon, 29 Jul 2024 09:00:26 -0400 Subject: [PATCH] Fix Compile Warnings (#5963) * Fix calls to depreciated wxPen constructor * Fix use of wxTimerEvent * Fix unrecognized character escape sequence * Fix signed/unsigned mismatch At least as much as possible without significantly altering parts of the application * Clean unreferenced variables * fix mistyped namespace selector * Update deprecated calls * Fix preprocessor statement * Remove empty switch statements * Change int vector used as bool to bool vector * Remove empty control statements and related unused code * Change multi character constant to string constant * Fix discarded return value json::parse was being called on the object, rather than statically like it should be. Also, the value was not being captured. * Rename ICON_SIZE def used by MultiMachine By having the definition in the header, it causes issues when other files define ICON_SIZE. By renaming it to MM_ICON_SIZE, this lessens the issue. It would probably be ideal to have the definitions in the respective .cpp that use them, but it would make it less convenient to update the values if needed in the future. * Remove unused includes * Fix linux/macOS compilation * Hide unused-function errors on non-Windows systems * Disable signed/unsigned comparison mismatch error * Remove/Disable more unused variables Still TODO: check double for loop in Print.cpp * Remove unused variable that was missed * Remove unused variables in libraries in the src folder * Apply temporary fix for subobject linkage error * Remove/Disable last set of unused variables reported by GCC * remove redundant for loop * fix misspelled ifdef check * Update message on dialog * Fix hard-coded platform specific modifier keys * Remove duplicate for loop * Disable -Wmisleading-indentation warning * disable -Wswitch warning * Remove unused local typedefs * Fix -Wunused-value * Fix pragma error on Windows from subobject linkage fix * Fix -Waddress * Fix null conversions (-Wconversion-null) --------- Co-authored-by: SoftFever --- CMakeLists.txt | 17 ++++ src/BaseException.cpp | 2 +- src/OrcaSlicer.cpp | 29 +++---- src/admesh/connect.cpp | 2 +- src/admesh/normals.cpp | 2 +- src/imgui/imgui_widgets.cpp | 10 +-- src/imguizmo/ImGuizmo.cpp | 2 - .../include/libnest2d/geometry_traits_nfp.hpp | 1 - .../include/libnest2d/placers/nfpplacer.hpp | 1 - src/libslic3r/AppConfig.cpp | 2 - .../BeadingStrategy/BeadingStrategy.cpp | 1 - .../BeadingStrategyFactory.cpp | 1 - .../RedistributeBeadingStrategy.cpp | 1 - .../Arachne/SkeletalTrapezoidation.cpp | 3 +- .../Arachne/SkeletalTrapezoidationGraph.cpp | 3 - src/libslic3r/Arachne/utils/ExtrusionLine.cpp | 1 - src/libslic3r/Arachne/utils/SquareGrid.cpp | 1 - src/libslic3r/Arrange.cpp | 12 +-- src/libslic3r/BlacklistedLibraryCheck.cpp | 1 - src/libslic3r/Brim.cpp | 6 +- src/libslic3r/CSGMesh/ModelToCSGMesh.hpp | 2 +- src/libslic3r/Config.cpp | 3 +- src/libslic3r/ExtrusionEntityCollection.cpp | 1 - src/libslic3r/Fill/FillConcentricInternal.cpp | 3 - src/libslic3r/Fill/FillCrossHatch.cpp | 4 - src/libslic3r/Fill/Lightning/Generator.cpp | 3 +- src/libslic3r/FlushVolCalc.cpp | 1 - src/libslic3r/Format/3mf.cpp | 1 - src/libslic3r/Format/OBJ.cpp | 1 - src/libslic3r/Format/bbs_3mf.cpp | 18 ++-- src/libslic3r/Format/svg.cpp | 6 -- src/libslic3r/GCode.cpp | 27 +++--- src/libslic3r/GCode/ConflictChecker.cpp | 1 - src/libslic3r/GCode/GCodeProcessor.cpp | 1 - .../GCode/RetractWhenCrossingPerimeters.cpp | 2 - .../GCode/SmallAreaInfillFlowCompensator.hpp | 12 +++ src/libslic3r/GCode/ToolOrdering.cpp | 4 - src/libslic3r/GCode/WipeTower.cpp | 5 -- src/libslic3r/Geometry.cpp | 7 -- src/libslic3r/Geometry/Circle.cpp | 2 - src/libslic3r/Geometry/Voronoi.cpp | 1 - src/libslic3r/Geometry/VoronoiUtilsCgal.cpp | 1 - src/libslic3r/JumpPointSearch.cpp | 8 -- src/libslic3r/Line.cpp | 2 - src/libslic3r/MeshBoolean.cpp | 4 +- src/libslic3r/Model.cpp | 8 +- src/libslic3r/ModelArrange.cpp | 1 - src/libslic3r/MultiMaterialSegmentation.cpp | 2 - src/libslic3r/Orient.cpp | 15 ++-- src/libslic3r/PerimeterGenerator.cpp | 6 -- src/libslic3r/Polygon.cpp | 2 - src/libslic3r/Polyline.cpp | 2 - src/libslic3r/Preset.cpp | 1 - src/libslic3r/PresetBundle.cpp | 9 +- src/libslic3r/Print.cpp | 56 ++++++------ src/libslic3r/PrintObject.cpp | 14 ++- src/libslic3r/PrintObjectSlice.cpp | 9 +- src/libslic3r/Shape/TextShape.cpp | 2 - src/libslic3r/ShortEdgeCollapse.cpp | 1 - src/libslic3r/SlicesToTriangleMesh.cpp | 3 - src/libslic3r/Support/OrganicSupport.cpp | 6 -- src/libslic3r/Support/SupportParameters.cpp | 2 - src/libslic3r/SupportMaterial.cpp | 24 ++--- src/libslic3r/TreeSupport.cpp | 25 +----- src/libslic3r/TriangleMeshSlicer.cpp | 4 +- src/libslic3r/TriangleSetSampling.cpp | 1 - src/libslic3r/TriangulateWall.cpp | 4 +- src/libslic3r/Triangulation.cpp | 4 + src/libslic3r/calib.cpp | 5 +- src/libslic3r/utils.cpp | 12 +-- src/slic3r/GUI/3DScene.cpp | 4 +- src/slic3r/GUI/AMSMaterialsSetting.cpp | 3 +- src/slic3r/GUI/AmsMappingPopup.cpp | 5 -- src/slic3r/GUI/Auxiliary.cpp | 2 +- src/slic3r/GUI/AuxiliaryDataViewModel.cpp | 2 +- src/slic3r/GUI/BBLStatusBar.cpp | 2 - src/slic3r/GUI/BBLTopbar.cpp | 14 ++- src/slic3r/GUI/BackgroundSlicingProcess.cpp | 9 -- src/slic3r/GUI/BindDialog.cpp | 1 - src/slic3r/GUI/CalibrationPanel.cpp | 17 ++-- src/slic3r/GUI/CalibrationPanel.hpp | 4 +- src/slic3r/GUI/CalibrationWizard.cpp | 3 - .../GUI/CalibrationWizardPresetPage.cpp | 1 - src/slic3r/GUI/ConfigManipulation.cpp | 4 - src/slic3r/GUI/ConfigWizard.cpp | 7 +- src/slic3r/GUI/CreatePresetsDialog.cpp | 9 +- src/slic3r/GUI/DailyTips.cpp | 6 -- src/slic3r/GUI/DeviceManager.cpp | 13 +-- src/slic3r/GUI/DownloadProgressDialog.cpp | 1 - src/slic3r/GUI/ExtrusionCalibration.cpp | 1 - src/slic3r/GUI/FileArchiveDialog.cpp | 1 - src/slic3r/GUI/GCodeViewer.cpp | 62 ++++--------- src/slic3r/GUI/GLCanvas3D.cpp | 40 ++++----- src/slic3r/GUI/GLTexture.cpp | 1 - src/slic3r/GUI/GLToolbar.cpp | 1 - src/slic3r/GUI/GUI_App.cpp | 36 ++++---- src/slic3r/GUI/GUI_AuxiliaryList.cpp | 2 - src/slic3r/GUI/GUI_Factories.cpp | 44 ++++------ src/slic3r/GUI/GUI_ObjectList.cpp | 55 +++++------- src/slic3r/GUI/GUI_ObjectSettings.cpp | 8 +- src/slic3r/GUI/GUI_ObjectTable.cpp | 31 ++----- src/slic3r/GUI/GUI_ObjectTableSettings.cpp | 2 - src/slic3r/GUI/GUI_Preview.cpp | 10 --- src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp | 3 +- src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp | 10 --- src/slic3r/GUI/Gizmos/GLGizmoMeshBoolean.cpp | 6 -- .../GUI/Gizmos/GLGizmoMmuSegmentation.cpp | 2 - src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp | 14 +-- src/slic3r/GUI/Gizmos/GLGizmosManager.cpp | 6 +- .../GUI/Gizmos/GizmoObjectManipulation.cpp | 13 --- src/slic3r/GUI/HintNotification.cpp | 3 +- src/slic3r/GUI/IMSlider.cpp | 8 +- src/slic3r/GUI/ImGuiWrapper.cpp | 8 +- src/slic3r/GUI/Jobs/ArrangeJob.cpp | 4 - src/slic3r/GUI/Jobs/FillBedJob.cpp | 8 +- src/slic3r/GUI/Jobs/OrientJob.cpp | 1 - src/slic3r/GUI/Jobs/PrintJob.cpp | 11 +-- src/slic3r/GUI/Jobs/RotoptimizeJob.cpp | 3 +- src/slic3r/GUI/Jobs/SendJob.cpp | 5 -- src/slic3r/GUI/KBShortcutsDialog.cpp | 37 ++------ src/slic3r/GUI/MainFrame.cpp | 23 ++--- src/slic3r/GUI/MediaFilePanel.cpp | 3 +- src/slic3r/GUI/MediaPlayCtrl.cpp | 6 +- src/slic3r/GUI/ModelMall.cpp | 2 +- src/slic3r/GUI/Monitor.cpp | 13 +-- src/slic3r/GUI/Monitor.hpp | 2 +- src/slic3r/GUI/MonitorBasePanel.cpp | 5 +- src/slic3r/GUI/MultiMachine.hpp | 8 +- src/slic3r/GUI/MultiMachineManagerPage.cpp | 14 +-- src/slic3r/GUI/MultiMachineManagerPage.hpp | 2 +- src/slic3r/GUI/MultiMachinePage.cpp | 6 +- src/slic3r/GUI/MultiMachinePage.hpp | 2 +- src/slic3r/GUI/MultiTaskManagerPage.cpp | 31 ++++--- src/slic3r/GUI/MultiTaskManagerPage.hpp | 2 +- src/slic3r/GUI/Notebook.hpp | 2 - src/slic3r/GUI/NotificationManager.cpp | 2 +- src/slic3r/GUI/OG_CustomCtrl.cpp | 1 - src/slic3r/GUI/ObjColorDialog.cpp | 5 -- src/slic3r/GUI/OptionsGroup.cpp | 4 - src/slic3r/GUI/PartPlate.cpp | 52 ++++------- src/slic3r/GUI/Plater.cpp | 76 ++++++---------- src/slic3r/GUI/Preferences.cpp | 4 +- src/slic3r/GUI/PresetComboBoxes.cpp | 9 +- src/slic3r/GUI/Printer/PrinterFileSystem.cpp | 1 - src/slic3r/GUI/PrinterWebView.cpp | 2 - src/slic3r/GUI/Project.cpp | 2 +- src/slic3r/GUI/RecenterDialog.cpp | 2 - src/slic3r/GUI/ReleaseNote.cpp | 1 - src/slic3r/GUI/RemovableDriveManager.cpp | 4 - src/slic3r/GUI/Search.cpp | 8 +- src/slic3r/GUI/SelectMachine.cpp | 32 ++----- src/slic3r/GUI/SelectMachine.hpp | 2 +- src/slic3r/GUI/Selection.cpp | 11 ++- src/slic3r/GUI/SendMultiMachinePage.cpp | 36 +++----- src/slic3r/GUI/SendMultiMachinePage.hpp | 2 +- src/slic3r/GUI/SendSystemInfoDialog.cpp | 2 +- src/slic3r/GUI/SendToPrinter.cpp | 6 -- .../GUI/SlicingProgressNotification.cpp | 4 +- src/slic3r/GUI/StatusPanel.cpp | 8 +- src/slic3r/GUI/Tab.cpp | 26 +----- src/slic3r/GUI/Tabbook.hpp | 2 - src/slic3r/GUI/UnsavedChangesDialog.cpp | 2 +- src/slic3r/GUI/UpdateDialogs.cpp | 11 ++- src/slic3r/GUI/UpgradePanel.cpp | 2 - src/slic3r/GUI/UserManager.cpp | 3 +- src/slic3r/GUI/WebDownPluginDlg.cpp | 12 +-- src/slic3r/GUI/WebGuideDialog.cpp | 14 ++- src/slic3r/GUI/WebUserLoginDialog.cpp | 3 - src/slic3r/GUI/WebViewDialog.cpp | 1 - src/slic3r/GUI/Widgets/AMSControl.cpp | 87 +++++++++---------- src/slic3r/GUI/Widgets/AMSControl.hpp | 2 +- src/slic3r/GUI/Widgets/ComboBox.cpp | 2 +- src/slic3r/GUI/Widgets/FanControl.cpp | 2 +- src/slic3r/GUI/Widgets/ImageSwitchButton.cpp | 2 - src/slic3r/GUI/Widgets/RoundedRectangle.cpp | 1 - src/slic3r/GUI/Widgets/SpinInput.cpp | 2 - src/slic3r/GUI/Widgets/StepCtrl.cpp | 1 - src/slic3r/GUI/Widgets/TempInput.cpp | 1 - src/slic3r/GUI/Widgets/WebView.cpp | 2 +- src/slic3r/GUI/WipeTowerDialog.cpp | 4 - src/slic3r/GUI/wxExtensions.cpp | 1 - src/slic3r/Utils/ASCIIFolding.cpp | 5 +- src/slic3r/Utils/CalibUtils.cpp | 11 ++- src/slic3r/Utils/ESP3D.cpp | 9 -- src/slic3r/Utils/Obico.cpp | 4 - src/slic3r/Utils/PresetUpdater.cpp | 1 - src/slic3r/Utils/UndoRedo.cpp | 6 +- 187 files changed, 494 insertions(+), 1101 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8854ab903d..ac25b14a1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,6 +121,9 @@ if (MSVC) # C4244: 'conversion' conversion from 'type1' to 'type2', possible loss of data. An integer type is converted to a smaller integer type. # C4267: The compiler detected a conversion from size_t to a smaller type. add_compile_options(/wd4244 /wd4267) + # Disable warnings on comparison of unsigned and signed + # C4018: signed/unsigned mismatch + add_compile_options(/wd4018) endif () if (${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15) @@ -249,6 +252,20 @@ if (NOT MSVC AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMP # On GCC and Clang, no return from a non-void function is a warning only. Here, we make it an error. add_compile_options(-Werror=return-type) + # Ignore unused functions warnings + add_compile_options(-Wno-unused-function) + + # Ignore signed/unsigned comparison warnings + add_compile_options(-Wno-sign-compare) + + # The mismatch of tabs and spaces throughout the project can sometimes + # cause this warning to appear even though the indentation is fine. + # Some includes also cause the warning + add_compile_options(-Wno-misleading-indentation) + + # Disable warning if enum value does not have a corresponding case in switch statement + add_compile_options(-Wno-switch) + # removes LOTS of extraneous Eigen warnings (GCC only supports it since 6.1) # https://eigen.tuxfamily.org/bz/show_bug.cgi?id=1221 if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0) diff --git a/src/BaseException.cpp b/src/BaseException.cpp index 2443ebe4bb..705ac8f8c1 100644 --- a/src/BaseException.cpp +++ b/src/BaseException.cpp @@ -358,7 +358,7 @@ void CBaseException::ShowExceptionInformation() OutputString(_T("Exception Flag :0x%x "), m_pEp->ExceptionRecord->ExceptionFlags); OutputString(_T("NumberParameters :%ld \n"), m_pEp->ExceptionRecord->NumberParameters); - for (int i = 0; i < m_pEp->ExceptionRecord->NumberParameters; i++) + for (unsigned int i = 0; i < m_pEp->ExceptionRecord->NumberParameters; i++) { OutputString(_T("Param %d :0x%x \n"), i, m_pEp->ExceptionRecord->ExceptionInformation[i]); } diff --git a/src/OrcaSlicer.cpp b/src/OrcaSlicer.cpp index bb52a0aea1..71c39d874c 100644 --- a/src/OrcaSlicer.cpp +++ b/src/OrcaSlicer.cpp @@ -1190,9 +1190,8 @@ int CLI::run(int argc, char **argv) //BBS: add plate data related logic PlateDataPtrs plate_data_src; std::vector plate_obj_size_infos; - int arrange_option; int plate_to_slice = 0, filament_count = 0, duplicate_count = 0, real_duplicate_count = 0; - bool first_file = true, is_bbl_3mf = false, need_arrange = true, has_thumbnails = false, up_config_to_date = false, normative_check = true, duplicate_single_object = false, use_first_fila_as_default = false, minimum_save = false, enable_timelapse = false; + bool first_file = true, is_bbl_3mf = false, need_arrange = true, up_config_to_date = false, normative_check = true, duplicate_single_object = false, use_first_fila_as_default = false, minimum_save = false, enable_timelapse = false; bool allow_rotations = true, skip_modified_gcodes = false, avoid_extrusion_cali_region = false, skip_useless_pick = false, allow_newer_file = false; Semver file_version; std::map orients_requirement; @@ -1546,7 +1545,7 @@ int CLI::run(int argc, char **argv) { ModelObject* object = model.objects[obj_index]; - for (unsigned int clone_index = 1; clone_index < clone_count; clone_index++) + for (int clone_index = 1; clone_index < clone_count; clone_index++) { ModelObject* newObj = model.add_object(*object); newObj->name = object->name +"_"+ std::to_string(clone_index+1); @@ -1619,7 +1618,7 @@ int CLI::run(int argc, char **argv) } } catch (std::exception& e) { - boost::nowide::cerr << construct_assemble_list << ": " << e.what() << std::endl; + boost::nowide::cerr << "construct_assemble_list: " << e.what() << std::endl; record_exit_reson(outfile_dir, CLI_DATA_FILE_ERROR, 0, cli_errors[CLI_DATA_FILE_ERROR], sliced_info); flush_and_exit(CLI_DATA_FILE_ERROR); } @@ -2103,7 +2102,7 @@ int CLI::run(int argc, char **argv) record_exit_reson(outfile_dir, CLI_INVALID_PARAMS, 0, cli_errors[CLI_INVALID_PARAMS], sliced_info); flush_and_exit(CLI_INVALID_PARAMS); } - for (unsigned int index = 0; index < filament_count; index ++) + for (int index = 0; index < filament_count; index ++) { std::string file = uptodate_filaments[index]; DynamicPrintConfig config; @@ -2220,7 +2219,7 @@ int CLI::run(int argc, char **argv) } //upwards check - bool process_compatible = false, machine_upwards = false, machine_switch = false; + bool process_compatible = false, /* machine_upwards = false, */ machine_switch = false; BOOST_LOG_TRIVIAL(info) << boost::format("current printer %1%, new printer %2%, current process %3%, new process %4%")%current_printer_name %new_printer_name %current_process_name %new_process_name; BOOST_LOG_TRIVIAL(info) << boost::format("current printer inherits %1%, new printer inherits %2%, current process inherits %3%, new process inherits %4%") %current_printer_system_name %new_printer_system_name %current_process_system_name %new_process_system_name; @@ -2290,7 +2289,7 @@ int CLI::run(int argc, char **argv) for (int index = 0; index < upward_compatible_printers.size(); index++) { if (upward_compatible_printers[index] == new_printer_system_name) { process_compatible = true; - machine_upwards = true; + // machine_upwards = true; BOOST_LOG_TRIVIAL(info) << boost::format("new printer is upward_compatible"); break; } @@ -2900,7 +2899,8 @@ int CLI::run(int argc, char **argv) for (auto& model : m_models) for (ModelObject* o : model.objects) { - ModelObject* new_object = m.add_object(*o); + /* ModelObject* new_object = */ + m.add_object(*o); //BOOST_LOG_TRIVIAL(info) << "object "<name <<", id :" << o->id().id << "\n"; //orients_requirement.emplace(new_object->id().id, orients_requirement[o->id().id]); //orients_requirement.erase(o->id().id); @@ -3343,7 +3343,6 @@ int CLI::run(int argc, char **argv) BOOST_LOG_TRIVIAL(info) << boost::format("downward_check: all failed, size %1%")%downward_check_size; break; } - Slic3r::GUI::PartPlate* cur_plate = (Slic3r::GUI::PartPlate *)partplate_list.get_plate(index); Vec3d size = plate_obj_size_infos[index].obj_bbox.size(); for (int index2 = 0; index2 < downward_check_size; index2 ++) @@ -3393,7 +3392,6 @@ int CLI::run(int argc, char **argv) } // Loop through transform options. - bool user_center_specified = false; Points beds = get_bed_shape(m_print_config); ArrangeParams arrange_cfg; @@ -3417,7 +3415,6 @@ int CLI::run(int argc, char **argv) ModelObject* new_object = m.add_object(); new_object->name = _u8L("Assembly"); new_object->add_instance(); - int idx = 0; for (auto& model : m_models) for (ModelObject* o : model.objects) { for (auto volume : o->volumes) { @@ -3519,7 +3516,6 @@ int CLI::run(int argc, char **argv) } } } else if (opt_key == "center") { - user_center_specified = true; for (auto &model : m_models) { model.add_default_instances(); // this affects instances: @@ -3819,7 +3815,6 @@ int CLI::run(int argc, char **argv) { //do arrange for plate ArrangePolygons selected, unselected; - Model& model = m_models[0]; arrange_cfg = ArrangeParams(); // reset all params get_print_sequence(cur_plate, m_print_config, arrange_cfg.is_seq_print); @@ -3845,7 +3840,6 @@ int CLI::run(int argc, char **argv) if (!arrange_cfg.is_seq_print && assemble_plate.filaments_count > 1) { //prepare the wipe tower - int plate_count = partplate_list.get_plate_count(); auto printer_structure_opt = m_print_config.option>("printer_structure"); const float tower_brim_width = m_print_config.option("prime_tower_width", true)->value; @@ -4231,7 +4225,6 @@ int CLI::run(int argc, char **argv) //float depth = v * (filaments_cnt - 1) / (layer_height * w); Vec3d wipe_tower_size = cur_plate->estimate_wipe_tower_size(m_print_config, w, v, filaments_cnt); - Vec3d plate_origin = cur_plate->get_origin(); int plate_width, plate_depth, plate_height; partplate_list.get_plate_size(plate_width, plate_depth, plate_height); float depth = wipe_tower_size(1); @@ -4610,7 +4603,7 @@ int CLI::run(int argc, char **argv) } // loop through action options - bool export_to_3mf = false, load_slicedata = false, export_slicedata = false, export_slicedata_error = false; + bool export_to_3mf = false, load_slicedata = false, export_slicedata = false; bool no_check = false; std::string export_3mf_file, load_slice_data_dir, export_slice_data_dir, export_stls_dir; std::vector calibration_thumbnails; @@ -5099,7 +5092,6 @@ int CLI::run(int argc, char **argv) int ret = print->export_cached_data(plate_dir, with_space); if (ret) { BOOST_LOG_TRIVIAL(error) << "plate "<< index+1<< ": export Slicing data error, ret=" << ret; - export_slicedata_error = true; if (fs::exists(plate_dir)) fs::remove_all(plate_dir); record_exit_reson(outfile_dir, ret, index+1, cli_errors[ret], sliced_info); @@ -5226,8 +5218,7 @@ int CLI::run(int argc, char **argv) bool need_regenerate_top_thumbnail = oriented_or_arranged || regenerate_thumbnails; bool need_create_thumbnail_group = false, need_create_no_light_group = false, need_create_top_group = false; - // get type and color for platedata - auto* filament_types = dynamic_cast(m_print_config.option("filament_type")); + // get color for platedata const ConfigOptionStrings* filament_color = dynamic_cast(m_print_config.option("filament_colour")); auto* filament_id = dynamic_cast(m_print_config.option("filament_ids")); const ConfigOptionFloats* nozzle_diameter_option = dynamic_cast(m_print_config.option("nozzle_diameter")); diff --git a/src/admesh/connect.cpp b/src/admesh/connect.cpp index 30a199120d..4cf78f076a 100644 --- a/src/admesh/connect.cpp +++ b/src/admesh/connect.cpp @@ -216,7 +216,7 @@ private: // This is a match. Record result in neighbors list. match_neighbors(edge, *link->next); // Delete the matched edge from the list. - HashEdge *temp = link->next; + // HashEdge *temp = link->next; link->next = link->next->next; // pool.destroy(temp); #ifndef NDEBUG diff --git a/src/admesh/normals.cpp b/src/admesh/normals.cpp index f74ba01b6d..02fb16bb80 100644 --- a/src/admesh/normals.cpp +++ b/src/admesh/normals.cpp @@ -193,7 +193,7 @@ void stl_fix_normal_directions(stl_file *stl) norm_sw[facet_num] = 1; // Record this one as being fixed. ++ checked; } - stl_normal *temp = head->next; // Delete this facet from the list. + // stl_normal *temp = head->next; // Delete this facet from the list. head->next = head->next->next; // pool.destroy(temp); } else { // If we ran out of facets to fix: All of the facets in this part have been fixed. diff --git a/src/imgui/imgui_widgets.cpp b/src/imgui/imgui_widgets.cpp index ded72f4178..054312cfc0 100644 --- a/src/imgui/imgui_widgets.cpp +++ b/src/imgui/imgui_widgets.cpp @@ -768,11 +768,9 @@ bool ImGui::BBLButtonEx(const char* label, const ImVec2& size_arg, ImGuiButtonFl bool hovered, held; bool pressed = ButtonBehavior(bb, id, &hovered, &held, flags); - bool b_hover = false; if (hovered) { PushStyleColor(ImGuiCol_Text,GetColorU32(ImGuiCol_CheckMark)); - b_hover = true; } // Render @@ -4167,8 +4165,6 @@ bool ImGui::BBLInputScalar(const char *label, ImGuiDataType data_type, void *p_d const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y + style.FramePadding.y * 2.0f)); // Tabbing or CTRL-clicking on Drag turns it into an InputText const bool hovered = ItemHoverable(frame_bb, id); - // We are only allowed to access the state if we are already the active widget. - ImGuiInputTextState *state = GetInputTextState(id); bool push_color_count = 0; if (hovered || g.ActiveId == id) { @@ -6298,9 +6294,9 @@ bool ImGui::ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFl RenderFrameBorder(bb.Min, bb.Max, rounding); else #ifdef __APPLE__ - window->DrawList->AddRect(bb.Min - ImVec2(3, 3), bb.Max + ImVec2(3, 3), GetColorU32(ImGuiCol_FrameBg), rounding * 2,NULL,4.0f);; // Color button are often in need of some sort of border + window->DrawList->AddRect(bb.Min - ImVec2(3, 3), bb.Max + ImVec2(3, 3), GetColorU32(ImGuiCol_FrameBg), rounding * 2,0,4.0f);; // Color button are often in need of some sort of border #else - window->DrawList->AddRect(bb.Min - ImVec2(2, 2), bb.Max + ImVec2(2, 2), GetColorU32(ImGuiCol_FrameBg), rounding * 2,NULL,3.0f); // Color button are often in need of some sort of border + window->DrawList->AddRect(bb.Min - ImVec2(2, 2), bb.Max + ImVec2(2, 2), GetColorU32(ImGuiCol_FrameBg), rounding * 2,0,3.0f); // Color button are often in need of some sort of border #endif } @@ -7097,7 +7093,6 @@ bool ImGui::BBLImageSelectable(ImTextureID user_texture_id, const ImVec2& size_a // Text stays at the submission position, but bounding box may be extended on both sides const float arrow_size = (flags & ImGuiComboFlags_NoArrowButton) ? 0.0f : GetFrameHeight(); - const ImVec2 text_min = ImVec2(pos.x + arrow_size, pos.y); const ImVec2 text_max(min_x + size.x, pos.y + size.y); // Selectables are meant to be tightly packed together with no click-gap, so we extend their box to cover spacing between selectable. @@ -7209,7 +7204,6 @@ bool ImGui::BBLImageSelectable(ImTextureID user_texture_id, const ImVec2& size_a if (flags & ImGuiSelectableFlags_Disabled) PushStyleColor(ImGuiCol_Text, style.Colors[ImGuiCol_TextDisabled]); // Render - const ImU32 col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); ImVec2 p_min = bb.Min + ImVec2(style.ItemInnerSpacing.x, (bb.Max.y - bb.Min.y - font_size.y) / 2); ImVec2 p_max = p_min + font_size; window->DrawList->AddImage(user_texture_id, p_min, p_max, uv0, uv1, selected || (held && hovered) ? GetColorU32(ImVec4(1.f, 1.f, 1.f, 1.f)) : GetColorU32(tint_col)); diff --git a/src/imguizmo/ImGuizmo.cpp b/src/imguizmo/ImGuizmo.cpp index 1acf8b63e4..0f717395f9 100644 --- a/src/imguizmo/ImGuizmo.cpp +++ b/src/imguizmo/ImGuizmo.cpp @@ -2807,7 +2807,6 @@ namespace IMGUIZMO_NAMESPACE { static bool isDraging = false; static bool isClicking = false; - static bool isInside = false; static vec_t interpolationUp; static vec_t interpolationDir; static int interpolationFrames = 0; @@ -3055,7 +3054,6 @@ namespace IMGUIZMO_NAMESPACE LookAt(&newEye.x, &camTarget.x, &newUp.x, view); viewUpdated = true; } - isInside = gContext.mbMouseOver && ImRect(position, position + size).Contains(io.MousePos); if (io.MouseDown[0] && (fabsf(io.MouseDelta[0]) || fabsf(io.MouseDelta[1])) && isClicking) { diff --git a/src/libnest2d/include/libnest2d/geometry_traits_nfp.hpp b/src/libnest2d/include/libnest2d/geometry_traits_nfp.hpp index ab5f7678fd..4f8cf964b9 100644 --- a/src/libnest2d/include/libnest2d/geometry_traits_nfp.hpp +++ b/src/libnest2d/include/libnest2d/geometry_traits_nfp.hpp @@ -182,7 +182,6 @@ inline TPoint referenceVertex(const RawShape& sh) template inline NfpResult nfpInnerRectBed(const RawBox &bed, const RawShape &other) { using Vertex = TPoint; - using Edge = _Segment; namespace sl = shapelike; auto sbox = sl::boundingBox(other); diff --git a/src/libnest2d/include/libnest2d/placers/nfpplacer.hpp b/src/libnest2d/include/libnest2d/placers/nfpplacer.hpp index 65a3344b04..ebe3da6c5d 100644 --- a/src/libnest2d/include/libnest2d/placers/nfpplacer.hpp +++ b/src/libnest2d/include/libnest2d/placers/nfpplacer.hpp @@ -1119,7 +1119,6 @@ private: for (const Item& item : items_) { if (!item.is_virt_object) { extruders.insert(item.extrude_ids.begin(), item.extrude_ids.end()); } } - bool need_wipe_tower = extruders.size() > 1; std::vector objs,excludes; for (const Item &item : items_) { diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp index 50f89935f0..7ab0ad2329 100644 --- a/src/libslic3r/AppConfig.cpp +++ b/src/libslic3r/AppConfig.cpp @@ -18,9 +18,7 @@ #include #include #include -#include #include -#include #include #include #include diff --git a/src/libslic3r/Arachne/BeadingStrategy/BeadingStrategy.cpp b/src/libslic3r/Arachne/BeadingStrategy/BeadingStrategy.cpp index b57c84d639..6e344daf58 100644 --- a/src/libslic3r/Arachne/BeadingStrategy/BeadingStrategy.cpp +++ b/src/libslic3r/Arachne/BeadingStrategy/BeadingStrategy.cpp @@ -1,7 +1,6 @@ //Copyright (c) 2022 Ultimaker B.V. //CuraEngine is released under the terms of the AGPLv3 or higher. -#include #include "BeadingStrategy.hpp" #include "Point.hpp" diff --git a/src/libslic3r/Arachne/BeadingStrategy/BeadingStrategyFactory.cpp b/src/libslic3r/Arachne/BeadingStrategy/BeadingStrategyFactory.cpp index 97acd271ac..c42ef3d2f3 100644 --- a/src/libslic3r/Arachne/BeadingStrategy/BeadingStrategyFactory.cpp +++ b/src/libslic3r/Arachne/BeadingStrategy/BeadingStrategyFactory.cpp @@ -9,7 +9,6 @@ #include "RedistributeBeadingStrategy.hpp" #include "OuterWallInsetBeadingStrategy.hpp" -#include #include namespace Slic3r::Arachne diff --git a/src/libslic3r/Arachne/BeadingStrategy/RedistributeBeadingStrategy.cpp b/src/libslic3r/Arachne/BeadingStrategy/RedistributeBeadingStrategy.cpp index 2b4dda0272..93ffdfb750 100644 --- a/src/libslic3r/Arachne/BeadingStrategy/RedistributeBeadingStrategy.cpp +++ b/src/libslic3r/Arachne/BeadingStrategy/RedistributeBeadingStrategy.cpp @@ -3,7 +3,6 @@ #include "RedistributeBeadingStrategy.hpp" -#include #include namespace Slic3r::Arachne diff --git a/src/libslic3r/Arachne/SkeletalTrapezoidation.cpp b/src/libslic3r/Arachne/SkeletalTrapezoidation.cpp index 19d49c3e12..9278fb49b7 100644 --- a/src/libslic3r/Arachne/SkeletalTrapezoidation.cpp +++ b/src/libslic3r/Arachne/SkeletalTrapezoidation.cpp @@ -1595,7 +1595,6 @@ SkeletalTrapezoidation::edge_t* SkeletalTrapezoidation::getQuadMaxRedgeTo(edge_t void SkeletalTrapezoidation::propagateBeadingsUpward(std::vector& upward_quad_mids, ptr_vector_t& node_beadings) { - const auto _central_filter_dist = central_filter_dist(); for (auto upward_quad_mids_it = upward_quad_mids.rbegin(); upward_quad_mids_it != upward_quad_mids.rend(); ++upward_quad_mids_it) { edge_t* upward_edge = *upward_quad_mids_it; @@ -1612,7 +1611,7 @@ void SkeletalTrapezoidation::propagateBeadingsUpward(std::vector& upwar { // Only propagate to places where there is place continue; } - assert((upward_edge->from->data.distance_to_boundary != upward_edge->to->data.distance_to_boundary || shorter_then(upward_edge->to->p - upward_edge->from->p, _central_filter_dist)) && "zero difference R edges should always be central"); + assert((upward_edge->from->data.distance_to_boundary != upward_edge->to->data.distance_to_boundary || shorter_then(upward_edge->to->p - upward_edge->from->p, central_filter_dist())) && "zero difference R edges should always be central"); coord_t length = (upward_edge->to->p - upward_edge->from->p).cast().norm(); BeadingPropagation upper_beading = lower_beading; upper_beading.dist_to_bottom_source += length; diff --git a/src/libslic3r/Arachne/SkeletalTrapezoidationGraph.cpp b/src/libslic3r/Arachne/SkeletalTrapezoidationGraph.cpp index e87bc4db7c..3909868bee 100644 --- a/src/libslic3r/Arachne/SkeletalTrapezoidationGraph.cpp +++ b/src/libslic3r/Arachne/SkeletalTrapezoidationGraph.cpp @@ -7,9 +7,6 @@ #include -#include "utils/linearAlg2D.hpp" -#include "../Line.hpp" - namespace Slic3r::Arachne { diff --git a/src/libslic3r/Arachne/utils/ExtrusionLine.cpp b/src/libslic3r/Arachne/utils/ExtrusionLine.cpp index ac7b88af83..b671b80735 100644 --- a/src/libslic3r/Arachne/utils/ExtrusionLine.cpp +++ b/src/libslic3r/Arachne/utils/ExtrusionLine.cpp @@ -4,7 +4,6 @@ #include #include "ExtrusionLine.hpp" -#include "linearAlg2D.hpp" #include "../../VariableWidth.hpp" namespace Slic3r::Arachne diff --git a/src/libslic3r/Arachne/utils/SquareGrid.cpp b/src/libslic3r/Arachne/utils/SquareGrid.cpp index ae89965795..856eb5968b 100644 --- a/src/libslic3r/Arachne/utils/SquareGrid.cpp +++ b/src/libslic3r/Arachne/utils/SquareGrid.cpp @@ -2,7 +2,6 @@ //CuraEngine is released under the terms of the AGPLv3 or higher. #include "SquareGrid.hpp" -#include "../../Point.hpp" using namespace Slic3r::Arachne; diff --git a/src/libslic3r/Arrange.cpp b/src/libslic3r/Arrange.cpp index d82997aaa9..f9559ede24 100644 --- a/src/libslic3r/Arrange.cpp +++ b/src/libslic3r/Arrange.cpp @@ -199,23 +199,19 @@ void update_selected_items_axis_align(ArrangePolygons& selected, const DynamicPr } if (std::abs(a00) > EPSILON) { - double db1_2, db1_6, db1_12, db1_24, db1_20, db1_60; - double m00, m10, m01, m20, m11, m02, m30, m21, m12, m03; + double db1_2, db1_6, db1_12, db1_24; + double m00, m10, m01, m20, m11, m02; if (a00 > 0) { db1_2 = 0.5; db1_6 = 0.16666666666666666666666666666667; db1_12 = 0.083333333333333333333333333333333; db1_24 = 0.041666666666666666666666666666667; - db1_20 = 0.05; - db1_60 = 0.016666666666666666666666666666667; } else { db1_2 = -0.5; db1_6 = -0.16666666666666666666666666666667; db1_12 = -0.083333333333333333333333333333333; db1_24 = -0.041666666666666666666666666666667; - db1_20 = -0.05; - db1_60 = -0.016666666666666666666666666666667; } m00 = a00 * db1_2; m10 = a10 * db1_6; @@ -223,10 +219,6 @@ void update_selected_items_axis_align(ArrangePolygons& selected, const DynamicPr m20 = a20 * db1_12; m11 = a11 * db1_24; m02 = a02 * db1_12; - m30 = a30 * db1_20; - m21 = a21 * db1_60; - m12 = a12 * db1_60; - m03 = a03 * db1_20; double cx = m10 / m00; double cy = m01 / m00; diff --git a/src/libslic3r/BlacklistedLibraryCheck.cpp b/src/libslic3r/BlacklistedLibraryCheck.cpp index 938f542497..2c9bf9b8e9 100644 --- a/src/libslic3r/BlacklistedLibraryCheck.cpp +++ b/src/libslic3r/BlacklistedLibraryCheck.cpp @@ -1,6 +1,5 @@ #include "BlacklistedLibraryCheck.hpp" -#include #include #ifdef WIN32 diff --git a/src/libslic3r/Brim.cpp b/src/libslic3r/Brim.cpp index f59600971f..6bfa2c37e7 100644 --- a/src/libslic3r/Brim.cpp +++ b/src/libslic3r/Brim.cpp @@ -576,7 +576,6 @@ double getadhesionCoeff(const PrintObject* printObject) auto& insts = printObject->instances(); auto objectVolumes = insts[0].model_instance->get_object()->volumes; - auto print = printObject->print(); std::vector extrudersFirstLayer; auto firstLayerRegions = printObject->layers().front()->regions(); if (!firstLayerRegions.empty()) { @@ -901,8 +900,7 @@ static ExPolygons outer_inner_brim_area(const Print& print, Polygons holes_object; Polygons holes_support; if (objectWithExtruder.second == extruderNo && brimToWrite.at(object->id()).obj) { - double deltaT = getTemperatureFromExtruder(object); - double adhesion = getadhesionCoeff(object); + double adhension = getadhesionCoeff(object); double maxSpeed = Model::findMaxSpeed(object->model_object()); // BBS: brims are generated by volume groups for (const auto& volumeGroup : object->firstLayerObjGroups()) { @@ -1585,7 +1583,6 @@ static void make_inner_brim(const Print& print, const ConstPrintObjectPtrs& top_ //BBS: generate out brim by offseting ExPolygons 'islands_area_ex' Polygons tryExPolygonOffset(const ExPolygons islandAreaEx, const Print& print) { - const auto scaled_resolution = scaled(print.config().resolution.value); Polygons loops; ExPolygons islands_ex; Flow flow = print.brim_flow(); @@ -1660,7 +1657,6 @@ void make_brim(const Print& print, PrintTryCancel try_cancel, Polygons& islands_ std::map brimAreaMap; std::map supportBrimAreaMap; Flow flow = print.brim_flow(); - const auto scaled_resolution = scaled(print.config().resolution.value); ExPolygons islands_area_ex = outer_inner_brim_area(print, float(flow.scaled_spacing()), brimAreaMap, supportBrimAreaMap, objPrintVec, printExtruders); diff --git a/src/libslic3r/CSGMesh/ModelToCSGMesh.hpp b/src/libslic3r/CSGMesh/ModelToCSGMesh.hpp index 5963b29109..e5038df54b 100644 --- a/src/libslic3r/CSGMesh/ModelToCSGMesh.hpp +++ b/src/libslic3r/CSGMesh/ModelToCSGMesh.hpp @@ -28,7 +28,7 @@ bool model_to_csgmesh(const ModelObject &mo, { bool do_positives = parts_to_include & mpartsPositive; bool do_negatives = parts_to_include & mpartsNegative; - bool do_drillholes = parts_to_include & mpartsDrillHoles; + // bool do_drillholes = parts_to_include & mpartsDrillHoles; bool do_splits = parts_to_include & mpartsDoSplits; bool has_splitable_volume = false; diff --git a/src/libslic3r/Config.cpp b/src/libslic3r/Config.cpp index e826bb4c5b..d74e5ef3bd 100644 --- a/src/libslic3r/Config.cpp +++ b/src/libslic3r/Config.cpp @@ -775,10 +775,9 @@ ConfigSubstitutions ConfigBase::load(const std::string &file, ForwardCompatibili //BBS: add json support ConfigSubstitutions ConfigBase::load_from_json(const std::string &file, ForwardCompatibilitySubstitutionRule compatibility_rule, std::map& key_values, std::string& reason) { - int ret = 0; ConfigSubstitutionContext substitutions_ctxt(compatibility_rule); - ret = load_from_json(file, substitutions_ctxt, true, key_values, reason); + load_from_json(file, substitutions_ctxt, true, key_values, reason); return std::move(substitutions_ctxt.substitutions); } diff --git a/src/libslic3r/ExtrusionEntityCollection.cpp b/src/libslic3r/ExtrusionEntityCollection.cpp index 9a37ff3ac1..3383d0de34 100644 --- a/src/libslic3r/ExtrusionEntityCollection.cpp +++ b/src/libslic3r/ExtrusionEntityCollection.cpp @@ -2,7 +2,6 @@ #include "ShortestPath.hpp" #include #include -#include namespace Slic3r { diff --git a/src/libslic3r/Fill/FillConcentricInternal.cpp b/src/libslic3r/Fill/FillConcentricInternal.cpp index d565992ea1..1deb99183a 100644 --- a/src/libslic3r/Fill/FillConcentricInternal.cpp +++ b/src/libslic3r/Fill/FillConcentricInternal.cpp @@ -1,6 +1,3 @@ -#include "../ClipperUtils.hpp" -#include "../ExPolygon.hpp" -#include "../Surface.hpp" #include "../VariableWidth.hpp" #include "Arachne/WallToolPaths.hpp" diff --git a/src/libslic3r/Fill/FillCrossHatch.cpp b/src/libslic3r/Fill/FillCrossHatch.cpp index 10f421bef3..a6f05b65d5 100644 --- a/src/libslic3r/Fill/FillCrossHatch.cpp +++ b/src/libslic3r/Fill/FillCrossHatch.cpp @@ -1,6 +1,4 @@ -#include "../ClipperUtils.hpp" #include "../ShortestPath.hpp" -#include "../Surface.hpp" #include #include "FillCrossHatch.hpp" @@ -65,7 +63,6 @@ static Polylines generate_transform_pattern(double inprogress, int direction, co odd_poly.points.reserve(num_of_cycle * one_cycle.size()); // replicate to odd line - Point translate = Point(0, 0); for (size_t i = 0; i < num_of_cycle; i++) { Polyline odd_points; odd_points = Polyline(one_cycle); @@ -152,7 +149,6 @@ static Polylines generate_infill_layers(coordf_t z_height, double repeat_ratio, coordf_t period = trans_layer_size + repeat_layer_size; coordf_t remains = z_height - std::floor(z_height / period) * period; coordf_t trans_z = remains - repeat_layer_size; // put repeat layer first. - coordf_t repeat_z = remains; int phase = fmod(z_height, period * 2) - (period - 1); // add epsilon int direction = phase <= 0 ? -1 : 1; diff --git a/src/libslic3r/Fill/Lightning/Generator.cpp b/src/libslic3r/Fill/Lightning/Generator.cpp index bf1142ee45..a0cbe2b21e 100644 --- a/src/libslic3r/Fill/Lightning/Generator.cpp +++ b/src/libslic3r/Fill/Lightning/Generator.cpp @@ -4,7 +4,6 @@ #include "Generator.hpp" #include "TreeNode.hpp" -#include "../../ClipperUtils.hpp" #include "../../Layer.hpp" #include "../../Print.hpp" @@ -35,7 +34,7 @@ static std::string get_svg_filename(std::string layer_nr_or_z, std::string tag rand_init = true; } - int rand_num = rand() % 1000000; + // int rand_num = rand() % 1000000; //makedir("./SVG"); std::string prefix = "./SVG/"; std::string suffix = ".svg"; diff --git a/src/libslic3r/FlushVolCalc.cpp b/src/libslic3r/FlushVolCalc.cpp index 29cbcbe401..c135b93948 100644 --- a/src/libslic3r/FlushVolCalc.cpp +++ b/src/libslic3r/FlushVolCalc.cpp @@ -1,5 +1,4 @@ #include -#include #include "slic3r/Utils/ColorSpaceConvert.hpp" #include "FlushVolCalc.hpp" diff --git a/src/libslic3r/Format/3mf.cpp b/src/libslic3r/Format/3mf.cpp index 894de0549b..20007ee579 100644 --- a/src/libslic3r/Format/3mf.cpp +++ b/src/libslic3r/Format/3mf.cpp @@ -298,7 +298,6 @@ bool PrusaFileParser::check_3mf_from_prusa(const std::string filename) const std::string model_file = "3D/3dmodel.model"; int model_file_index = mz_zip_reader_locate_file(&archive, model_file.c_str(), nullptr, 0); if (model_file_index != -1) { - int depth = 0; m_parser = XML_ParserCreate(nullptr); XML_SetUserData(m_parser, (void *) this); XML_SetElementHandler(m_parser, start_element_handler, nullptr); diff --git a/src/libslic3r/Format/OBJ.cpp b/src/libslic3r/Format/OBJ.cpp index abaae3692b..f9a19d7a1b 100644 --- a/src/libslic3r/Format/OBJ.cpp +++ b/src/libslic3r/Format/OBJ.cpp @@ -100,7 +100,6 @@ bool load_obj(const char *path, TriangleMesh *meshptr, ObjInfo& obj_info, std::s obj_info.is_single_mtl = data.usemtls.size() == 1 && mtl_data.new_mtl_unmap.size() == 1; obj_info.face_colors.reserve(num_faces + num_quads); } - bool has_color = data.has_vertex_color; for (size_t i = 0; i < num_vertices; ++ i) { size_t j = i * OBJ_VERTEX_LENGTH; its.vertices.emplace_back(data.coordinates[j], data.coordinates[j + 1], data.coordinates[j + 2]); diff --git a/src/libslic3r/Format/bbs_3mf.cpp b/src/libslic3r/Format/bbs_3mf.cpp index 7df4fbca49..191246af74 100644 --- a/src/libslic3r/Format/bbs_3mf.cpp +++ b/src/libslic3r/Format/bbs_3mf.cpp @@ -878,7 +878,6 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) bool extract_object_model() { mz_zip_archive archive; - mz_zip_archive_file_stat stat; mz_zip_zero_struct(&archive); if (!open_zip_reader(&archive, zip_path)) { @@ -1617,9 +1616,9 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) } else { _extract_xml_from_archive(archive, sub_rels, _handle_start_relationships_element, _handle_end_relationships_element); - int index = 0; #if 0 + int index = 0; for (auto path : m_sub_model_paths) { if (proFn) { proFn(IMPORT_STAGE_READ_FILES, ++index, 3 + m_sub_model_paths.size(), cb_cancel); @@ -2219,7 +2218,6 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) bool _BBS_3MF_Importer::_extract_from_archive(mz_zip_archive& archive, std::string const & path, std::function extract, bool restore) { - mz_uint num_entries = mz_zip_reader_get_num_files(&archive); mz_zip_archive_file_stat stat; std::string path2 = path; if (path2.front() == '/') path2 = path2.substr(1); @@ -3319,9 +3317,9 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) // Adjust backup object/volume id std::istringstream iss(m_curr_object->uuid); int backup_id; - bool need_replace = false; + // bool need_replace = false; if (iss >> std::hex >> backup_id) { - need_replace = (m_curr_object->id != backup_id); + // need_replace = (m_curr_object->id != backup_id); m_curr_object->id = backup_id; } if (!m_curr_object->components.empty()) @@ -4994,9 +4992,9 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) if (is_bbl_3mf && boost::ends_with(current_object->uuid, OBJECT_UUID_SUFFIX) && top_importer->m_load_restore) { std::istringstream iss(current_object->uuid); int backup_id; - bool need_replace = false; + // bool need_replace = false; if (iss >> std::hex >> backup_id) { - need_replace = (current_object->id != backup_id); + // need_replace = (current_object->id != backup_id); current_object->id = backup_id; } //if (need_replace) @@ -5991,8 +5989,6 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) auto src_gcode_file = plate_data->gcode_file; boost::filesystem::ifstream ifs(src_gcode_file, std::ios::binary); std::string buf(64 * 1024, 0); - const std::size_t & size = boost::filesystem::file_size(src_gcode_file); - std::size_t left_size = size; while (ifs) { ifs.read(buf.data(), buf.size()); int read_bytes = ifs.gcount(); @@ -6230,7 +6226,6 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) bool _BBS_3MF_Exporter::_add_bbox_file_to_archive(mz_zip_archive& archive, const PlateBBoxData& id_bboxes, int index) { - bool res = false; nlohmann::json j; id_bboxes.to_json(j); std::string out = j.dump(); @@ -6620,7 +6615,6 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) auto iter = objects_data.find(objects[i]); ObjectToObjectDataMap objects_data2; objects_data2.insert(*iter); - auto & object = *iter->second.object; mz_zip_archive archive; mz_zip_zero_struct(&archive); mz_zip_writer_init_heap(&archive, 0, 1024 * 1024); @@ -7537,7 +7531,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) if (!m_skip_model && instance_size > 0) { - for (unsigned int j = 0; j < instance_size; ++j) + for (int j = 0; j < instance_size; ++j) { stream << " <" << INSTANCE_TAG << ">\n"; int obj_id = plate_data->objects_and_instances[j].first; diff --git a/src/libslic3r/Format/svg.cpp b/src/libslic3r/Format/svg.cpp index 4a96274b99..ed170cf570 100644 --- a/src/libslic3r/Format/svg.cpp +++ b/src/libslic3r/Format/svg.cpp @@ -113,9 +113,6 @@ double get_profile_area(std::vector> profile_line_poin double area = 0; for (auto line_points : profile_line_points) { - bool flag = true; - if (line_points.second.Y() < line_points.first.Y()) flag = false; - area += (line_points.second.X() + line_points.first.X() - 2 * min_x) * (line_points.second.Y() - line_points.first.Y()) / 2; } @@ -137,8 +134,6 @@ bool get_svg_profile(const char *path, std::vector &element_infos, int name_index = 1; for (NSVGshape *shape = svg_data->shapes; shape; shape = shape->next) { - char * id = shape->id; - int interpolation_precision = 10; // Number of interpolation points float step = 1.0f / float(interpolation_precision - 1); @@ -384,7 +379,6 @@ bool load_svg(const char *path, Model *model, std::string &message) ModelObject *new_object = model->add_object(); // new_object->name ? new_object->input_file = path; - auto stage_unit3 = stl.size() / LOAD_STEP_STAGE_UNIT_NUM + 1; for (size_t i = 0; i < stl.size(); i++) { // BBS: maybe mesh is empty from step file. Don't add if (stl[i].stats.number_of_facets > 0) { diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 4659552c63..ee49764808 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -116,7 +116,6 @@ static std::vector get_path_of_change_filament(const Print& print) if (excluse_area.size() != 4) return out_points; - double cutter_area_x = excluse_area[2].x() + 2; double cutter_area_y = excluse_area[2].y() + 2; double start_x_position = start_point.x(); @@ -2587,7 +2586,6 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_avoid_crossing_perimeters.use_external_mp_once(); // BBS. change tool before moving to origin point. if (m_writer.need_toolchange(initial_extruder_id)) { - const PrintObjectConfig& object_config = object.config(); coordf_t initial_layer_print_height = print.config().initial_layer_print_height.value; file.write(this->set_extruder(initial_extruder_id, initial_layer_print_height, true)); prime_extruder = true; @@ -3370,14 +3368,17 @@ namespace ProcessLayer const PrintConfig &config) { std::string gcode; - // BBS - bool single_filament_print = config.filament_diameter.size() == 1; if (custom_gcode != nullptr) { // Extruder switches are processed by LayerTools, they should be filtered out. assert(custom_gcode->type != CustomGCode::ToolChange); CustomGCode::Type gcode_type = custom_gcode->type; + + //BBS: inserting color gcode is removed +#if 0 + // BBS + bool single_filament_print = config.filament_diameter.size() == 1; bool color_change = gcode_type == CustomGCode::ColorChange; bool tool_change = gcode_type == CustomGCode::ToolChange; // Tool Change is applied as Color Change for a single extruder printer only. @@ -3389,8 +3390,7 @@ namespace ProcessLayer m600_extruder_before_layer = custom_gcode->extruder - 1; else if (gcode_type == CustomGCode::PausePrint) pause_print_msg = custom_gcode->extra; - //BBS: inserting color gcode is removed -#if 0 + // we should add or not colorprint_change in respect to nozzle_diameter count instead of really used extruders count if (color_change || tool_change) { @@ -3453,8 +3453,8 @@ namespace Skirt { { // Prime all extruders printing over the 1st layer over the skirt lines. size_t n_loops = print.skirt().entities.size(); - size_t n_tools = layer_tools.extruders.size(); - size_t lines_per_extruder = (n_loops + n_tools - 1) / n_tools; + // size_t n_tools = layer_tools.extruders.size(); + // size_t lines_per_extruder = (n_loops + n_tools - 1) / n_tools; // BBS. Extrude skirt with first extruder if min_skirt_length is zero //ORCA: Always extrude skirt with first extruder, independantly of if the minimum skirt length is zero or not. The code below @@ -3809,7 +3809,8 @@ LayerResult GCode::process_layer( Skirt::make_skirt_loops_per_extruder_other_layers(print, layer_tools, m_skirt_done); // BBS: get next extruder according to flush and soluble - auto get_next_extruder = [&](int current_extruder,const std::vector&extruders) { + // Orca: Left unused due to removed code below +/* auto get_next_extruder = [&](int current_extruder,const std::vector&extruders) { std::vector flush_matrix(cast(m_config.flush_volumes_matrix.values)); const unsigned int number_of_extruders = (unsigned int)(sqrt(flush_matrix.size()) + EPSILON); // Extract purging volumes for each extruder pair: @@ -3827,7 +3828,7 @@ LayerResult GCode::process_layer( } } return next_extruder; - }; + }; */ if (m_config.enable_overhang_speed && !m_config.overhang_speed_classic) { for (const auto &layer_to_print : layers) { @@ -4960,8 +4961,8 @@ std::string GCode::extrude_support(const ExtrusionEntityCollection &support_fill std::string gcode; if (! support_fills.entities.empty()) { - const double support_speed = m_config.support_speed.value; - const double support_interface_speed = m_config.get_abs_value("support_interface_speed"); + // const double support_speed = m_config.support_speed.value; + // const double support_interface_speed = m_config.get_abs_value("support_interface_speed"); for (const ExtrusionEntity *ee : support_fills.entities) { ExtrusionRole role = ee->role(); assert(role == erSupportMaterial || role == erSupportMaterialInterface || role == erSupportTransition); @@ -6127,7 +6128,6 @@ bool GCode::needs_retraction(const Polyline &travel, ExtrusionRole role, LiftTyp for (int i = 0; i < m_config.z_hop.size(); i++) max_z_hop = std::max(max_z_hop, (float)m_config.z_hop.get_at(i)); float travel_len_thresh = scale_(max_z_hop / tan(this->writer().extruder()->travel_slope())); - float accum_len = 0.f; Polyline clipped_travel; clipped_travel.append(Polyline(travel.points[0], travel.points[1])); @@ -6229,7 +6229,6 @@ std::string GCode::retract(bool toolchange, bool is_last_retraction, LiftType li } if (needs_lift && can_lift) { - size_t extruder_id = m_writer.extruder()->id(); gcode += m_writer.lift(!m_spiral_vase ? lift_type : LiftType::NormalLift); } diff --git a/src/libslic3r/GCode/ConflictChecker.cpp b/src/libslic3r/GCode/ConflictChecker.cpp index fb69372a9a..8b8e43aea2 100644 --- a/src/libslic3r/GCode/ConflictChecker.cpp +++ b/src/libslic3r/GCode/ConflictChecker.cpp @@ -28,7 +28,6 @@ inline Grids line_rasterization(const Line &line, int64_t xdist = scale_(1), int Point rayStart = line.a; Point rayEnd = line.b; IndexPair currentVoxel = point_map_grid_index(rayStart, xdist, ydist); - IndexPair firstVoxel = currentVoxel; IndexPair lastVoxel = point_map_grid_index(rayEnd, xdist, ydist); Point ray = rayEnd - rayStart; diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 3f3a4ed4b8..a70dbcbda0 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -3454,7 +3454,6 @@ void GCodeProcessor::process_G2_G3(const GCodeReader::GCodeLine& line) arc_length = ((int)line.p()) * 2 * PI * (start_point - m_arc_center).norm(); //BBS: Attention! arc_onterpolation does not support P mode while P is not 1. arc_interpolation(start_point, end_point, m_arc_center, (m_move_path_type == EMovePathType::Arc_move_ccw)); - float radian = ArcSegment::calc_arc_radian(start_point, end_point, m_arc_center, (m_move_path_type == EMovePathType::Arc_move_ccw)); Vec3f start_dir = Circle::calc_tangential_vector(start_point, m_arc_center, (m_move_path_type == EMovePathType::Arc_move_ccw)); Vec3f end_dir = Circle::calc_tangential_vector(end_point, m_arc_center, (m_move_path_type == EMovePathType::Arc_move_ccw)); diff --git a/src/libslic3r/GCode/RetractWhenCrossingPerimeters.cpp b/src/libslic3r/GCode/RetractWhenCrossingPerimeters.cpp index 776091adfb..ebeca40cf3 100644 --- a/src/libslic3r/GCode/RetractWhenCrossingPerimeters.cpp +++ b/src/libslic3r/GCode/RetractWhenCrossingPerimeters.cpp @@ -1,6 +1,4 @@ -#include "../ClipperUtils.hpp" #include "../Layer.hpp" -#include "../Polyline.hpp" #include "RetractWhenCrossingPerimeters.hpp" diff --git a/src/libslic3r/GCode/SmallAreaInfillFlowCompensator.hpp b/src/libslic3r/GCode/SmallAreaInfillFlowCompensator.hpp index 34c14864d1..e25c88522e 100644 --- a/src/libslic3r/GCode/SmallAreaInfillFlowCompensator.hpp +++ b/src/libslic3r/GCode/SmallAreaInfillFlowCompensator.hpp @@ -9,6 +9,14 @@ namespace Slic3r { +#ifndef _WIN32 +// Currently on Linux/macOS, this class spits out large amounts of subobject linkage +// warnings because of the flowModel field. tk::spline is in an anonymous namespace which +// causes this issue. Until the issue can be solved, this is a temporary solution. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsubobject-linkage" +#endif + class SmallAreaInfillFlowCompensator { public: @@ -31,6 +39,10 @@ private: double max_modified_length() { return eLengths.back(); } }; +#ifndef _WIN32 +#pragma GCC diagnostic pop +#endif + } // namespace Slic3r #endif /* slic3r_GCode_SmallAreaInfillFlowCompensator_hpp_ */ diff --git a/src/libslic3r/GCode/ToolOrdering.cpp b/src/libslic3r/GCode/ToolOrdering.cpp index e5c3260084..84f1521733 100644 --- a/src/libslic3r/GCode/ToolOrdering.cpp +++ b/src/libslic3r/GCode/ToolOrdering.cpp @@ -307,7 +307,6 @@ ToolOrdering::ToolOrdering(const Print &print, unsigned int first_extruder, bool std::vector ToolOrdering::generate_first_layer_tool_order(const Print& print) { std::vector tool_order; - int initial_extruder_id = -1; std::map min_areas_per_extruder; for (auto object : print.objects()) { @@ -336,7 +335,6 @@ std::vector ToolOrdering::generate_first_layer_tool_order(const Pr } } - double max_minimal_area = 0.; for (auto ape : min_areas_per_extruder) { auto iter = tool_order.begin(); for (; iter != tool_order.end(); iter++) { @@ -369,7 +367,6 @@ std::vector ToolOrdering::generate_first_layer_tool_order(const Pr std::vector ToolOrdering::generate_first_layer_tool_order(const PrintObject& object) { std::vector tool_order; - int initial_extruder_id = -1; std::map min_areas_per_extruder; auto first_layer = object.get_layer(0); for (auto layerm : first_layer->regions()) { @@ -394,7 +391,6 @@ std::vector ToolOrdering::generate_first_layer_tool_order(const Pr } } - double max_minimal_area = 0.; for (auto ape : min_areas_per_extruder) { auto iter = tool_order.begin(); for (; iter != tool_order.end(); iter++) { diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index 39c603a470..f18afb5d30 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -1072,8 +1072,6 @@ void WipeTower::toolchange_Wipe( const float target_speed = is_first_layer() ? std::min(m_first_layer_speed * 60.f, 4800.f) : 4800.f; float wipe_speed = 0.33f * target_speed; - float start_y = writer.y(); - #if 0 // if there is less than 2.5*m_perimeter_width to the edge, advance straightaway (there is likely a blob anyway) if ((m_left_to_right ? xr-writer.x() : writer.x()-xl) < 2.5f*m_perimeter_width) { @@ -1132,8 +1130,6 @@ void WipeTower::toolchange_Wipe( m_left_to_right = !m_left_to_right; } - float end_y = writer.y(); - // We may be going back to the model - wipe the nozzle. If this is followed // by finish_layer, this wipe path will be overwritten. //writer.add_wipe_point(writer.x(), writer.y()) @@ -1422,7 +1418,6 @@ void WipeTower::plan_tower() // If wipe tower height is between the current and next member, set the min_depth as linear interpolation between them auto next_height_to_depth = *iter; if (next_height_to_depth.first > m_wipe_tower_height) { - float height_base = curr_height_to_depth.first; float height_diff = next_height_to_depth.first - curr_height_to_depth.first; float min_depth_base = curr_height_to_depth.second; float depth_diff = next_height_to_depth.second - curr_height_to_depth.second; diff --git a/src/libslic3r/Geometry.cpp b/src/libslic3r/Geometry.cpp index 54dcb14cca..62385a5018 100644 --- a/src/libslic3r/Geometry.cpp +++ b/src/libslic3r/Geometry.cpp @@ -4,21 +4,14 @@ #include "ClipperUtils.hpp" #include "ExPolygon.hpp" #include "Line.hpp" -#include "clipper.hpp" -#include #include #include -#include -#include -#include -#include #include #include #include #include #include -#include #if defined(_MSC_VER) && defined(__clang__) #define BOOST_NO_CXX17_HDR_STRING_VIEW diff --git a/src/libslic3r/Geometry/Circle.cpp b/src/libslic3r/Geometry/Circle.cpp index 6796671954..d7279c3b1b 100644 --- a/src/libslic3r/Geometry/Circle.cpp +++ b/src/libslic3r/Geometry/Circle.cpp @@ -1,7 +1,5 @@ #include "Circle.hpp" -#include "../Polygon.hpp" - #include #include #include diff --git a/src/libslic3r/Geometry/Voronoi.cpp b/src/libslic3r/Geometry/Voronoi.cpp index 0842ddc37b..fc7ead40d0 100644 --- a/src/libslic3r/Geometry/Voronoi.cpp +++ b/src/libslic3r/Geometry/Voronoi.cpp @@ -2,7 +2,6 @@ #include "libslic3r/Arachne/utils/PolygonsSegmentIndex.hpp" #include "libslic3r/Geometry/VoronoiUtils.hpp" -#include "libslic3r/Geometry/VoronoiUtilsCgal.hpp" #include "libslic3r/MultiMaterialSegmentation.hpp" #include diff --git a/src/libslic3r/Geometry/VoronoiUtilsCgal.cpp b/src/libslic3r/Geometry/VoronoiUtilsCgal.cpp index a0e2191af5..60f66edbf6 100644 --- a/src/libslic3r/Geometry/VoronoiUtilsCgal.cpp +++ b/src/libslic3r/Geometry/VoronoiUtilsCgal.cpp @@ -1,4 +1,3 @@ -#include #include #include #include diff --git a/src/libslic3r/JumpPointSearch.cpp b/src/libslic3r/JumpPointSearch.cpp index f8ef2ff100..a3b078127b 100644 --- a/src/libslic3r/JumpPointSearch.cpp +++ b/src/libslic3r/JumpPointSearch.cpp @@ -1,26 +1,18 @@ #include "JumpPointSearch.hpp" #include "BoundingBox.hpp" -#include "ExPolygon.hpp" #include "Point.hpp" #include "libslic3r/AStar.hpp" #include "libslic3r/KDTreeIndirect.hpp" -#include "libslic3r/Polygon.hpp" #include "libslic3r/Polyline.hpp" #include "libslic3r/libslic3r.h" -#include -#include -#include #include #include #include #include #include -#include #include #include -#include - //#define DEBUG_FILES #ifdef DEBUG_FILES #include "libslic3r/SVG.hpp" diff --git a/src/libslic3r/Line.cpp b/src/libslic3r/Line.cpp index 7e75d56322..51c84a16f7 100644 --- a/src/libslic3r/Line.cpp +++ b/src/libslic3r/Line.cpp @@ -1,9 +1,7 @@ #include "Geometry.hpp" #include "Line.hpp" -#include "Polyline.hpp" #include #include -#include namespace Slic3r { diff --git a/src/libslic3r/MeshBoolean.cpp b/src/libslic3r/MeshBoolean.cpp index c412553a22..3cd0771962 100644 --- a/src/libslic3r/MeshBoolean.cpp +++ b/src/libslic3r/MeshBoolean.cpp @@ -330,7 +330,7 @@ void segment(CGALMesh& src, std::vector& dst, double smoothing_alpha = // fill holes typedef boost::graph_traits<_EpicMesh>::halfedge_descriptor halfedge_descriptor; - typedef boost::graph_traits<_EpicMesh>::vertex_descriptor vertex_descriptor; +// typedef boost::graph_traits<_EpicMesh>::vertex_descriptor vertex_descriptor; std::vector border_cycles; CGAL::Polygon_mesh_processing::extract_boundary_cycles(out, std::back_inserter(border_cycles)); for (halfedge_descriptor h : border_cycles) @@ -693,7 +693,7 @@ bool do_boolean_single(McutMesh &srcMesh, const McutMesh &cutMesh, const std::st McutMesh outMesh; int N_vertices = 0; // traversal of all connected components - for (int n = 0; n < numConnComps; ++n) { + for (unsigned int n = 0; n < numConnComps; ++n) { // query the data of each connected component from MCUT McConnectedComponent connComp = connectedComponents[n]; diff --git a/src/libslic3r/Model.cpp b/src/libslic3r/Model.cpp index bb7c33e26b..96136db395 100644 --- a/src/libslic3r/Model.cpp +++ b/src/libslic3r/Model.cpp @@ -442,7 +442,7 @@ ModelObject* Model::add_object(const ModelObject &other) this->objects.push_back(new_object); // BBS: backup if (need_backup) { - if (auto model = other.get_model()) { + if (other.get_model()) { auto iter = object_backup_id_map.find(other.id().id); if (iter != object_backup_id_map.end()) { object_backup_id_map.emplace(new_object->id().id, iter->second); @@ -2615,7 +2615,7 @@ size_t ModelVolume::split(unsigned int max_extruders) size_t ivolume = std::find(this->object->volumes.begin(), this->object->volumes.end(), this) - this->object->volumes.begin(); const std::string name = this->name; - unsigned int extruder_counter = 0; + // unsigned int extruder_counter = 0; const Vec3d offset = this->get_offset(); for (TriangleMesh &mesh : meshes) { @@ -2930,9 +2930,6 @@ bool Model::obj_import_vertex_color_deal(const std::vector &verte std::cout << "error"; } }; - auto calc_tri_area = [](const Vec3f &v0, const Vec3f &v1, const Vec3f &v2) { - return std::abs((v0 - v1).cross(v0 - v2).norm()) / 2; - }; auto volume = obj->volumes[0]; volume->config.set("extruder", first_extruder_id); auto face_count = volume->mesh().its.indices.size(); @@ -3032,7 +3029,6 @@ bool Model::obj_import_face_color_deal(const std::vector &face_fi volume->mmu_segmentation_facets.reserve(face_count); if (volume->mesh().its.indices.size() != face_filament_ids.size()) { return false; } for (size_t i = 0; i < volume->mesh().its.indices.size(); i++) { - auto face = volume->mesh().its.indices[i]; auto filament_id = face_filament_ids[i]; if (filament_id <= 1) { continue; } std::string result; diff --git a/src/libslic3r/ModelArrange.cpp b/src/libslic3r/ModelArrange.cpp index 477509e69e..f1f926fe6d 100644 --- a/src/libslic3r/ModelArrange.cpp +++ b/src/libslic3r/ModelArrange.cpp @@ -167,7 +167,6 @@ ArrangePolygon get_instance_arrange_poly(ModelInstance* instance, const Slic3r:: auto support_type_ptr = obj->get_config_value>(config, "support_type"); auto support_type = support_type_ptr->value; auto enable_support = supp_type_ptr->getBool(); - int support_int = support_type_ptr->getInt(); if (enable_support && (support_type == stNormalAuto || support_type == stNormal)) ap.brim_width = 6.0; diff --git a/src/libslic3r/MultiMaterialSegmentation.cpp b/src/libslic3r/MultiMaterialSegmentation.cpp index 4fe0d6b4b1..c0476de6d9 100644 --- a/src/libslic3r/MultiMaterialSegmentation.cpp +++ b/src/libslic3r/MultiMaterialSegmentation.cpp @@ -338,7 +338,6 @@ static std::vector> get_all_next_arcs( if (arc.type == MMU_Graph::ARC_TYPE::BORDER && arc.color != color) continue; - Vec2d arc_line = graph.nodes[arc.to_idx].point - graph.nodes[arc.from_idx].point; next_continue_arc.emplace_back(&arc); all_next_arcs.emplace_back(next_continue_arc); } @@ -1286,7 +1285,6 @@ static void cut_segmented_layers(const std::vector &input_exp const std::function &throw_on_cancel_callback) { BOOST_LOG_TRIVIAL(debug) << "MM segmentation - cutting segmented layers in parallel - begin"; - const float interlocking_cut_width = interlocking_depth > 0.f ? std::max(cut_width - interlocking_depth, 0.f) : 0.f; tbb::parallel_for(tbb::blocked_range(0, segmented_regions.size()), [&segmented_regions, &input_expolygons, &cut_width, &interlocking_depth, &throw_on_cancel_callback](const tbb::blocked_range &range) { for (size_t layer_idx = range.begin(); layer_idx < range.end(); ++layer_idx) { diff --git a/src/libslic3r/Orient.cpp b/src/libslic3r/Orient.cpp index ce448fc7e6..2fcbb6389a 100644 --- a/src/libslic3r/Orient.cpp +++ b/src/libslic3r/Orient.cpp @@ -138,8 +138,6 @@ public: auto cost_items = get_features(orientation, params.min_volume); - float unprintability = target_function(cost_items, params.min_volume); - results[orientation] = cost_items; BOOST_LOG_TRIVIAL(info) << std::fixed << std::setprecision(4) << "orientation:" << orientation.transpose() << ", cost:" << std::fixed << std::setprecision(4) << cost_items.field_values(); @@ -230,10 +228,10 @@ public: { std::unordered_map alignments; // init to 0 - for (size_t i = 0; i < areas_.size(); i++) + for (Eigen::Index i = 0; i < areas_.size(); i++) alignments.insert(std::pair(normals_.row(i), 0)); // cumulate areas - for (size_t i = 0; i < areas_.size(); i++) + for (Eigen::Index i = 0; i < areas_.size(); i++) { alignments[normals_.row(i)] += areas_(i); } @@ -257,11 +255,11 @@ public: Vec3f n1 = { 0, 0, 0 }; std::vector current_areas = {0, 0}; // init to 0 - for (size_t i = 0; i < areas_.size(); i++) { + for (Eigen::Index i = 0; i < areas_.size(); i++) { alignments_.insert(std::pair(quantize_normals_.row(i), std::pair(current_areas, n1))); } // cumulate areas - for (size_t i = 0; i < areas_.size(); i++) + for (Eigen::Index i = 0; i < areas_.size(); i++) { alignments_[quantize_normals_.row(i)].first[1] += areas_(i); if (areas_(i) > alignments_[quantize_normals_.row(i)].first[0]){ @@ -339,7 +337,7 @@ public: z_max_hull.resize(mesh_convex_hull.facets_count(), 1); its = mesh_convex_hull.its; - for (size_t i = 0; i < z_max_hull.rows(); i++) + for (Eigen::Index i = 0; i < z_max_hull.rows(); i++) { float z0 = its.get_vertex(i,0).dot(orientation); float z1 = its.get_vertex(i,1).dot(orientation); @@ -393,7 +391,7 @@ public: // filter overhang Eigen::VectorXf normal_projection(normals.rows(), 1);// = this->normals.dot(orientation); - for (size_t i = 0; i < normals.rows(); i++) + for (Eigen::Index i = 0; i < normals.rows(); i++) { normal_projection(i) = normals.row(i).dot(orientation); } @@ -459,7 +457,6 @@ public: cost = params.TAR_A * (overhang + params.TAR_B) + params.RELATIVE_F * (/*costs.volume/100*/overhang*params.TAR_C + params.TAR_D + params.TAR_LAF * costs.area_laf * params.use_low_angle_face) / (params.TAR_D + params.CONTOUR_F * costs.contour + params.BOTTOM_F * bottom + params.BOTTOM_HULL_F * bottom_hull + params.TAR_E * overhang + params.TAR_PROJ_AREA * costs.area_projected); } else { - float overhang = costs.overhang; cost = params.RELATIVE_F * (costs.overhang * params.TAR_C + params.TAR_D + params.TAR_LAF * costs.area_laf * params.use_low_angle_face) / (params.TAR_D + params.CONTOUR_F * costs.contour + params.BOTTOM_F * bottom + params.BOTTOM_HULL_F * bottom_hull + params.TAR_PROJ_AREA * costs.area_projected); } cost += (costs.bottom < params.BOTTOM_MIN) * 100;// +(costs.height_to_bottom_hull_ratio > params.height_to_bottom_hull_ratio_MIN) * 110; diff --git a/src/libslic3r/PerimeterGenerator.cpp b/src/libslic3r/PerimeterGenerator.cpp index 439ef57874..941cdf8f42 100644 --- a/src/libslic3r/PerimeterGenerator.cpp +++ b/src/libslic3r/PerimeterGenerator.cpp @@ -242,12 +242,10 @@ static std::deque split_polyline_by_degree(const Polyline &p Polyline right; Polyline temp_copy = polyline_with_insert_points; - size_t poly_size = polyline_with_insert_points.size(); // BBS: merge degree in limited range //find first degee base double degree_base = int(points_overhang[points_overhang.size() - 1] / min_degree_gap) * min_degree_gap + min_degree_gap; degree_base = degree_base > max_overhang_degree ? max_overhang_degree : degree_base; - double short_poly_len = 0; for (int point_idx = points_overhang.size() - 2; point_idx > 0; --point_idx) { double degree = points_overhang[point_idx]; @@ -940,7 +938,6 @@ static ExtrusionEntityCollection traverse_extrusions(const PerimeterGenerator& p if (perimeter_generator.config->overhang_speed_classic && perimeter_generator.config->enable_overhang_speed && perimeter_generator.config->fuzzy_skin == FuzzySkinType::None) { - Flow flow = is_external ? perimeter_generator.ext_perimeter_flow : perimeter_generator.perimeter_flow; std::map> clipper_serise; std::map recognization_paths; @@ -2253,7 +2250,6 @@ void PerimeterGenerator::process_no_bridge(Surfaces& all_surfaces, coord_t perim if (!unsupported.empty()) { //only consider the part that can be bridged (really, by the bridge algorithm) //first, separate into islands (ie, each ExPlolygon) - int numploy = 0; //only consider the bottom layer that intersect unsupported, to be sure it's only on our island. ExPolygonCollection lower_island(support); //a detector per island @@ -2371,7 +2367,6 @@ void PerimeterGenerator::process_no_bridge(Surfaces& all_surfaces, coord_t perim //ExPolygons no_bridge = diff_ex(offset_ex(unbridgeable, ext_perimeter_width * 3 / 2), last); //bridges_temp = diff_ex(bridges_temp, no_bridge); coordf_t offset_to_do = bridged_infill_margin; - bool first = true; unbridgeable = diff_ex(unbridgeable, offset_ex(bridges_temp, ext_perimeter_width)); while (offset_to_do > ext_perimeter_width * 1.5) { unbridgeable = offset2_ex(unbridgeable, -ext_perimeter_width / 4, ext_perimeter_width * 2.25, ClipperLib::jtSquare); @@ -2379,7 +2374,6 @@ void PerimeterGenerator::process_no_bridge(Surfaces& all_surfaces, coord_t perim bridges_temp = offset_ex(bridges_temp, ext_perimeter_width, ClipperLib::jtMiter, 6.); unbridgeable = diff_ex(unbridgeable, offset_ex(bridges_temp, ext_perimeter_width)); offset_to_do -= ext_perimeter_width; - first = false; } unbridgeable = offset_ex(unbridgeable, ext_perimeter_width + offset_to_do, ClipperLib::jtSquare); bridges_temp = diff_ex(bridges_temp, unbridgeable); diff --git a/src/libslic3r/Polygon.cpp b/src/libslic3r/Polygon.cpp index 5d3d643349..1d93458166 100644 --- a/src/libslic3r/Polygon.cpp +++ b/src/libslic3r/Polygon.cpp @@ -355,8 +355,6 @@ Polygon Polygon::transform(const Transform3d& trafo) const if (vertices_count == 0) return dstpoly; - unsigned int data_size = 3 * vertices_count * sizeof(float); - Eigen::MatrixXd src(3, vertices_count); for (size_t i = 0; i < vertices_count; i++) { diff --git a/src/libslic3r/Polyline.cpp b/src/libslic3r/Polyline.cpp index b30564f3c1..8a650c926b 100644 --- a/src/libslic3r/Polyline.cpp +++ b/src/libslic3r/Polyline.cpp @@ -51,7 +51,6 @@ void Polyline::reverse() // removes the given distance from the end of the polyline void Polyline::clip_end(double distance) { - bool last_point_inserted = false; size_t remove_after_index = MultiPoint::size(); while (distance > 0) { Vec2d last_point = this->last_point().cast(); @@ -65,7 +64,6 @@ void Polyline::clip_end(double distance) double lsqr = v.squaredNorm(); if (lsqr > distance * distance) { this->points.emplace_back((last_point + v * (distance / sqrt(lsqr))).cast()); - last_point_inserted = true; break; } distance -= sqrt(lsqr); diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 59b0d1f9c1..d05ea00813 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1572,7 +1572,6 @@ bool PresetCollection::load_user_preset(std::string name, std::map presets_loaded; - int count = 0; BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(" enter, name %1% , total value counts %2%")%name %preset_values.size(); diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index b53ec6e354..b45edc8a85 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -1853,7 +1853,7 @@ void PresetBundle::export_selections(AppConfig &config) // BBS void PresetBundle::set_num_filaments(unsigned int n, std::string new_color) { - int old_filament_count = this->filament_presets.size(); + size_t old_filament_count = this->filament_presets.size(); if (n > old_filament_count && old_filament_count != 0) filament_presets.resize(n, filament_presets.back()); else { @@ -1867,7 +1867,7 @@ void PresetBundle::set_num_filaments(unsigned int n, std::string new_color) //BBS set new filament color to new_color if (old_filament_count < n) { if (!new_color.empty()) { - for (int i = old_filament_count; i < n; i++) { + for (size_t i = old_filament_count; i < n; i++) { filament_color->values[i] = new_color; } } @@ -2054,7 +2054,7 @@ bool PresetBundle::check_filament_temp_equation_by_printer_type_and_nozzle_for_m //BBS: check whether this is the only edited filament bool PresetBundle::is_the_only_edited_filament(unsigned int filament_index) { - int n = this->filament_presets.size(); + size_t n = this->filament_presets.size(); if (filament_index >= n) return false; @@ -2117,7 +2117,6 @@ DynamicPrintConfig PresetBundle::full_fff_config() const // BBS size_t num_filaments = this->filament_presets.size(); - auto* extruder_diameter = dynamic_cast(out.option("nozzle_diameter")); // Collect the "compatible_printers_condition" and "inherits" values over all presets (print, filaments, printers) into a single vector. std::vector compatible_printers_condition; std::vector compatible_prints_condition; @@ -2472,7 +2471,7 @@ void PresetBundle::load_config_file_config(const std::string &name_or_path, bool std::vector filament_ids = std::move(config.option("filament_ids", true)->values); std::vector print_compatible_printers = std::move(config.option("print_compatible_printers", true)->values); //BBS: add different settings check logic - bool has_different_settings_to_system = config.option("different_settings_to_system")?true:false; + // bool has_different_settings_to_system = config.option("different_settings_to_system")?true:false; std::vector different_values = std::move(config.option("different_settings_to_system", true)->values); std::string &compatible_printers_condition = Preset::compatible_printers_condition(config); std::string &compatible_prints_condition = Preset::compatible_prints_condition(config); diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 43755c8ade..89ce1cbe1c 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -823,7 +823,6 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print for (int i = k+1; i < print_instance_count; i++) { - auto& p = print_instance_with_bounding_box[i].print_instance; auto bbox2 = print_instance_with_bounding_box[i].bounding_box; auto py1 = bbox2.min.y(); auto py2 = bbox2.max.y(); @@ -1391,32 +1390,30 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons* const ConfigOptionDef* bed_type_def = print_config_def.get("curr_bed_type"); assert(bed_type_def != nullptr); - if (is_BBL_printer()) { + if (is_BBL_printer()) { const t_config_enum_values* bed_type_keys_map = bed_type_def->enum_keys_map; + const ConfigOptionInts* bed_temp_opt = m_config.option(get_bed_temp_key(m_config.curr_bed_type)); for (unsigned int extruder_id : extruders) { - const ConfigOptionInts* bed_temp_opt = m_config.option(get_bed_temp_key(m_config.curr_bed_type)); - for (unsigned int extruder_id : extruders) { - int curr_bed_temp = bed_temp_opt->get_at(extruder_id); - if (curr_bed_temp == 0 && bed_type_keys_map != nullptr) { - std::string bed_type_name; - for (auto item : *bed_type_keys_map) { - if (item.second == m_config.curr_bed_type) { - bed_type_name = item.first; - break; - } + int curr_bed_temp = bed_temp_opt->get_at(extruder_id); + if (curr_bed_temp == 0 && bed_type_keys_map != nullptr) { + std::string bed_type_name; + for (auto item : *bed_type_keys_map) { + if (item.second == m_config.curr_bed_type) { + bed_type_name = item.first; + break; } + } - StringObjectException except; - except.string = Slic3r::format(L("Plate %d: %s does not support filament %s"), this->get_plate_index() + 1, L(bed_type_name), extruder_id + 1); - except.string += "\n"; - except.type = STRING_EXCEPT_FILAMENT_NOT_MATCH_BED_TYPE; - except.params.push_back(std::to_string(this->get_plate_index() + 1)); - except.params.push_back(L(bed_type_name)); - except.params.push_back(std::to_string(extruder_id+1)); - except.object = nullptr; - return except; - } - } + StringObjectException except; + except.string = Slic3r::format(L("Plate %d: %s does not support filament %s"), this->get_plate_index() + 1, L(bed_type_name), extruder_id + 1); + except.string += "\n"; + except.type = STRING_EXCEPT_FILAMENT_NOT_MATCH_BED_TYPE; + except.params.push_back(std::to_string(this->get_plate_index() + 1)); + except.params.push_back(L(bed_type_name)); + except.params.push_back(std::to_string(extruder_id+1)); + except.object = nullptr; + return except; + } } } @@ -1433,7 +1430,7 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons* } return warning_key; }; - auto check_motion_ability_region_setting = [&](const std::vector& keys_to_check, double limit) -> std::string { + /* auto check_motion_ability_region_setting = [&](const std::vector& keys_to_check, double limit) -> std::string { std::string warning_key; for (const auto& key : keys_to_check) { if (m_default_region_config.get_abs_value(key) > limit) { @@ -1442,7 +1439,7 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons* } } return warning_key; - }; + }; */ std::string warning_key; // check jerk @@ -2035,8 +2032,7 @@ void Print::process(long long *time_cost_with_cache, bool use_cache) //BBS: get the objects' indices when GCodes are generated ToolOrdering tool_ordering; unsigned int initial_extruder_id = (unsigned int)-1; - unsigned int final_extruder_id = (unsigned int)-1; - bool has_wipe_tower = false; + // bool has_wipe_tower = false; std::vector print_object_instances_ordering; std::vector::const_iterator print_object_instance_sequential_active; std::vector>> layers_to_print = GCode::collect_layers_to_print(*this); @@ -2056,9 +2052,9 @@ void Print::process(long long *time_cost_with_cache, bool use_cache) else { tool_ordering = this->tool_ordering(); tool_ordering.assign_custom_gcodes(*this); - has_wipe_tower = this->has_wipe_tower() && tool_ordering.has_wipe_tower(); //BBS: have no single_extruder_multi_material_priming #if 0 + has_wipe_tower = this->has_wipe_tower() && tool_ordering.has_wipe_tower(); initial_extruder_id = (has_wipe_tower && !this->config().single_extruder_multi_material_priming) ? // The priming towers will be skipped. tool_ordering.all_extruders().back() : @@ -2646,7 +2642,7 @@ void Print::_make_wipe_tower() for (auto &layer_tools : m_wipe_tower_data.tool_ordering.layer_tools()) { // for all layers if (!layer_tools.has_wipe_tower) continue; - bool first_layer = &layer_tools == &m_wipe_tower_data.tool_ordering.front(); + // bool first_layer = &layer_tools == &m_wipe_tower_data.tool_ordering.front(); wipe_tower.plan_toolchange((float) layer_tools.print_z, (float) layer_tools.wipe_tower_layer_height, current_extruder_id, current_extruder_id); @@ -2740,7 +2736,7 @@ void Print::_make_wipe_tower() for (auto &layer_tools : m_wipe_tower_data.tool_ordering.layer_tools()) { // for all layers if (!layer_tools.has_wipe_tower) continue; - bool first_layer = &layer_tools == &m_wipe_tower_data.tool_ordering.front(); + // bool first_layer = &layer_tools == &m_wipe_tower_data.tool_ordering.front(); wipe_tower.plan_toolchange((float) layer_tools.print_z, (float) layer_tools.wipe_tower_layer_height, current_extruder_id, current_extruder_id, false); for (const auto extruder_id : layer_tools.extruders) { diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 907cc9c248..1487016734 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -677,7 +677,6 @@ void PrintObject::estimate_curled_extrusions() [](const PrintRegion *region) { return region->config().enable_overhang_speed.getBool(); })) { // Estimate curling of support material and add it to the malformaition lines of each layer - float support_flow_width = support_material_flow(this, this->config().layer_height).width(); SupportSpotsGenerator::Params params{this->print()->m_config.filament_type.values, float(this->print()->default_object_config().inner_wall_acceleration.getFloat()), this->config().raft_layers.getInt(), this->config().brim_type.value, @@ -2949,16 +2948,16 @@ struct POProfiler void PrintObject::generate_support_preview() { - POProfiler profiler; + // POProfiler profiler; - boost::posix_time::ptime ts1 = boost::posix_time::microsec_clock::local_time(); + // boost::posix_time::ptime ts1 = boost::posix_time::microsec_clock::local_time(); this->slice(); - boost::posix_time::ptime ts2 = boost::posix_time::microsec_clock::local_time(); - profiler.duration1 = (ts2 - ts1).total_milliseconds(); + // boost::posix_time::ptime ts2 = boost::posix_time::microsec_clock::local_time(); + // profiler.duration1 = (ts2 - ts1).total_milliseconds(); this->generate_support_material(); - boost::posix_time::ptime ts3 = boost::posix_time::microsec_clock::local_time(); - profiler.duration2 = (ts3 - ts2).total_milliseconds(); + // boost::posix_time::ptime ts3 = boost::posix_time::microsec_clock::local_time(); + // profiler.duration2 = (ts3 - ts2).total_milliseconds(); } void PrintObject::update_slicing_parameters() @@ -3668,7 +3667,6 @@ template void PrintObject::remove_bridges_from_contacts( SupportNecessaryType PrintObject::is_support_necessary() { - static const double super_overhang_area_threshold = SQ(scale_(5.0)); const double cantilevel_dist_thresh = scale_(6); #if 0 double threshold_rad = (m_config.support_threshold_angle.value < EPSILON ? 30 : m_config.support_threshold_angle.value + 1) * M_PI / 180.; diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 98f7d8b20e..fd467e076f 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -151,8 +151,8 @@ static std::vector slice_volumes_inner( params_base.mode_below = params_base.mode; // BBS - const size_t num_extruders = print_config.filament_diameter.size(); - const bool is_mm_painted = num_extruders > 1 && std::any_of(model_volumes.cbegin(), model_volumes.cend(), [](const ModelVolume *mv) { return mv->is_mm_painted(); }); + // const size_t num_extruders = print_config.filament_diameter.size(); + // const bool is_mm_painted = num_extruders > 1 && std::any_of(model_volumes.cbegin(), model_volumes.cend(), [](const ModelVolume *mv) { return mv->is_mm_painted(); }); // BBS: don't do size compensation when slice volume. // Will handle contour and hole size compensation seperately later. //const auto extra_offset = is_mm_painted ? 0.f : std::max(0.f, float(print_object_config.xy_contour_compensation.value)); @@ -336,7 +336,8 @@ static std::vector> slices_to_regions( }; // BBS - auto trim_overlap = [](ExPolygons& expolys_a, ExPolygons& expolys_b) { + // Orca: unused +/* auto trim_overlap = [](ExPolygons& expolys_a, ExPolygons& expolys_b) { ExPolygons trimming_a; ExPolygons trimming_b; @@ -361,7 +362,7 @@ static std::vector> slices_to_regions( expolys_a = diff_ex(expolys_a, trimming_a); expolys_b = diff_ex(expolys_b, trimming_b); - }; + }; */ std::vector temp_slices; for (size_t zs_complex_idx = range.begin(); zs_complex_idx < range.end(); ++ zs_complex_idx) { diff --git a/src/libslic3r/Shape/TextShape.cpp b/src/libslic3r/Shape/TextShape.cpp index dce731af19..58df800a51 100644 --- a/src/libslic3r/Shape/TextShape.cpp +++ b/src/libslic3r/Shape/TextShape.cpp @@ -99,8 +99,6 @@ std::vector init_occt_fonts() static bool TextToBRep(const char* text, const char* font, const float theTextHeight, Font_FontAspect& theFontAspect, TopoDS_Shape& theShape, double& text_width) { - Standard_Integer anArgIt = 1; - Standard_CString aName = "text_shape"; Standard_CString aText = text; Font_BRepFont aFont; diff --git a/src/libslic3r/ShortEdgeCollapse.cpp b/src/libslic3r/ShortEdgeCollapse.cpp index 3397daf55c..f19ff9f22e 100644 --- a/src/libslic3r/ShortEdgeCollapse.cpp +++ b/src/libslic3r/ShortEdgeCollapse.cpp @@ -2,7 +2,6 @@ #include "libslic3r/NormalUtils.hpp" #include -#include #include #include diff --git a/src/libslic3r/SlicesToTriangleMesh.cpp b/src/libslic3r/SlicesToTriangleMesh.cpp index 3b55cf066b..5740665ae2 100644 --- a/src/libslic3r/SlicesToTriangleMesh.cpp +++ b/src/libslic3r/SlicesToTriangleMesh.cpp @@ -1,8 +1,5 @@ -#include - #include "SlicesToTriangleMesh.hpp" -//#include "libslic3r/MTUtils.hpp" #include "libslic3r/Execution/ExecutionTBB.hpp" #include "libslic3r/ClipperUtils.hpp" #include "libslic3r/Tesselate.hpp" diff --git a/src/libslic3r/Support/OrganicSupport.cpp b/src/libslic3r/Support/OrganicSupport.cpp index 05e515d94e..5543f76fd5 100644 --- a/src/libslic3r/Support/OrganicSupport.cpp +++ b/src/libslic3r/Support/OrganicSupport.cpp @@ -1,12 +1,6 @@ #include "OrganicSupport.hpp" #include "SupportCommon.hpp" - -#include "../AABBTreeLines.hpp" -#include "../ClipperUtils.hpp" -#include "../Polygon.hpp" -#include "../Polyline.hpp" #include "../MutablePolygon.hpp" -#include "../TriangleMeshSlicer.hpp" #include diff --git a/src/libslic3r/Support/SupportParameters.cpp b/src/libslic3r/Support/SupportParameters.cpp index 8508206cb9..4af36e05ae 100644 --- a/src/libslic3r/Support/SupportParameters.cpp +++ b/src/libslic3r/Support/SupportParameters.cpp @@ -1,6 +1,4 @@ #include "../Print.hpp" -#include "../PrintConfig.hpp" -#include "../Slicing.hpp" #include "SupportParameters.hpp" namespace Slic3r::FFFSupport { diff --git a/src/libslic3r/SupportMaterial.cpp b/src/libslic3r/SupportMaterial.cpp index b022607bf7..e1c6c97cc1 100644 --- a/src/libslic3r/SupportMaterial.cpp +++ b/src/libslic3r/SupportMaterial.cpp @@ -338,7 +338,7 @@ static std::string get_svg_filename(std::string layer_nr_or_z, std::string tag rand_init = true; } - int rand_num = rand() % 1000000; + // int rand_num = rand() % 1000000; //makedir("./SVG"); std::string prefix = "./SVG/"; std::string suffix = ".svg"; @@ -1554,7 +1554,6 @@ static inline ExPolygons detect_overhangs( double thresh_angle = object_config.support_threshold_angle.value > 0 ? object_config.support_threshold_angle.value + 1 : 0; thresh_angle = std::min(thresh_angle, 89.); // BBS should be smaller than 90 const double threshold_rad = Geometry::deg2rad(thresh_angle); - const coordf_t max_bridge_length = scale_(object_config.max_bridge_length.value); const bool bridge_no_support = object_config.bridge_no_support.value; const coordf_t xy_expansion = scale_(object_config.support_expansion.value); @@ -1577,7 +1576,6 @@ static inline ExPolygons detect_overhangs( { // Generate overhang / contact_polygons for non-raft layers. const Layer &lower_layer = *layer.lower_layer; - const bool has_enforcer = !annotations.enforcers_layers.empty() && !annotations.enforcers_layers[layer_id].empty(); // Can't directly use lower_layer.lslices, or we'll miss some very sharp tails. // Filter out areas whose diameter that is smaller than extrusion_width. Do not use offset2() for this purpose! // FIXME if there are multiple regions with different extrusion width, the following code may not be right. @@ -1689,7 +1687,6 @@ static inline ExPolygons detect_overhangs( // check cantilever if (layer.lower_layer) { for (ExPolygon& poly : overhang_areas) { - float fw = float(layer.regions().front()->flow(frExternalPerimeter).scaled_width()); auto cluster_boundary_ex = intersection_ex(poly, offset_ex(layer.lower_layer->lslices, scale_(0.5))); Polygons cluster_boundary = to_polygons(cluster_boundary_ex); if (cluster_boundary.empty()) continue; @@ -1734,7 +1731,6 @@ static inline std::tuple detect_contacts( Polygons enforcer_polygons; // BBS. - const bool auto_normal_support = object_config.support_type.value == stNormalAuto; const bool buildplate_only = !annotations.buildplate_covered.empty(); float no_interface_offset = 0.f; @@ -1748,8 +1744,6 @@ static inline std::tuple detect_contacts( // Generate overhang / contact_polygons for non-raft layers. const Layer& lower_layer = *layer.lower_layer; const bool has_enforcer = !annotations.enforcers_layers.empty() && !annotations.enforcers_layers[layer_id].empty(); - const ExPolygons& lower_layer_expolys = lower_layer.lslices; - const ExPolygons& lower_layer_sharptails = lower_layer.sharp_tails; // Cache support trimming polygons derived from lower layer polygons, possible merged with "on build plate only" trimming polygons. auto slices_margin_update = @@ -2187,7 +2181,6 @@ struct OverhangCluster { static OverhangCluster* add_overhang(std::vector& clusters, ExPolygon* overhang, int layer_nr, coordf_t offset_scaled) { OverhangCluster* cluster = nullptr; - bool found = false; for (int i = 0; i < clusters.size(); i++) { auto cluster_i = &clusters[i]; if (cluster_i->intersects(*overhang, layer_nr)) { @@ -3546,13 +3539,13 @@ std::pair 1. // Contact layer needs a base_interface layer, therefore run the following block if support_interface_top_layers > 0, has soluble support and extruders are different. - bool soluble_interface_non_soluble_base = - // Zero z-gap between the overhangs and the support interface. - m_slicing_params.soluble_interface && - // Interface extruder soluble. - m_object_config->support_interface_filament.value > 0 && m_print_config->filament_soluble.get_at(m_object_config->support_interface_filament.value - 1) && - // Base extruder: Either "print with active extruder" not soluble. - (m_object_config->support_filament.value == 0 || ! m_print_config->filament_soluble.get_at(m_object_config->support_filament.value - 1)); +// bool soluble_interface_non_soluble_base = +// // Zero z-gap between the overhangs and the support interface. +// m_slicing_params.soluble_interface && +// // Interface extruder soluble. +// m_object_config->support_interface_filament.value > 0 && m_print_config->filament_soluble.get_at(m_object_config->support_interface_filament.value - 1) && +// // Base extruder: Either "print with active extruder" not soluble. +// (m_object_config->support_filament.value == 0 || ! m_print_config->filament_soluble.get_at(m_object_config->support_filament.value - 1)); bool snug_supports = m_object_config->support_style.value == smsSnug; // BBS: if support interface and support base do not use the same filament, add a base layer to improve their adhesion bool differnt_support_interface_filament = m_object_config->support_interface_filament.value != m_object_config->support_filament.value; @@ -4628,7 +4621,6 @@ void PrintObjectSupportMaterial::generate_toolpaths( if (object_layer != nullptr) { float biggest_bridge_area = 0.f; - const Polygons& top_contact_polys = top_contact_layer.polygons_to_extrude(); for (auto layerm : object_layer->regions()) { for (auto bridge_surface : layerm->fill_surfaces.filter_by_type(stBottomBridge)) { float bs_area = bridge_surface->area(); diff --git a/src/libslic3r/TreeSupport.cpp b/src/libslic3r/TreeSupport.cpp index 71080cf20e..96b7c0cbef 100644 --- a/src/libslic3r/TreeSupport.cpp +++ b/src/libslic3r/TreeSupport.cpp @@ -5,7 +5,6 @@ #include "Print.hpp" #include "Layer.hpp" #include "Fill/FillBase.hpp" -#include "Fill/FillConcentric.hpp" #include "CurveAnalyzer.hpp" #include "SVG.hpp" #include "ShortestPath.hpp" @@ -13,7 +12,6 @@ #include #include -#include #include #define _L(s) Slic3r::I18N::translate(s) @@ -469,7 +467,6 @@ static bool move_inside_expolys(const ExPolygons& polygons, Point& from, double Point ret = from; std::vector valid_pts; double bestDist2 = std::numeric_limits::max(); - unsigned int bestPoly = NO_INDEX; bool is_already_on_correct_side_of_boundary = false; // whether [from] is already on the right side of the boundary Point inward_dir; for (unsigned int poly_idx = 0; poly_idx < polygons.size(); poly_idx++) @@ -510,7 +507,6 @@ static bool move_inside_expolys(const ExPolygons& polygons, Point& from, double if (dist2 < bestDist2) { bestDist2 = dist2; - bestPoly = poly_idx; if (distance == 0) { ret = x; } else { @@ -547,7 +543,6 @@ static bool move_inside_expolys(const ExPolygons& polygons, Point& from, double if (dist2 < bestDist2) { bestDist2 = dist2; - bestPoly = poly_idx; if (distance == 0) { ret = x; } else { @@ -632,7 +627,6 @@ static bool is_inside_ex(const ExPolygons &polygons, const Point &pt) static bool move_out_expolys(const ExPolygons& polygons, Point& from, double distance, double max_move_distance) { - Point from0 = from; ExPolygons polys_dilated = union_ex(offset_ex(polygons, scale_(distance))); Point pt = projection_onto(polys_dilated, from);// find_closest_ex(from, polys_dilated); Point outward_dir = pt - from; @@ -734,16 +728,12 @@ void TreeSupport::detect_overhangs(bool detect_first_sharp_tail_only) const coordf_t extrusion_width = config.get_abs_value("line_width", nozzle_diameter); const coordf_t extrusion_width_scaled = scale_(extrusion_width); const coordf_t max_bridge_length = scale_(config.max_bridge_length.value); - const bool bridge_no_support = max_bridge_length > 0; const bool support_critical_regions_only = config.support_critical_regions_only.value; const bool config_remove_small_overhangs = config.support_remove_small_overhang.value; const int enforce_support_layers = config.enforce_support_layers.value; const double area_thresh_well_supported = SQ(scale_(6)); const double length_thresh_well_supported = scale_(6); static const double sharp_tail_max_support_height = 16.f; - // a region is considered well supported if the number of layers below it exceeds this threshold - const int thresh_layers_below = 10 / config.layer_height; - double obj_height = m_object->size().z(); // +1 makes the threshold inclusive double thresh_angle = config.support_threshold_angle.value > EPSILON ? config.support_threshold_angle.value + 1 : 30; thresh_angle = std::min(thresh_angle, 89.); // should be smaller than 90 @@ -1406,7 +1396,6 @@ void TreeSupport::generate_toolpaths() const PrintObjectConfig &object_config = m_object->config(); coordf_t support_extrusion_width = m_support_params.support_extrusion_width; coordf_t nozzle_diameter = print_config.nozzle_diameter.get_at(object_config.support_filament - 1); - coordf_t layer_height = object_config.layer_height.value; const size_t wall_count = object_config.tree_support_wall_count.value; // Check if set to zero, use default if so. @@ -1420,8 +1409,6 @@ void TreeSupport::generate_toolpaths() coordf_t interface_density = std::min(1., m_support_material_interface_flow.spacing() / interface_spacing); coordf_t bottom_interface_density = std::min(1., m_support_material_interface_flow.spacing() / bottom_interface_spacing); - const coordf_t branch_radius = object_config.tree_support_branch_diameter.value / 2; - const coordf_t branch_radius_scaled = scale_(branch_radius); if (m_object->support_layers().empty()) return; @@ -2126,7 +2113,6 @@ void TreeSupport::draw_circles(const std::vector>& contact_no const bool with_lightning_infill = m_support_params.base_fill_pattern == ipLightning; coordf_t support_extrusion_width = m_support_params.support_extrusion_width; - const size_t wall_count = config.tree_support_wall_count.value; const PrintObjectConfig& object_config = m_object->config(); BOOST_LOG_TRIVIAL(info) << "draw_circles for object: " << m_object->model_object()->name; @@ -2377,7 +2363,7 @@ void TreeSupport::draw_circles(const std::vector>& contact_no ExPolygons& base_areas = ts_layer->base_areas; int layer_nr_lower = layer_nr - 1; - for (layer_nr_lower; layer_nr_lower >= 0; layer_nr_lower--) { + for (;layer_nr_lower >= 0; layer_nr_lower--) { if (!m_object->get_support_layer(layer_nr_lower + m_raft_layers)->area_groups.empty()) break; } if (layer_nr_lower <= 0) continue; @@ -2467,7 +2453,7 @@ void TreeSupport::draw_circles(const std::vector>& contact_no if (ts_layer->area_groups.empty()) continue; int layer_nr_lower = layer_nr - 1; - for (layer_nr_lower; layer_nr_lower >= 0; layer_nr_lower--) { + for (;layer_nr_lower >= 0; layer_nr_lower--) { if (!m_object->get_support_layer(layer_nr_lower + m_raft_layers)->area_groups.empty()) break; } if (layer_nr_lower < 0) continue; @@ -2582,15 +2568,10 @@ void TreeSupport::drop_nodes(std::vector>& contact_nodes) const coordf_t radius_sample_resolution = m_ts_data->m_radius_sample_resolution; const bool support_on_buildplate_only = config.support_on_build_plate_only.value; const size_t bottom_interface_layers = config.support_interface_bottom_layers.value; - const size_t top_interface_layers = config.support_interface_top_layers.value; float DO_NOT_MOVER_UNDER_MM = is_slim ? 0 : 5; // do not move contact points under 5mm const auto nozzle_diameter = m_object->print()->config().nozzle_diameter.get_at(m_object->config().support_interface_filament-1); const auto support_line_width = config.support_line_width.get_abs_value(nozzle_diameter); - auto get_branch_angle = [this,&config](coordf_t radius) { - if (config.tree_support_branch_angle.value < 30.0) return config.tree_support_branch_angle.value; - return (radius - MIN_BRANCH_RADIUS) / (MAX_BRANCH_RADIUS - MIN_BRANCH_RADIUS) * (config.tree_support_branch_angle.value - 30.0) + 30.0; - }; auto get_max_move_dist = [this, &config, branch_radius, tip_layers, diameter_angle_scale_factor, wall_count, support_extrusion_width, support_line_width](const Node *node, int power = 1) { double move_dist = node->max_move_dist; if (node->max_move_dist == 0) { @@ -3202,7 +3183,6 @@ void TreeSupport::adjust_layer_heights(std::vector>& contact_ const coordf_t layer_height = config.layer_height.value; const coordf_t max_layer_height = m_slicing_params.max_layer_height; const size_t bot_intf_layers = config.support_interface_bottom_layers.value; - const size_t top_intf_layers = config.support_interface_top_layers.value; // if already using max layer height, no need to adjust if (layer_height == max_layer_height) return; @@ -3324,7 +3304,6 @@ std::vector TreeSupport::plan_layer_heights(std::vector #include #include -#include namespace Slic3r { diff --git a/src/libslic3r/TriangulateWall.cpp b/src/libslic3r/TriangulateWall.cpp index b8746ef0d2..133ca8236c 100644 --- a/src/libslic3r/TriangulateWall.cpp +++ b/src/libslic3r/TriangulateWall.cpp @@ -1,5 +1,5 @@ -#include "TriangulateWall.hpp" -#include "MTUtils.hpp" +//#include "TriangulateWall.hpp" +//#include "MTUtils.hpp" namespace Slic3r { diff --git a/src/libslic3r/Triangulation.cpp b/src/libslic3r/Triangulation.cpp index f290442bf1..782553e2a7 100644 --- a/src/libslic3r/Triangulation.cpp +++ b/src/libslic3r/Triangulation.cpp @@ -1,6 +1,10 @@ #include "Triangulation.hpp" #include "IntersectionPoints.hpp" + +#ifndef _WIN32 +// On linux and macOS, this include is required #include +#endif // _WIN32 #include #include #include diff --git a/src/libslic3r/calib.cpp b/src/libslic3r/calib.cpp index f3890dd6dc..141a2203cc 100644 --- a/src/libslic3r/calib.cpp +++ b/src/libslic3r/calib.cpp @@ -465,8 +465,9 @@ std::string CalibPressureAdvanceLine::print_pa_lines(double start_x, double star const double e_per_mm = CalibPressureAdvance::e_per_mm(m_line_width, m_height_layer, m_nozzle_diameter, filament_diameter, print_flow_ratio); - const double thin_e_per_mm = CalibPressureAdvance::e_per_mm(m_thin_line_width, m_height_layer, m_nozzle_diameter, filament_diameter, - print_flow_ratio); + // Orca: Unused due to skip drawing indicator lines + // const double thin_e_per_mm = CalibPressureAdvance::e_per_mm(m_thin_line_width, m_height_layer, m_nozzle_diameter, filament_diameter, + // print_flow_ratio); const double number_e_per_mm = CalibPressureAdvance::e_per_mm(m_number_line_width, m_height_layer, m_nozzle_diameter, filament_diameter, print_flow_ratio); diff --git a/src/libslic3r/utils.cpp b/src/libslic3r/utils.cpp index 733ac626f4..362cc521b6 100644 --- a/src/libslic3r/utils.cpp +++ b/src/libslic3r/utils.cpp @@ -3,19 +3,12 @@ #include #include -#include #include #include #include "format.hpp" -#include "Platform.hpp" -#include "Time.hpp" #include "libslic3r.h" -#ifdef __APPLE__ -#include "MacUtils.hpp" -#endif - #ifdef WIN32 #include #include @@ -32,6 +25,7 @@ #ifdef __APPLE__ #include #include + #include "MacUtils.hpp" #endif #ifdef __linux__ #include @@ -39,6 +33,7 @@ #include #include #include + #include "Platform.hpp" #endif #endif @@ -59,7 +54,6 @@ #include #include #include -#include // We are using quite an old TBB 2017 U7, which does not support global control API officially. // Before we update our build servers, let's use the old API, which is deprecated in up to date TBB. @@ -1489,8 +1483,6 @@ bool bbl_calc_md5(std::string &filename, std::string &md5_out) MD5_Init(&ctx); boost::nowide::ifstream ifs(filename, std::ios::binary); std::string buf(64 * 1024, 0); - const std::size_t & size = boost::filesystem::file_size(filename); - std::size_t left_size = size; while (ifs) { ifs.read(buf.data(), buf.size()); int read_bytes = ifs.gcount(); diff --git a/src/slic3r/GUI/3DScene.cpp b/src/slic3r/GUI/3DScene.cpp index 86ab5d2239..e58b5c7eff 100644 --- a/src/slic3r/GUI/3DScene.cpp +++ b/src/slic3r/GUI/3DScene.cpp @@ -241,7 +241,7 @@ float GLVolume::last_explosion_ratio = 1.0; void GLVolume::set_render_color() { - bool outside = is_outside || is_below_printbed(); + // bool outside = is_outside || is_below_printbed(); if (force_native_color || force_neutral_color) { #ifdef ENABBLE_OUTSIDE_COLOR @@ -859,7 +859,6 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, bool disab return; GLShaderProgram* sink_shader = GUI::wxGetApp().get_shader("flat"); - GLShaderProgram* edges_shader = GUI::wxGetApp().get_shader("flat"); if (type == ERenderType::Transparent) { glsafe(::glEnable(GL_BLEND)); @@ -1023,7 +1022,6 @@ bool GLVolumeCollection::check_outside_state(const BuildVolume &build_volume, Mo GUI::PartPlate* curr_plate = GUI::wxGetApp().plater()->get_partplate_list().get_selected_plate(); const Pointfs& pp_bed_shape = curr_plate->get_shape(); BuildVolume plate_build_volume(pp_bed_shape, build_volume.printable_height()); - const std::vector& exclude_areas = curr_plate->get_exclude_areas(); for (GLVolume* volume : this->volumes) { diff --git a/src/slic3r/GUI/AMSMaterialsSetting.cpp b/src/slic3r/GUI/AMSMaterialsSetting.cpp index f44dc19917..b4c5e95646 100644 --- a/src/slic3r/GUI/AMSMaterialsSetting.cpp +++ b/src/slic3r/GUI/AMSMaterialsSetting.cpp @@ -331,7 +331,6 @@ void AMSMaterialsSetting::create_panel_kn(wxWindow* parent) kn_val_sizer->Add(m_input_k_val, 0, wxALL | wxEXPAND | wxALIGN_CENTER_VERTICAL, FromDIP(0)); // n params input - wxBoxSizer* n_sizer = new wxBoxSizer(wxHORIZONTAL); m_n_param = new wxStaticText(parent, wxID_ANY, _L("Factor N"), wxDefaultPosition, wxDefaultSize, 0); m_n_param->SetFont(::Label::Body_13); m_n_param->SetForegroundColour(wxColour(50, 58, 61)); @@ -357,7 +356,7 @@ void AMSMaterialsSetting::paintEvent(wxPaintEvent &evt) { auto size = GetSize(); wxPaintDC dc(this); - dc.SetPen(wxPen(StateColor::darkModeColorFor(wxColour("#000000")), 1, wxSOLID)); + dc.SetPen(wxPen(StateColor::darkModeColorFor(wxColour("#000000")), 1, wxPENSTYLE_SOLID)); dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH)); dc.DrawRectangle(0, 0, size.x, size.y); } diff --git a/src/slic3r/GUI/AmsMappingPopup.cpp b/src/slic3r/GUI/AmsMappingPopup.cpp index 492926b952..41abe5a471 100644 --- a/src/slic3r/GUI/AmsMappingPopup.cpp +++ b/src/slic3r/GUI/AmsMappingPopup.cpp @@ -366,7 +366,6 @@ void MaterialItem::doRender(wxDC &dc) wxString out_txt = m_msg; wxString count_txt = ""; - int new_line_pos = 0; for (int i = 0; i < m_msg.length(); i++) { auto text_size = m_warning_text->GetTextExtent(count_txt); @@ -402,7 +401,6 @@ void AmsMapingPopup::on_left_down(wxMouseEvent &evt) auto pos = ClientToScreen(evt.GetPosition()); for (MappingItem *item : m_mapping_item_list) { auto p_rect = item->ClientToScreen(wxPoint(0, 0)); - auto left = item->GetSize(); if (pos.x > p_rect.x && pos.y > p_rect.y && pos.x < (p_rect.x + item->GetSize().x) && pos.y < (p_rect.y + item->GetSize().y)) { if (item->m_tray_data.type == TrayType::NORMAL && !is_match_material(item->m_tray_data.filament_type)) return; @@ -1524,9 +1522,6 @@ void AmsRMGroup::on_mouse_move(wxMouseEvent& evt) std::string tray_name = iter->first; wxColour tray_color = iter->second; - int x = size.x / 2; - int y = size.y / 2; - int radius = size.x / 2; endAngle += ev_angle; if (click_angle >= startAngle && click_angle < endAngle) { diff --git a/src/slic3r/GUI/Auxiliary.cpp b/src/slic3r/GUI/Auxiliary.cpp index 8d338edc21..5bc3280e75 100644 --- a/src/slic3r/GUI/Auxiliary.cpp +++ b/src/slic3r/GUI/Auxiliary.cpp @@ -989,7 +989,7 @@ void AuxiliaryPanel::create_folder(wxString name) fs::path bfs_path((m_root_dir + "/" + folder_name).ToStdWstring()); if (fs::exists(bfs_path)) { try { - bool is_done = fs::remove_all(bfs_path); + fs::remove_all(bfs_path); } catch (...) { BOOST_LOG_TRIVIAL(error) << "Failed removing the auxiliary directory " << m_root_dir.c_str(); } diff --git a/src/slic3r/GUI/AuxiliaryDataViewModel.cpp b/src/slic3r/GUI/AuxiliaryDataViewModel.cpp index 50368b8544..cad5cf5455 100644 --- a/src/slic3r/GUI/AuxiliaryDataViewModel.cpp +++ b/src/slic3r/GUI/AuxiliaryDataViewModel.cpp @@ -337,7 +337,7 @@ wxDataViewItemArray AuxiliaryModel::ImportFile(AuxiliaryModelNode* sel, wxArrayS dir_path += "\\" + src_bfs_path.filename().generic_wstring(); boost::system::error_code ec; - if (!fs::copy_file(src_bfs_path, fs::path(dir_path.ToStdWstring()), fs::copy_option::overwrite_if_exists, ec)) + if (!fs::copy_file(src_bfs_path, fs::path(dir_path.ToStdWstring()), fs::copy_options::overwrite_existing, ec)) continue; // Update model data diff --git a/src/slic3r/GUI/BBLStatusBar.cpp b/src/slic3r/GUI/BBLStatusBar.cpp index 7c3d640d6e..b0d3513f59 100644 --- a/src/slic3r/GUI/BBLStatusBar.cpp +++ b/src/slic3r/GUI/BBLStatusBar.cpp @@ -3,8 +3,6 @@ #include #include #include -#include -#include #include "GUI_App.hpp" diff --git a/src/slic3r/GUI/BBLTopbar.cpp b/src/slic3r/GUI/BBLTopbar.cpp index 0bf251d729..30d4878ddf 100644 --- a/src/slic3r/GUI/BBLTopbar.cpp +++ b/src/slic3r/GUI/BBLTopbar.cpp @@ -230,7 +230,7 @@ void BBLTopbar::Init(wxFrame* parent) this->AddSpacer(FromDIP(10)); wxBitmap save_bitmap = create_scaled_bitmap("topbar_save", nullptr, TOPBAR_ICON_SIZE); - wxAuiToolBarItem* save_btn = this->AddTool(wxID_SAVE, "", save_bitmap); + this->AddTool(wxID_SAVE, "", save_bitmap); this->AddSpacer(FromDIP(10)); @@ -278,7 +278,7 @@ void BBLTopbar::Init(wxFrame* parent) this->AddSpacer(FromDIP(4)); wxBitmap iconize_bitmap = create_scaled_bitmap("topbar_min", nullptr, TOPBAR_ICON_SIZE); - wxAuiToolBarItem* iconize_btn = this->AddTool(wxID_ICONIZE_FRAME, "", iconize_bitmap); + this->AddTool(wxID_ICONIZE_FRAME, "", iconize_bitmap); this->AddSpacer(FromDIP(4)); @@ -294,7 +294,7 @@ void BBLTopbar::Init(wxFrame* parent) this->AddSpacer(FromDIP(4)); wxBitmap close_bitmap = create_scaled_bitmap("topbar_close", nullptr, TOPBAR_ICON_SIZE); - wxAuiToolBarItem* close_btn = this->AddTool(wxID_CLOSE_FRAME, "", close_bitmap); + this->AddTool(wxID_CLOSE_FRAME, "", close_bitmap); Realize(); // m_toolbar_h = this->GetSize().GetHeight(); @@ -466,7 +466,6 @@ void BBLTopbar::UpdateToolbarWidth(int width) } void BBLTopbar::Rescale() { - int em = em_unit(this); wxAuiToolBarItem* item; /*item = this->FindTool(ID_LOGO); @@ -496,7 +495,7 @@ void BBLTopbar::Rescale() { item->SetBitmap(create_scaled_bitmap("calib_sf", nullptr, TOPBAR_ICON_SIZE)); item->SetDisabledBitmap(create_scaled_bitmap("calib_sf_inactive", nullptr, TOPBAR_ICON_SIZE)); - item = this->FindTool(ID_TITLE); + // item = this->FindTool(ID_TITLE); /*item = this->FindTool(ID_PUBLISH); item->SetBitmap(create_scaled_bitmap("topbar_publish", this, TOPBAR_ICON_SIZE)); @@ -548,14 +547,14 @@ void BBLTopbar::OnCloseFrame(wxAuiToolBarEvent& event) void BBLTopbar::OnMouseLeftDClock(wxMouseEvent& mouse) { - wxPoint mouse_pos = ::wxGetMousePosition(); // check whether mouse is not on any tool item if (this->FindToolByCurrentPosition() != NULL && this->FindToolByCurrentPosition() != m_title_item) { mouse.Skip(); return; } -#ifdef __W1XMSW__ +#ifdef __WXMSW__ + wxPoint mouse_pos = ::wxGetMousePosition(); ::PostMessage((HWND) m_frame->GetHandle(), WM_NCLBUTTONDBLCLK, HTCAPTION, MAKELPARAM(mouse_pos.x, mouse_pos.y)); return; #endif // __WXMSW__ @@ -637,7 +636,6 @@ void BBLTopbar::OnMouseLeftDown(wxMouseEvent& event) void BBLTopbar::OnMouseLeftUp(wxMouseEvent& event) { - wxPoint mouse_pos = ::wxGetMousePosition(); if (HasCapture()) { ReleaseMouse(); diff --git a/src/slic3r/GUI/BackgroundSlicingProcess.cpp b/src/slic3r/GUI/BackgroundSlicingProcess.cpp index ca8c7a1663..1f6c9e4b94 100644 --- a/src/slic3r/GUI/BackgroundSlicingProcess.cpp +++ b/src/slic3r/GUI/BackgroundSlicingProcess.cpp @@ -5,13 +5,9 @@ #include "format.hpp" #include -#include -#include // For zipped archive creation -#include #include -#include #include @@ -20,23 +16,18 @@ #include "libslic3r/SLAPrint.hpp" #include "libslic3r/Utils.hpp" #include "libslic3r/GCode/PostProcessor.hpp" -#include "libslic3r/Format/SL1.hpp" #include "libslic3r/Thread.hpp" #include "libslic3r/libslic3r.h" #include #include -#include #include #include #include -#include #include "I18N.hpp" //#include "RemovableDriveManager.hpp" -#include "slic3r/GUI/Plater.hpp" - namespace Slic3r { bool SlicingProcessCompletedEvent::critical_error() const diff --git a/src/slic3r/GUI/BindDialog.cpp b/src/slic3r/GUI/BindDialog.cpp index 134d91e7c5..28360f0d7a 100644 --- a/src/slic3r/GUI/BindDialog.cpp +++ b/src/slic3r/GUI/BindDialog.cpp @@ -67,7 +67,6 @@ PingCodeBindDialog::PingCodeBindDialog(Plater* plater /*= nullptr*/) SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO)); SetBackgroundColour(*wxWHITE); - wxBoxSizer* m_sizer_main = new wxBoxSizer(wxVERTICAL); auto m_line_top = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL); m_line_top->SetBackgroundColour(wxColour(166, 169, 170)); diff --git a/src/slic3r/GUI/CalibrationPanel.cpp b/src/slic3r/GUI/CalibrationPanel.cpp index 9a16c13322..94a3186721 100644 --- a/src/slic3r/GUI/CalibrationPanel.cpp +++ b/src/slic3r/GUI/CalibrationPanel.cpp @@ -226,7 +226,7 @@ SelectMObjectPopup::SelectMObjectPopup(wxWindow* parent) m_refresh_timer = new wxTimer(); m_refresh_timer->SetOwner(this); Bind(EVT_UPDATE_USER_MLIST, &SelectMObjectPopup::update_machine_list, this); - Bind(wxEVT_TIMER, &SelectMObjectPopup::on_timer, this); + Bind(wxEVT_TIMER, [this](wxTimerEvent&) { on_timer(); }); Bind(EVT_DISSMISS_MACHINE_LIST, &SelectMObjectPopup::on_dissmiss_win, this); } @@ -265,7 +265,7 @@ void SelectMObjectPopup::Popup(wxWindow* WXUNUSED(focus)) } } - wxPostEvent(this, wxTimerEvent()); + on_timer(); PopupWindow::Popup(); } @@ -304,7 +304,7 @@ bool SelectMObjectPopup::Show(bool show) { return PopupWindow::Show(show); } -void SelectMObjectPopup::on_timer(wxTimerEvent& event) +void SelectMObjectPopup::on_timer() { BOOST_LOG_TRIVIAL(trace) << "SelectMObjectPopup on_timer"; wxGetApp().reset_to_active(); @@ -459,7 +459,7 @@ CalibrationPanel::CalibrationPanel(wxWindow* parent, wxWindowID id, const wxPoin Layout(); init_timer(); - Bind(wxEVT_TIMER, &CalibrationPanel::on_timer, this); + Bind(wxEVT_TIMER, [this](wxTimerEvent&) { on_timer(); }); } void CalibrationPanel::init_tabpanel() { @@ -502,10 +502,10 @@ void CalibrationPanel::init_timer() m_refresh_timer = new wxTimer(); m_refresh_timer->SetOwner(this); m_refresh_timer->Start(REFRESH_INTERVAL); - wxPostEvent(this, wxTimerEvent()); + on_timer(); } -void CalibrationPanel::on_timer(wxTimerEvent& event) { +void CalibrationPanel::on_timer() { update_all(); } @@ -644,7 +644,7 @@ bool CalibrationPanel::Show(bool show) { m_refresh_timer->Stop(); m_refresh_timer->SetOwner(this); m_refresh_timer->Start(REFRESH_INTERVAL); - wxPostEvent(this, wxTimerEvent()); + on_timer(); DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager(); if (dev) { @@ -670,9 +670,6 @@ bool CalibrationPanel::Show(bool show) { void CalibrationPanel::on_printer_clicked(wxMouseEvent& event) { - auto mouse_pos = ClientToScreen(event.GetPosition()); - wxPoint rect = m_side_tools->ClientToScreen(wxPoint(0, 0)); - if (!m_side_tools->is_in_interval()) { wxPoint pos = m_side_tools->ClientToScreen(wxPoint(0, 0)); pos.y += m_side_tools->GetRect().height; diff --git a/src/slic3r/GUI/CalibrationPanel.hpp b/src/slic3r/GUI/CalibrationPanel.hpp index a993ff2886..7b56abd8e7 100644 --- a/src/slic3r/GUI/CalibrationPanel.hpp +++ b/src/slic3r/GUI/CalibrationPanel.hpp @@ -94,7 +94,7 @@ private: private: void OnLeftUp(wxMouseEvent& event); - void on_timer(wxTimerEvent& event); + void on_timer(); void update_user_devices(); void on_dissmiss_win(wxCommandEvent& event); }; @@ -117,7 +117,7 @@ public: protected: void init_tabpanel(); void init_timer(); - void on_timer(wxTimerEvent& event); + void on_timer(); int last_status; diff --git a/src/slic3r/GUI/CalibrationWizard.cpp b/src/slic3r/GUI/CalibrationWizard.cpp index f6cbbc3065..6280c96402 100644 --- a/src/slic3r/GUI/CalibrationWizard.cpp +++ b/src/slic3r/GUI/CalibrationWizard.cpp @@ -1126,7 +1126,6 @@ void FlowRateWizard::on_cali_save() } std::string old_preset_name; - CalibrationPresetPage* preset_page = (static_cast(preset_step->page)); std::map selected_filaments = get_cached_selected_filament(curr_obj); if (!selected_filaments.empty()) { old_preset_name = selected_filaments.begin()->second->name; @@ -1173,7 +1172,6 @@ void FlowRateWizard::on_cali_save() return; std::string old_preset_name; - CalibrationPresetPage* preset_page = (static_cast(preset_step->page)); std::map selected_filaments = get_cached_selected_filament(curr_obj); if (!selected_filaments.empty()) { old_preset_name = selected_filaments.begin()->second->name; @@ -1443,7 +1441,6 @@ void MaxVolumetricSpeedWizard::on_cali_save() std::string old_preset_name; std::string new_preset_name; - CalibrationPresetPage *preset_page = (static_cast(preset_step->page)); std::map selected_filaments = get_cached_selected_filament(curr_obj); if (!selected_filaments.empty()) { old_preset_name = selected_filaments.begin()->second->name; diff --git a/src/slic3r/GUI/CalibrationWizardPresetPage.cpp b/src/slic3r/GUI/CalibrationWizardPresetPage.cpp index 482ce61a12..f972d22988 100644 --- a/src/slic3r/GUI/CalibrationWizardPresetPage.cpp +++ b/src/slic3r/GUI/CalibrationWizardPresetPage.cpp @@ -790,7 +790,6 @@ wxString CalibrationPresetPage::format_text(wxString& m_msg) wxString out_txt = m_msg; wxString count_txt = ""; - int new_line_pos = 0; for (int i = 0; i < m_msg.length(); i++) { auto text_size = m_statictext_printer_msg->GetTextExtent(count_txt); diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index baa53d4564..cd729cae45 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -282,7 +282,6 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con } double sparse_infill_density = config->option("sparse_infill_density")->value; - auto timelapse_type = config->opt_enum("timelapse_type"); if (!is_plate_config && config->opt_bool("spiral_mode") && @@ -298,7 +297,6 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con { DynamicPrintConfig new_conf = *config; auto answer = show_spiral_mode_settings_dialog(is_object_config); - bool support = true; if (answer == wxID_YES) { new_conf.set_key_value("wall_loops", new ConfigOptionInt(1)); new_conf.set_key_value("top_shell_layers", new ConfigOptionInt(0)); @@ -310,8 +308,6 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con new_conf.set_key_value("wall_direction", new ConfigOptionEnum(WallDirection::Auto)); new_conf.set_key_value("timelapse_type", new ConfigOptionEnum(tlTraditional)); sparse_infill_density = 0; - timelapse_type = TimelapseType::tlTraditional; - support = false; } else { new_conf.set_key_value("spiral_mode", new ConfigOptionBool(false)); diff --git a/src/slic3r/GUI/ConfigWizard.cpp b/src/slic3r/GUI/ConfigWizard.cpp index 1768d8cd47..fd00db7f78 100644 --- a/src/slic3r/GUI/ConfigWizard.cpp +++ b/src/slic3r/GUI/ConfigWizard.cpp @@ -2438,7 +2438,7 @@ bool ConfigWizard::priv::apply_config(AppConfig *app_config, PresetBundle *prese header = _L_PLURAL("A new vendor was installed and one of its printers will be activated", "New vendors were installed and one of theirs printers will be activated", install_bundles.size()); // Decide whether to create snapshot based on run_reason and the reset profile checkbox - bool snapshot = true; + /*bool snapshot = true; Snapshot::Reason snapshot_reason = Snapshot::SNAPSHOT_UPGRADE; switch (run_reason) { case ConfigWizard::RR_DATA_EMPTY: @@ -2456,7 +2456,7 @@ bool ConfigWizard::priv::apply_config(AppConfig *app_config, PresetBundle *prese snapshot = false; snapshot_reason = Snapshot::SNAPSHOT_USER; break; - } + }*/ //BBS: remove snapshot logic /*if (snapshot && ! take_config_snapshot_cancel_on_error(*app_config, snapshot_reason, "", _u8L("Do you want to continue changing the configuration?"))) @@ -2701,8 +2701,7 @@ ConfigWizard::ConfigWizard(wxWindow *parent) //BBS: add BBL as default const auto bbl_it = p->bundles.find("BBL"); wxCHECK_RET(bbl_it != p->bundles.cend(), "Vendor BambooLab not found"); - const VendorProfile * vendor_bbl = bbl_it->second.vendor_profile; - + p->only_sla_mode = false; p->any_sla_selected = p->check_sla_selected(); if (p->only_sla_mode) diff --git a/src/slic3r/GUI/CreatePresetsDialog.cpp b/src/slic3r/GUI/CreatePresetsDialog.cpp index e02509c2a7..cebe58fc0e 100644 --- a/src/slic3r/GUI/CreatePresetsDialog.cpp +++ b/src/slic3r/GUI/CreatePresetsDialog.cpp @@ -315,7 +315,7 @@ static wxBoxSizer *create_preset_tree(wxWindow *parent, std::pair preset : printer_and_preset.second) { wxString preset_name = wxString::FromUTF8(preset->name); - wxTreeItemId childId1 = treeCtrl->AppendItem(rootId, preset_name); + treeCtrl->AppendItem(rootId, preset_name); row++; } @@ -671,8 +671,6 @@ bool CreateFilamentPresetDialog::is_check_box_selected() wxBoxSizer *CreateFilamentPresetDialog::create_item(FilamentOptionType option_type) { - - wxSizer *item = nullptr; switch (option_type) { case VENDOR: return create_vendor_item(); case TYPE: return create_type_item(); @@ -3092,10 +3090,6 @@ bool CreatePrinterPresetDialog::check_printable_area() { if (x == 0 || y == 0) { return false; } - double x0 = 0.0; - double y0 = 0.0; - double x1 = x; - double y1 = y; if (dx >= x || dy >= y) { return false; } @@ -4633,7 +4627,6 @@ wxBoxSizer *EditFilamentPresetDialog::create_button_sizer() WarningDialog dlg(this, _L("All the filament presets belong to this filament would be deleted. \nIf you are using this filament on your printer, please reset the filament information for that slot."), _L("Delete filament"), wxYES | wxCANCEL | wxCANCEL_DEFAULT | wxCENTRE); int res = dlg.ShowModal(); if (wxID_YES == res) { - PresetBundle *preset_bundle = wxGetApp().preset_bundle; std::set> inherit_preset_names; std::set> root_preset_names; for (std::pair>> printer_and_preset : m_printer_compatible_presets) { diff --git a/src/slic3r/GUI/DailyTips.cpp b/src/slic3r/GUI/DailyTips.cpp index 2e5b99e8b2..ba4427964e 100644 --- a/src/slic3r/GUI/DailyTips.cpp +++ b/src/slic3r/GUI/DailyTips.cpp @@ -89,7 +89,6 @@ void DailyTipsDataRenderer::open_wiki() const void DailyTipsDataRenderer::render(const ImVec2& pos, const ImVec2& size) const { - ImGuiWrapper& imgui = *wxGetApp().imgui(); ImGuiWindow* parent_window = ImGui::GetCurrentWindow(); int window_flags = parent_window->Flags; window_flags &= ~ImGuiWindowFlags_NoScrollbar; @@ -190,7 +189,6 @@ void DailyTipsDataRenderer::render_text(const ImVec2& start_pos, const ImVec2& s std::string tips_line = _u8L("For more information, please check out Wiki"); std::string wiki_part_text = _u8L("Wiki"); std::string first_part_text = tips_line.substr(0, tips_line.find(wiki_part_text)); - ImVec2 wiki_part_size = ImGui::CalcTextSize(wiki_part_text.c_str()); ImVec2 first_part_size = ImGui::CalcTextSize(first_part_text.c_str()); //text @@ -200,7 +198,6 @@ void DailyTipsDataRenderer::render_text(const ImVec2& start_pos, const ImVec2& s ImColor HyperColor = ImColor(31, 142, 234, (int)(255 * m_fade_opacity)).Value; ImVec2 wiki_part_rect_min = ImVec2(link_start_pos.x + first_part_size.x, link_start_pos.y); - ImVec2 wiki_part_rect_max = wiki_part_rect_min + wiki_part_size; ImGui::PushStyleColor(ImGuiCol_Text, HyperColor.Value); ImGui::SetCursorScreenPos(wiki_part_rect_min); imgui.text(wiki_part_text.c_str()); @@ -264,9 +261,6 @@ ImVec2 DailyTipsPanel::get_size() void DailyTipsPanel::render() { - ImGuiWrapper& imgui = *wxGetApp().imgui(); - float scale = imgui.get_font_size() / 15.0f; - if (!m_first_enter) { retrieve_data_from_hint_database(HintDataNavigation::Curr); m_first_enter = true; diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index a79dd0a027..28a5523b22 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -1007,17 +1007,17 @@ int MachineObject::ams_filament_mapping(std::vector filaments, std reset_mapping_result(result); try { // try to use ordering ams mapping - bool order_mapping_result = true; + // bool order_mapping_result = true; for (int i = 0; i < filaments.size(); i++) { if (i >= tray_info_list.size()) { - order_mapping_result = false; + // order_mapping_result = false; break; } if (tray_info_list[i].tray_id == -1) { result[i].tray_id = tray_info_list[i].tray_id; } else { if (!tray_info_list[i].type.empty() && tray_info_list[i].type != filaments[i].type) { - order_mapping_result = false; + // order_mapping_result = false; break; } else { result[i].tray_id = tray_info_list[i].tray_id; @@ -1319,7 +1319,6 @@ wxString MachineObject::get_curr_stage() int MachineObject::get_curr_stage_idx() { - int result = -1; for (int i = 0; i < stage_list_info.size(); i++) { if (stage_list_info[i] == stage_curr) { return i; @@ -2349,8 +2348,6 @@ int MachineObject::command_xcam_control(std::string module_name, bool on_off, st int MachineObject::command_xcam_control_ai_monitoring(bool on_off, std::string lvl) { - bool print_halt = (lvl == "never_halt") ? false:true; - xcam_ai_monitoring = on_off; xcam_ai_monitoring_hold_count = HOLD_COUNT_MAX; xcam_ai_monitoring_sensitivity = lvl; @@ -5662,9 +5659,7 @@ void DeviceManager::parse_user_print_info(std::string body) } } } - catch (std::exception& e) { - ; - } + catch (std::exception&) {} } void DeviceManager::update_user_machine_list_info() diff --git a/src/slic3r/GUI/DownloadProgressDialog.cpp b/src/slic3r/GUI/DownloadProgressDialog.cpp index 542db08561..425c2deb3b 100644 --- a/src/slic3r/GUI/DownloadProgressDialog.cpp +++ b/src/slic3r/GUI/DownloadProgressDialog.cpp @@ -128,7 +128,6 @@ wxString DownloadProgressDialog::format_text(wxStaticText* st, wxString str, int wxString out_txt = str; wxString count_txt = ""; - int new_line_pos = 0; for (int i = 0; i < str.length(); i++) { auto text_size = st->GetTextExtent(count_txt); diff --git a/src/slic3r/GUI/ExtrusionCalibration.cpp b/src/slic3r/GUI/ExtrusionCalibration.cpp index 26216edc93..eda9da5857 100644 --- a/src/slic3r/GUI/ExtrusionCalibration.cpp +++ b/src/slic3r/GUI/ExtrusionCalibration.cpp @@ -626,7 +626,6 @@ void ExtrusionCalibration::update_combobox_filaments() { m_comboBox_filament->SetValue(wxEmptyString); user_filaments.clear(); - int selection_idx = -1; int filament_index = -1; int curr_selection = -1; wxArrayString filament_items; diff --git a/src/slic3r/GUI/FileArchiveDialog.cpp b/src/slic3r/GUI/FileArchiveDialog.cpp index 2cd84b6acd..689b31598d 100644 --- a/src/slic3r/GUI/FileArchiveDialog.cpp +++ b/src/slic3r/GUI/FileArchiveDialog.cpp @@ -2,7 +2,6 @@ #include "I18N.hpp" #include "GUI_App.hpp" -#include "GUI.hpp" #include "MainFrame.hpp" #include "ExtraRenderers.hpp" #include "format.hpp" diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 0d649b9a6a..b35ade0be4 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -1447,9 +1447,6 @@ void GCodeViewer::_render_calibration_thumbnail_internal(ThumbnailData& thumbnai //shader->set_uniform("emission_factor", 0.0f); } else { - switch (buffer.render_primitive_type) { - default: break; - } int uniform_color = shader->get_uniform_location("uniform_color"); auto it_path = buffer.render_paths.begin(); for (unsigned int ibuffer_id = 0; ibuffer_id < static_cast(buffer.indices.size()); ++ibuffer_id) { @@ -1747,10 +1744,10 @@ void GCodeViewer::update_layers_slider_mode() // true -> single-extruder printer profile OR // multi-extruder printer profile , but whole model is printed by only one extruder // false -> multi-extruder printer profile , and model is printed by several extruders - bool one_extruder_printed_model = true; + // bool one_extruder_printed_model = true; // extruder used for whole model for multi-extruder printer profile - int only_extruder = -1; + // int only_extruder = -1; // BBS if (wxGetApp().filaments_cnt() > 1) { @@ -1773,10 +1770,10 @@ void GCodeViewer::update_layers_slider_mode() return true; }; - if (is_one_extruder_printed_model()) - only_extruder = extruder; - else - one_extruder_printed_model = false; + // if (is_one_extruder_printed_model()) + // only_extruder = extruder; + // else + // one_extruder_printed_model = false; } } @@ -3247,12 +3244,6 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool return in_layers_range(path.sub_paths.front().first.s_id) && in_layers_range(path.sub_paths.back().last.s_id); }; - //BBS - auto is_extruder_in_layer_range = [this](const Path& path, size_t extruder_id) { - return path.extruder_id == extruder_id; - }; - - auto is_travel_in_layers_range = [this](size_t path_id, size_t min_id, size_t max_id) { const TBuffer& buffer = m_buffers[buffer_id(EMoveType::Travel)]; if (path_id >= buffer.paths.size()) @@ -4097,7 +4088,6 @@ void GCodeViewer::render_all_plates_stats(const std::vector support_used_filaments_g_all_plates; float total_time_all_plates = 0.0f; float total_cost_all_plates = 0.0f; - bool show_detailed_statistics_page = false; struct ColumnData { enum { Model = 1, @@ -4399,7 +4389,6 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv const float icon_size = ImGui::GetTextLineHeight() * 0.7; //BBS GUI refactor //const float percent_bar_size = 2.0f * ImGui::GetTextLineHeight(); - const float percent_bar_size = 0; bool imperial_units = wxGetApp().app_config->get("use_inches") == "1"; ImDrawList* draw_list = ImGui::GetWindowDrawList(); @@ -4511,7 +4500,6 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv append_range_item(0, range.min, decimals); } else { - const float step_size = range.step_size(); for (int i = static_cast(Range_Colors.size()) - 1; i >= 0; --i) { append_range_item(i, range.get_value_at_step(i), decimals); } @@ -4560,7 +4548,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv return ret; }; - auto color_print_ranges = [this](unsigned char extruder_id, const std::vector& custom_gcode_per_print_z) { + /*auto color_print_ranges = [this](unsigned char extruder_id, const std::vector& custom_gcode_per_print_z) { std::vector>> ret; ret.reserve(custom_gcode_per_print_z.size()); @@ -4589,27 +4577,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv } return ret; - }; - - auto upto_label = [](double z) { - char buf[64]; - ::sprintf(buf, "%.2f", z); - return _u8L("up to") + " " + std::string(buf) + " " + _u8L("mm"); - }; - - auto above_label = [](double z) { - char buf[64]; - ::sprintf(buf, "%.2f", z); - return _u8L("above") + " " + std::string(buf) + " " + _u8L("mm"); - }; - - auto fromto_label = [](double z1, double z2) { - char buf1[64]; - ::sprintf(buf1, "%.2f", z1); - char buf2[64]; - ::sprintf(buf2, "%.2f", z2); - return _u8L("from") + " " + std::string(buf1) + " " + _u8L("to") + " " + std::string(buf2) + " " + _u8L("mm"); - }; + };*/ auto role_time_and_percent = [time_mode](ExtrusionRole role) { auto it = std::find_if(time_mode.roles_times.begin(), time_mode.roles_times.end(), [role](const std::pair& item) { return role == item.first; }); @@ -5106,7 +5074,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv ImGuiWindow* window = ImGui::GetCurrentWindow(); const ImRect separator(ImVec2(window->Pos.x + window_padding * 3, window->DC.CursorPos.y), ImVec2(window->Pos.x + window->Size.x - window_padding * 3, window->DC.CursorPos.y + 1.0f)); ImGui::ItemSize(ImVec2(0.0f, 0.0f)); - const bool item_visible = ImGui::ItemAdd(separator, 0); + ImGui::ItemAdd(separator, 0); window->DrawList->AddLine(separator.Min, ImVec2(separator.Max.x, separator.Min.y), ImGui::GetColorU32(ImGuiCol_Separator)); std::vector> columns_offsets; @@ -5228,7 +5196,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv return items; }; - auto append_color_change = [&imgui](const ColorRGBA& color1, const ColorRGBA& color2, const std::array& offsets, const Times& times) { + /*auto append_color_change = [&imgui](const ColorRGBA& color1, const ColorRGBA& color2, const std::array& offsets, const Times& times) { imgui.text(_u8L("Color change")); ImGui::SameLine(); @@ -5245,9 +5213,9 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv ImGui::SameLine(offsets[0]); imgui.text(short_time(get_time_dhms(times.second - times.first))); - }; + };*/ - auto append_print = [&imgui, imperial_units](const ColorRGBA& color, const std::array& offsets, const Times& times, std::pair used_filament) { + /*auto append_print = [&imgui, imperial_units](const ColorRGBA& color, const std::array& offsets, const Times& times, std::pair used_filament) { imgui.text(_u8L("Print")); ImGui::SameLine(); @@ -5273,7 +5241,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv ::sprintf(buffer, "%.2f g", used_filament.second); imgui.text(buffer); } - }; + };*/ PartialTimes partial_times = generate_partial_times(time_mode.custom_gcode_times, m_print_statistics.volumes_per_color_change); if (!partial_times.empty()) { @@ -5380,7 +5348,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv // } //} - auto any_option_available = [this]() { +/* auto any_option_available = [this]() { auto available = [this](EMoveType type) { const TBuffer& buffer = m_buffers[buffer_id(type)]; return buffer.visible && buffer.has_data(); @@ -5393,7 +5361,7 @@ void GCodeViewer::render_legend(float &legend_height, int canvas_width, int canv available(EMoveType::Tool_change) || available(EMoveType::Unretract) || available(EMoveType::Seam); - }; + };*/ //auto add_option = [this, append_item](EMoveType move_type, EOptionsColors color, const std::string& text) { // const TBuffer& buffer = m_buffers[buffer_id(move_type)]; diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index ca03a36393..2af35b86a1 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2773,7 +2773,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re ModelInstanceEPrintVolumeState state; const bool contained_min_one = m_volumes.check_outside_state(m_bed.build_volume(), &state); const bool partlyOut = (state == ModelInstanceEPrintVolumeState::ModelInstancePVS_Partly_Outside); - const bool fullyOut = (state == ModelInstanceEPrintVolumeState::ModelInstancePVS_Fully_Outside); + // const bool fullyOut = (state == ModelInstanceEPrintVolumeState::ModelInstancePVS_Fully_Outside); _set_warning_notification(EWarning::ObjectClashed, partlyOut); //BBS: turn off the warning when fully outside @@ -4080,12 +4080,12 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) // Set focus in order to remove it from sidebar fields if (m_canvas != nullptr) { // Only set focus, if the top level window of this canvas is active. - auto p = dynamic_cast(evt.GetEventObject()); - while (p->GetParent()) - p = p->GetParent(); - auto *top_level_wnd = dynamic_cast(p); - if (top_level_wnd && top_level_wnd->IsActive() && !wxGetApp().get_side_menu_popup_status()) - ;// m_canvas->SetFocus(); +// auto p = dynamic_cast(evt.GetEventObject()); +// while (p->GetParent()) +// p = p->GetParent(); +// auto *top_level_wnd = dynamic_cast(p); +// if (top_level_wnd && top_level_wnd->IsActive() && !wxGetApp().get_side_menu_popup_status()) + // m_canvas->SetFocus(); m_mouse.position = pos.cast(); m_tooltip_enabled = false; // 1) forces a frame render to ensure that m_hover_volume_idxs is updated even when the user right clicks while @@ -5085,7 +5085,6 @@ std::vector GLCanvas3D::get_empty_cells(const Vec2f start_point, const Ve } for (size_t i = 0; i < m_model->objects.size(); ++i) { ModelObject* model_object = m_model->objects[i]; - auto id = model_object->id().id; ModelInstance* model_instance0 = model_object->instances.front(); Polygon hull_2d = model_object->convex_hull_2d(Geometry::assemble_transform({ 0.0, 0.0, model_instance0->get_offset().z() }, model_instance0->get_rotation(), model_instance0->get_scaling_factor(), model_instance0->get_mirror())); @@ -5356,7 +5355,6 @@ void GLCanvas3D::update_sequential_clearance() for (int i = k+1; i < bounding_box_count; i++) { - Polygon& next_convex = convex_and_bounding_boxes[i].hull_polygon; BoundingBox& next_bbox = convex_and_bounding_boxes[i].bounding_box; auto py1 = next_bbox.min.y(); auto py2 = next_bbox.max.y(); @@ -5417,7 +5415,6 @@ bool GLCanvas3D::_render_orient_menu(float left, float right, float bottom, floa ImGuiWrapper* imgui = wxGetApp().imgui(); auto canvas_w = float(get_canvas_size().get_width()); - auto canvas_h = float(get_canvas_size().get_height()); //BBS: GUI refactor: move main toolbar to the right //original use center as {0.0}, and top is (canvas_h/2), bottom is (-canvas_h/2), also plus inv_camera //now change to left_up as {0,0}, and top is 0, bottom is canvas_h @@ -5426,6 +5423,7 @@ bool GLCanvas3D::_render_orient_menu(float left, float right, float bottom, floa ImGuiWrapper::push_toolbar_style(get_scale()); imgui->set_next_window_pos(x, m_main_toolbar.get_height(), ImGuiCond_Always, 0.5f, 0.0f); #else + auto canvas_h = float(get_canvas_size().get_height()); const float x = canvas_w - m_main_toolbar.get_width(); const float y = 0.5f * canvas_h - top * float(wxGetApp().plater()->get_camera().get_zoom()); imgui->set_next_window_pos(x, y, ImGuiCond_Always, 1.0f, 0.0f); @@ -5440,13 +5438,13 @@ bool GLCanvas3D::_render_orient_menu(float left, float right, float bottom, floa PrinterTechnology ptech = current_printer_technology(); bool settings_changed = false; - float angle_min = 45.f; + // float angle_min = 45.f; std::string angle_key = "overhang_angle", rot_key = "enable_rotation"; std::string key_min_area = "min_area"; std::string postfix = "_fff"; if (ptech == ptSLA) { - angle_min = 45.f; + // angle_min = 45.f; postfix = "_sla"; } @@ -5502,7 +5500,6 @@ bool GLCanvas3D::_render_arrange_menu(float left, float right, float bottom, flo ImGuiWrapper *imgui = wxGetApp().imgui(); auto canvas_w = float(get_canvas_size().get_width()); - auto canvas_h = float(get_canvas_size().get_height()); //BBS: GUI refactor: move main toolbar to the right //original use center as {0.0}, and top is (canvas_h/2), bottom is (-canvas_h/2), also plus inv_camera //now change to left_up as {0,0}, and top is 0, bottom is canvas_h @@ -5510,8 +5507,8 @@ bool GLCanvas3D::_render_arrange_menu(float left, float right, float bottom, flo float left_pos = m_main_toolbar.get_item("arrange")->render_left_pos; const float x = (1 + left_pos) * canvas_w / 2; imgui->set_next_window_pos(x, m_main_toolbar.get_height(), ImGuiCond_Always, 0.0f, 0.0f); - #else + auto canvas_h = float(get_canvas_size().get_height()); const float x = canvas_w - m_main_toolbar.get_width(); const float y = 0.5f * canvas_h - top * float(wxGetApp().plater()->get_camera().get_zoom()); imgui->set_next_window_pos(x, y, ImGuiCond_Always, 1.0f, 0.0f); @@ -8091,16 +8088,13 @@ void GLCanvas3D::_render_return_toolbar() const ImVec2 button_icon_size = ImVec2(font_size * 1.3, font_size * 1.3); ImGuiWrapper& imgui = *wxGetApp().imgui(); - Size cnv_size = get_canvas_size(); - auto canvas_w = float(cnv_size.get_width()); - auto canvas_h = float(cnv_size.get_height()); - float window_width = real_size.x + button_icon_size.x + imgui.scaled(2.0f); - float window_height = button_icon_size.y + imgui.scaled(2.0f); float window_pos_x = 30.0f + (is_collapse_toolbar_on_left() ? (get_collapse_toolbar_width() + 5.f) : 0); float window_pos_y = 14.0f; imgui.set_next_window_pos(window_pos_x, window_pos_y, ImGuiCond_Always, 0, 0); #ifdef __WINDOWS__ + float window_width = real_size.x + button_icon_size.x + imgui.scaled(2.0f); + float window_height = button_icon_size.y + imgui.scaled(2.0f); imgui.set_next_window_size(window_width, window_height, ImGuiCond_Always); #endif @@ -8114,9 +8108,6 @@ void GLCanvas3D::_render_return_toolbar() const imgui.begin(_L("Assembly Return"), ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse); - float button_width = 20; - float button_height = 20; - ImVec2 size = ImVec2(button_width, button_height); // Size of the image we want to make visible ImVec2 uv0 = ImVec2(0.0f, 0.0f); ImVec2 uv1 = ImVec2(1.0f, 1.0f); @@ -8392,11 +8383,11 @@ void GLCanvas3D::_render_assemble_control() const ImGui::SameLine(window_padding.x + 2 * text_size_x + slider_width + item_spacing * 7 + value_size); ImGui::PushItemWidth(slider_width); - bool explosion_slider_changed = imgui->bbl_slider_float_style("##ratio_slider", &m_explosion_ratio, 1.0f, 3.0f, "%1.2f"); + imgui->bbl_slider_float_style("##ratio_slider", &m_explosion_ratio, 1.0f, 3.0f, "%1.2f"); ImGui::SameLine(window_padding.x + 2 * text_size_x + 2 * slider_width + item_spacing * 8 + value_size); ImGui::PushItemWidth(value_size); - bool explosion_input_changed = ImGui::BBLDragFloat("##ratio_input", &m_explosion_ratio, 0.1f, 1.0f, 3.0f, "%1.2f"); + ImGui::BBLDragFloat("##ratio_input", &m_explosion_ratio, 0.1f, 1.0f, 3.0f, "%1.2f"); } imgui->end(); @@ -8426,7 +8417,6 @@ void GLCanvas3D::_render_assemble_info() const auto canvas_h = float(get_canvas_size().get_height()); float space_size = imgui->get_style_scaling() * 8.0f; float caption_max = imgui->calc_text_size(_L("Total Volume:")).x + 3 * space_size; - char buf[3][64]; ImGuiIO& io = ImGui::GetIO(); ImFont* font = io.Fonts->Fonts[0]; diff --git a/src/slic3r/GUI/GLTexture.cpp b/src/slic3r/GUI/GLTexture.cpp index 79cbb77370..be0b402653 100644 --- a/src/slic3r/GUI/GLTexture.cpp +++ b/src/slic3r/GUI/GLTexture.cpp @@ -470,7 +470,6 @@ void GLTexture::reset() bool GLTexture::generate_from_text_string(const std::string& text_str, wxFont &font, wxColor background, wxColor foreground) { - int w,h,hl; return generate_from_text(text_str, font, background, foreground); } diff --git a/src/slic3r/GUI/GLToolbar.cpp b/src/slic3r/GUI/GLToolbar.cpp index be97e52e84..6b14f3cf2f 100644 --- a/src/slic3r/GUI/GLToolbar.cpp +++ b/src/slic3r/GUI/GLToolbar.cpp @@ -1466,7 +1466,6 @@ void GLToolbar::render_vertical(const GLCanvas3D& parent) int tex_width, tex_height; if (item->is_action_with_text_image()) { float scaled_text_size = m_layout.text_size * m_layout.scale * inv_cnv_w; - float scaled_text_width = item->get_extra_size_ratio() * icons_size_x; float scaled_text_border = 2.5 * m_layout.scale * inv_cnv_h; float scaled_text_height = icons_size_y / 2.0f; item->render_text(left, left + scaled_text_size, top - scaled_text_border - scaled_text_height, top - scaled_text_border); diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index eedf223ae9..afecaa2658 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -301,7 +301,6 @@ public: memDC.SetTextForeground(StateColor::darkModeColorFor(wxColour(144, 144, 144))); int width = bitmap.GetWidth(); int text_height = memDC.GetTextExtent(text).GetHeight(); - int text_width = memDC.GetTextExtent(text).GetWidth(); wxRect text_rect(wxPoint(0, m_action_line_y_position), wxPoint(width, m_action_line_y_position + text_height)); memDC.DrawLabel(text, text_rect, wxALIGN_CENTER); @@ -963,7 +962,7 @@ void GUI_App::post_init() // Neither wxShowEvent nor wxWindowCreateEvent work reliably. if (this->preset_updater) { // G-Code Viewer does not initialize preset_updater. CallAfter([this] { - bool cw_showed = this->config_wizard_startup(); + this->config_wizard_startup(); std::string http_url = get_http_url(app_config->get_country_code()); std::string language = GUI::into_u8(current_language_code()); @@ -1026,8 +1025,7 @@ void GUI_App::post_init() try { std::time_t lw_t = boost::filesystem::last_write_time(temp_path) ; files_vec.push_back({ lw_t, temp_path.filename().string() }); - } catch (const std::exception &ex) { - } + } catch (std::exception&) {} } std::sort(files_vec.begin(), files_vec.end(), []( std::pair &a, std::pair &b) { @@ -1317,7 +1315,6 @@ int GUI_App::download_plugin(std::string name, std::string package_name, Install .on_complete([&pro_fn, tmp_path, target_file_path](std::string body, unsigned status) { BOOST_LOG_TRIVIAL(info) << "[download_plugin 2] completed"; bool cancel = false; - int percent = 0; fs::fstream file(tmp_path, std::ios::out | std::ios::binary | std::ios::trunc); file.write(body.c_str(), body.size()); file.close(); @@ -1927,8 +1924,13 @@ void GUI_App::init_app_config() boost::filesystem::create_directory(data_dir_path); } - // Change current dirtory of application - chdir(encode_path((Slic3r::data_dir() + "/log").c_str()).c_str()); + // Change current directory of application + auto path = encode_path((Slic3r::data_dir() + "/log").c_str()); +#ifdef _WIN32 + _chdir(path.c_str()); +#else + chdir(path.c_str()); +#endif } else { m_datadir_redefined = true; } @@ -3365,7 +3367,7 @@ if (res) { mainframe->refresh_plugin_tips(); // BBS: remove SLA related message } - } catch (std::exception &e) { + } catch (std::exception&) { // wxMessageBox(e.what(), "", MB_OK); } } @@ -3379,9 +3381,7 @@ void GUI_App::ShowDownNetPluginDlg() { return; DownloadProgressDialog dlg(_L("Downloading Bambu Network Plug-in")); dlg.ShowModal(); - } catch (std::exception &e) { - ; - } + } catch (std::exception&) {} } void GUI_App::ShowUserLogin(bool show) @@ -3396,9 +3396,7 @@ void GUI_App::ShowUserLogin(bool show) login_dlg = new ZUserLogin(); } login_dlg->ShowModal(); - } catch (std::exception &e) { - ; - } + } catch (std::exception&) {} } else { if (login_dlg) login_dlg->EndModal(wxID_OK); @@ -3418,7 +3416,7 @@ void GUI_App::ShowOnlyFilament() { // BBS: remove SLA related message } - } catch (std::exception &e) { + } catch (std::exception&) { // wxMessageBox(e.what(), "", MB_OK); } } @@ -3830,10 +3828,10 @@ std::string GUI_App::handle_web_request(std::string cmd) auto keyCode = key_event_node.get("key"); auto ctrlKey = key_event_node.get("ctrl"); auto shiftKey = key_event_node.get("shift"); - auto cmdKey = key_event_node.get("cmd"); wxKeyEvent e(wxEVT_CHAR_HOOK); #ifdef __APPLE__ + auto cmdKey = key_event_node.get("cmd"); e.SetControlDown(cmdKey); e.SetRawControlDown(ctrlKey); #else @@ -4786,8 +4784,6 @@ void GUI_App::start_sync_user_preset(bool with_progress_dlg) }); } - unsigned int http_code = 200; - /* get list witch need to be deleted*/ std::vector delete_cache_presets = get_delete_cache_presets_lock(); for (auto it = delete_cache_presets.begin(); it != delete_cache_presets.end();) { @@ -5467,7 +5463,7 @@ void GUI_App::show_ip_address_enter_dialog_handler(wxCommandEvent& evt) void GUI_App::open_preferences(size_t open_on_tab, const std::string& highlight_option) { - bool app_layout_changed = false; + // bool app_layout_changed = false; { // the dialog needs to be destroyed before the call to recreate_GUI() // or sometimes the application crashes into wxDialogBase() destructor @@ -6500,8 +6496,6 @@ static bool del_win_registry(HKEY hkeyHive, const wchar_t *pszVar, const wchar_t return false; if (!bDidntExist) { - DWORD dwDisposition; - HKEY hkey; iRC = ::RegDeleteKeyExW(hkeyHive, pszVar, KEY_ALL_ACCESS, 0); if (iRC == ERROR_SUCCESS) { return true; diff --git a/src/slic3r/GUI/GUI_AuxiliaryList.cpp b/src/slic3r/GUI/GUI_AuxiliaryList.cpp index 1fa5b194ec..5e0d0dcd21 100644 --- a/src/slic3r/GUI/GUI_AuxiliaryList.cpp +++ b/src/slic3r/GUI/GUI_AuxiliaryList.cpp @@ -3,8 +3,6 @@ #include "I18N.hpp" #include "wxExtensions.hpp" -#include - #include "GUI_App.hpp" #include "Plater.hpp" #include "libslic3r/Model.hpp" diff --git a/src/slic3r/GUI/GUI_Factories.cpp b/src/slic3r/GUI/GUI_Factories.cpp index 067fd45e35..334705618e 100644 --- a/src/slic3r/GUI/GUI_Factories.cpp +++ b/src/slic3r/GUI/GUI_Factories.cpp @@ -711,9 +711,9 @@ wxMenuItem* MenuFactory::append_menu_item_settings(wxMenu* menu_) // Create new items for settings popupmenu - if (printer_technology() == ptFFF || - (menu->GetMenuItems().size() > 0 && !menu->GetMenuItems().back()->IsSeparator())) - ;// menu->SetFirstSeparator(); +// if (printer_technology() == ptFFF || +// (menu->GetMenuItems().size() > 0 && !menu->GetMenuItems().back()->IsSeparator())) + // menu->SetFirstSeparator(); // detect itemm for adding of the setting ObjectList* object_list = obj_list(); @@ -1339,7 +1339,7 @@ void MenuFactory::create_extra_object_menu() m_object_menu.AppendSeparator(); // Set filament insert menu item here // Set Printable - wxMenuItem* menu_item_printable = append_menu_item_printable(&m_object_menu); + append_menu_item_printable(&m_object_menu); append_menu_item_per_object_process(&m_object_menu); // Enter per object parameters append_menu_item_per_object_settings(&m_object_menu); @@ -1493,8 +1493,6 @@ void MenuFactory::create_plate_menu() // arrange objects on current plate append_menu_item(menu, wxID_ANY, _L("Arrange"), _L("arrange current plate"), [](wxCommandEvent&) { - PartPlate* plate = plater()->get_partplate_list().get_selected_plate(); - assert(plate); plater()->set_prepare_state(Job::PREPARE_STATE_MENU); plater()->arrange(); }, "", nullptr, @@ -1507,8 +1505,6 @@ void MenuFactory::create_plate_menu() append_menu_item( menu, wxID_ANY, _L("Reload All"), _L("reload all from disk"), [](wxCommandEvent&) { - PartPlate* plate = plater()->get_partplate_list().get_selected_plate(); - assert(plate); plater()->set_prepare_state(Job::PREPARE_STATE_MENU); plater()->reload_all_from_disk(); }, @@ -1517,8 +1513,6 @@ void MenuFactory::create_plate_menu() // orient objects on current plate append_menu_item(menu, wxID_ANY, _L("Auto Rotate"), _L("auto rotate current plate"), [](wxCommandEvent&) { - PartPlate* plate = plater()->get_partplate_list().get_selected_plate(); - assert(plate); //BBS TODO call auto rotate for current plate plater()->set_prepare_state(Job::PREPARE_STATE_MENU); plater()->orient(); @@ -1801,7 +1795,7 @@ void MenuFactory::append_menu_item_clone(wxMenu* menu) void MenuFactory::append_menu_item_simplify(wxMenu* menu) { - wxMenuItem* menu_item = append_menu_item(menu, wxID_ANY, _L("Simplify Model"), "", + append_menu_item(menu, wxID_ANY, _L("Simplify Model"), "", [](wxCommandEvent&) { obj_list()->simplify(); }, "", menu, []() {return plater()->can_simplify(); }, m_parent); } @@ -1899,16 +1893,16 @@ void MenuFactory::append_menu_item_change_filament(wxMenu* menu) wxMenu* extruder_selection_menu = new wxMenu(); const wxString& name = sels.Count() == 1 ? names[0] : names[1]; - int initial_extruder = -1; // negative value for multiple object/part selection - if (sels.Count() == 1) { - const ModelConfig& config = obj_list()->get_item_config(sels[0]); - // BBS - const auto sel_vol = obj_list()->get_selected_model_volume(); - if (sel_vol && sel_vol->type() == ModelVolumeType::PARAMETER_MODIFIER) - initial_extruder = config.has("extruder") ? config.extruder() : 0; - else - initial_extruder = config.has("extruder") ? config.extruder() : 1; - } + // int initial_extruder = -1; // negative value for multiple object/part selection + // if (sels.Count() == 1) { + // const ModelConfig& config = obj_list()->get_item_config(sels[0]); + // // BBS + // const auto sel_vol = obj_list()->get_selected_model_volume(); + // if (sel_vol && sel_vol->type() == ModelVolumeType::PARAMETER_MODIFIER) + // initial_extruder = config.has("extruder") ? config.extruder() : 0; + // else + // initial_extruder = config.has("extruder") ? config.extruder() : 1; + // } // BBS bool has_modifier = false; @@ -1949,7 +1943,6 @@ void MenuFactory::append_menu_item_change_filament(wxMenu* menu) void MenuFactory::append_menu_item_set_printable(wxMenu* menu) { - const Selection& selection = plater()->canvas3D()->get_selection(); bool all_printable = true; ObjectList* list = obj_list(); wxDataViewItemArray sels; @@ -1957,7 +1950,6 @@ void MenuFactory::append_menu_item_set_printable(wxMenu* menu) for (wxDataViewItem item : sels) { ItemType type = list->GetModel()->GetItemType(item); - bool check; if (type != itInstance && type != itObject) continue; else { @@ -2000,8 +1992,8 @@ void MenuFactory::append_menu_item_locked(wxMenu* menu) }, "", nullptr, []() { return true; }, m_parent); m_parent->Bind(wxEVT_UPDATE_UI, [](wxUpdateUIEvent& evt) { - PartPlate* plate = plater()->get_partplate_list().get_selected_plate(); - assert(plate); + // PartPlate* plate = plater()->get_partplate_list().get_selected_plate(); + // assert(plate); //bool check = plate->is_locked(); //evt.Check(check); plater()->set_current_canvas_as_dirty(); @@ -2037,8 +2029,6 @@ void MenuFactory::append_menu_item_plate_name(wxMenu *menu) m_parent->Bind( wxEVT_UPDATE_UI, [](wxUpdateUIEvent &evt) { - PartPlate *plate = plater()->get_partplate_list().get_selected_plate(); - assert(plate); plater()->set_current_canvas_as_dirty(); }, item->GetId()); diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 30846abf51..d7d083f35f 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -713,7 +713,6 @@ void ObjectList::update_plate_values_for_items() Unselect(item); bool is_old_parent_expanded = IsExpanded(old_parent); - bool is_expanded = IsExpanded(item); m_objects_model->OnPlateChange(plate_idx, item); if (is_old_parent_expanded) Expand(old_parent); @@ -739,7 +738,6 @@ void ObjectList::object_config_options_changed(const ObjectVolumeID& ov_id) if (ov_id.object == nullptr) return; - ModelObjectPtrs& objects = wxGetApp().model().objects; ModelObject* mo = ov_id.object; ModelVolume* mv = ov_id.volume; @@ -846,8 +844,6 @@ void ObjectList::update_filament_colors() void ObjectList::update_name_column_width() const { wxSize client_size = this->GetClientSize(); - bool p_vbar = this->GetParent()->HasScrollbar(wxVERTICAL); - bool p_hbar = this->GetParent()->HasScrollbar(wxHORIZONTAL); auto em = em_unit(const_cast(this)); // BBS: walkaround for wxDataViewCtrl::HasScrollbar() does not return correct status @@ -936,7 +932,6 @@ void ObjectList::update_name_in_model(const wxDataViewItem& item) const if (m_objects_model->GetItemType(item) & itPlate) { std::string name = m_objects_model->GetName(item).ToUTF8().data(); int plate_idx = -1; - const ItemType type0 = m_objects_model->GetItemType(item, plate_idx); if (plate_idx >= 0) { auto plate = wxGetApp().plater()->get_partplate_list().get_plate(plate_idx); if (plate->get_plate_name() != name) { @@ -1351,8 +1346,7 @@ void ObjectList::show_context_menu(const bool evt_context_menu) plater->SetPlateIndexByRightMenuInLeftUI(-1); if (type & itPlate) { int plate_idx = -1; - const ItemType type0 = m_objects_model->GetItemType(item, plate_idx); - if (plate_idx >= 0) { + if (plate_idx >= 0) { plater->SetPlateIndexByRightMenuInLeftUI(plate_idx); } } @@ -2006,7 +2000,7 @@ void ObjectList::load_modifier(const wxArrayString& input_files, ModelObject& mo try { model = Model::read_from_file(input_file, nullptr, nullptr, LoadStrategy::LoadModel); } - catch (std::exception& e) { + catch (std::exception&) { // auto msg = _L("Error!") + " " + input_file + " : " + e.what() + "."; auto msg = _L("Error!") + " " + _L("Failed to get the model data in the current file."); show_error(parent, msg); @@ -2905,7 +2899,7 @@ void ObjectList::boolean() new_object->config.assign_config(object->config); if (new_object->instances.empty()) new_object->add_instance(); - ModelVolume* new_volume = new_object->add_volume(mesh); + new_object->add_volume(mesh); // BBS: ensure on bed but no need to ensure locate in the center around origin new_object->ensure_on_bed(); @@ -2952,9 +2946,9 @@ DynamicPrintConfig ObjectList::get_default_layer_config(const int obj_idx) wxGetApp().preset_bundle->prints.get_edited_preset().config.opt_float("layer_height"); config.set_key_value("layer_height",new ConfigOptionFloat(layer_height)); // BBS - int extruder = object(obj_idx)->config.has("extruder") ? - object(obj_idx)->config.opt_int("extruder") : - wxGetApp().preset_bundle->prints.get_edited_preset().config.opt_float("extruder"); + // int extruder = object(obj_idx)->config.has("extruder") ? + // object(obj_idx)->config.opt_int("extruder") : + // wxGetApp().preset_bundle->prints.get_edited_preset().config.opt_float("extruder"); config.set_key_value("extruder", new ConfigOptionInt(0)); return config; @@ -3176,8 +3170,8 @@ void ObjectList::part_selection_changed() bool update_and_show_settings = false; bool update_and_show_layers = false; - bool enable_manipulation{true}; - bool disable_ss_manipulation{false}; + // bool enable_manipulation{true}; Orca: Removed because not used + // bool disable_ss_manipulation{false}; Orca: Removed because not used bool disable_ununiform_scale{false}; const auto item = GetSelection(); @@ -3185,7 +3179,7 @@ void ObjectList::part_selection_changed() og_name = _L("Cut Connectors information"); update_and_show_manipulations = true; - enable_manipulation = false; + // enable_manipulation = false; disable_ununiform_scale = true; } else if (item && (m_objects_model->GetItemType(item) & itPlate)) { @@ -3202,7 +3196,7 @@ void ObjectList::part_selection_changed() obj_idx = selection.get_object_idx(); ModelObject *object = (*m_objects)[obj_idx]; m_config = &object->config; - disable_ss_manipulation = object->is_cut(); + // disable_ss_manipulation = object->is_cut(); } else { og_name = _L("Group manipulation"); @@ -3211,17 +3205,17 @@ void ObjectList::part_selection_changed() update_and_show_manipulations = !selection.is_single_full_instance(); if (int obj_idx = selection.get_object_idx(); obj_idx >= 0) { - if (selection.is_any_volume() || selection.is_any_modifier()) - enable_manipulation = !(*m_objects)[obj_idx]->is_cut(); - else // if (item && m_objects_model->GetItemType(item) == itInstanceRoot) - disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut(); + // if (selection.is_any_volume() || selection.is_any_modifier()) + // enable_manipulation = !(*m_objects)[obj_idx]->is_cut(); + // else // if (item && m_objects_model->GetItemType(item) == itInstanceRoot) + // disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut(); } else { wxDataViewItemArray sels; GetSelections(sels); if (selection.is_single_full_object() || selection.is_multiple_full_instance()) { - int obj_idx = m_objects_model->GetObjectIdByItem(sels.front()); - disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut(); + // int obj_idx = m_objects_model->GetObjectIdByItem(sels.front()); + // disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut(); } else if (selection.is_mixed() || selection.is_multiple_full_object()) { std::map> cut_objects; @@ -3240,7 +3234,7 @@ void ObjectList::part_selection_changed() // check if selected cut objects are "full selected" for (auto cut_object : cut_objects) if (cut_object.first.check_sum() != cut_object.second.size()) { - disable_ss_manipulation = true; + // disable_ss_manipulation = true; break; } disable_ununiform_scale = !cut_objects.empty(); @@ -3288,7 +3282,7 @@ void ObjectList::part_selection_changed() // BBS: select object to edit config m_config = &(*m_objects)[obj_idx]->config; update_and_show_settings = true; - disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut(); + // disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut(); } } else { @@ -3316,8 +3310,8 @@ void ObjectList::part_selection_changed() m_config = &(*m_objects)[obj_idx]->volumes[volume_id]->config; update_and_show_settings = true; - const ModelVolume *volume = (*m_objects)[obj_idx]->volumes[volume_id]; - enable_manipulation = !((*m_objects)[obj_idx]->is_cut() && (volume->is_cut_connector() || volume->is_model_part())); + // const ModelVolume *volume = (*m_objects)[obj_idx]->volumes[volume_id]; + // enable_manipulation = !((*m_objects)[obj_idx]->is_cut() && (volume->is_cut_connector() || volume->is_model_part())); } else if (type & itInstance) { og_name = _L("Instance manipulation"); @@ -3325,7 +3319,7 @@ void ObjectList::part_selection_changed() // fill m_config by object's values m_config = &(*m_objects)[obj_idx]->config; - disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut(); + // disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut(); } else if (type & (itLayerRoot | itLayer)) { og_name = type & itLayerRoot ? _L("Height ranges") : _L("Settings for height range"); @@ -3368,7 +3362,7 @@ void ObjectList::part_selection_changed() if (printer_technology() == ptSLA) update_and_show_layers = false; else if (update_and_show_layers) { - ;//wxGetApp().obj_layers()->get_og()->set_name(" " + og_name + " "); + //wxGetApp().obj_layers()->get_og()->set_name(" " + og_name + " "); } update_min_height(); @@ -3400,7 +3394,6 @@ wxDataViewItem ObjectList::add_settings_item(wxDataViewItem parent_item, const D return ret; const bool is_object_settings = m_objects_model->GetItemType(parent_item) == itObject; - const bool is_volume_settings = m_objects_model->GetItemType(parent_item) == itVolume; const bool is_layer_settings = m_objects_model->GetItemType(parent_item) == itLayer; if (!is_object_settings) { ModelVolumeType volume_type = m_objects_model->GetVolumeType(parent_item); @@ -4689,8 +4682,6 @@ void ObjectList::select_item(const ObjectVolumeID& ov_id) void ObjectList::select_items(const std::vector& ov_ids) { - ModelObjectPtrs& objects = wxGetApp().model().objects; - wxDataViewItemArray sel_items; for (auto ov_id : ov_ids) { if (ov_id.object == nullptr) @@ -5695,7 +5686,7 @@ void ObjectList::set_extruder_for_selected_items(const int extruder) void ObjectList::on_plate_added(PartPlate* part_plate) { - wxDataViewItem plate_item = m_objects_model->AddPlate(part_plate); + m_objects_model->AddPlate(part_plate); } void ObjectList::on_plate_deleted(int plate_idx) diff --git a/src/slic3r/GUI/GUI_ObjectSettings.cpp b/src/slic3r/GUI/GUI_ObjectSettings.cpp index 09ca8c64a8..a0e0da3ea5 100644 --- a/src/slic3r/GUI/GUI_ObjectSettings.cpp +++ b/src/slic3r/GUI/GUI_ObjectSettings.cpp @@ -205,7 +205,7 @@ bool ObjectSettings::update_settings_list() bool is_object_settings = false; bool is_volume_settings = false; bool is_layer_range_settings = false; - bool is_layer_root = false; + // bool is_layer_root = false; ModelObject * parent_object = nullptr; for (auto item : items) { auto type = objects_model->GetItemType(item); @@ -255,9 +255,9 @@ bool ObjectSettings::update_settings_list() t_layer_height_range height_range = objects_model->GetLayerRangeByItem(item); object_configs.emplace( (ObjectBase*)(&object->layer_config_ranges.at(height_range)), &object->layer_config_ranges.at(height_range) ); } - else if (type == itLayerRoot) { - is_layer_root = true; - } + // else if (type == itLayerRoot) { + // is_layer_root = true; + // } } auto tab_plate = dynamic_cast(wxGetApp().get_plate_tab()); diff --git a/src/slic3r/GUI/GUI_ObjectTable.cpp b/src/slic3r/GUI/GUI_ObjectTable.cpp index 56c1550c46..7bc925e284 100644 --- a/src/slic3r/GUI/GUI_ObjectTable.cpp +++ b/src/slic3r/GUI/GUI_ObjectTable.cpp @@ -280,7 +280,6 @@ wxGridActivationResult GridCellFilamentsEditor::TryActivate(int row, int col, wx { ObjectGridTable *table = dynamic_cast(grid->GetTable()); ObjectGridTable::ObjectGridCol* grid_col = table->get_grid_col(col); - ObjectGridTable::ObjectGridRow* grid_row = table->get_grid_row(row - 1); if ( actSource.GetOrigin() == wxGridActivationSource::Key ) { const wxKeyEvent& key_event = actSource.GetKeyEvent(); @@ -316,7 +315,6 @@ void GridCellFilamentsEditor::DoActivate(int row, int col, wxGrid* grid) if (m_cached_value != -1) { ObjectGridTable *table = dynamic_cast(grid->GetTable()); ObjectGridTable::ObjectGridCol* grid_col = table->get_grid_col(col); - ObjectGridTable::ObjectGridRow* grid_row = table->get_grid_row(row - 1); if (m_cached_value <= grid_col->choice_count) { wxString choice = grid_col->choices[m_cached_value-1]; table->SetValue(row, col, choice); @@ -332,7 +330,6 @@ void GridCellFilamentsRenderer::Draw(wxGrid &grid, wxGridCellAttr &attr, wxDC &d wxRect text_rect = rect; if (table) { - ObjectGridTable::ObjectGridCol *grid_col = table->get_grid_col(col); ObjectGridTable::ObjectGridRow *grid_row = table->get_grid_row(row - 1); ConfigOptionInt & cur_option = dynamic_cast((*grid_row)[(ObjectGridTable::GridColType) col]); @@ -472,7 +469,6 @@ wxGridActivationResult GridCellChoiceEditor::TryActivate(int row, int col, wxGri { ObjectGridTable * table = dynamic_cast(grid->GetTable()); ObjectGridTable::ObjectGridCol *grid_col = table->get_grid_col(col); - ObjectGridTable::ObjectGridRow *grid_row = table->get_grid_row(row - 1); if (actSource.GetOrigin() == wxGridActivationSource::Key) { const wxKeyEvent &key_event = actSource.GetKeyEvent(); @@ -505,7 +501,6 @@ void GridCellChoiceEditor::DoActivate(int row, int col, wxGrid *grid) if (m_cached_value != -1) { ObjectGridTable * table = dynamic_cast(grid->GetTable()); ObjectGridTable::ObjectGridCol *grid_col = table->get_grid_col(col); - ObjectGridTable::ObjectGridRow *grid_row = table->get_grid_row(row - 1); if (m_cached_value <= grid_col->choice_count) { wxString choice = grid_col->choices[m_cached_value - 1]; table->SetValue(row, col, choice); @@ -521,7 +516,6 @@ void GridCellComboBoxRenderer::Draw(wxGrid &grid, wxGridCellAttr &attr, wxDC &dc wxRect text_rect = rect; if (table) { - ObjectGridTable::ObjectGridCol *grid_col = table->get_grid_col(col); ObjectGridTable::ObjectGridRow *grid_row = table->get_grid_row(row - 1); ConfigOptionInt & cur_option = dynamic_cast((*grid_row)[(ObjectGridTable::GridColType) col]); @@ -561,7 +555,6 @@ wxString GridCellSupportEditor::ms_stringValues[2] = { wxT(""), wxT("") }; void GridCellSupportEditor::DoActivate(int row, int col, wxGrid* grid) { - ObjectGrid* local_table = dynamic_cast(grid); wxGridBlocks cell_array = grid->GetSelectedBlocks(); auto left_col = cell_array.begin()->GetLeftCol(); @@ -691,7 +684,6 @@ void GridCellSupportRenderer::Draw(wxGrid& grid, //wxGridCellBoolRenderer::Draw(grid, attr, dc, rect, row, col, isSelected); ObjectGridTable * table = dynamic_cast(grid.GetTable()); - ObjectGridTable::ObjectGridCol *grid_col = table->get_grid_col(col); ObjectGridTable::ObjectGridRow *grid_row = table->get_grid_row(row - 1); ConfigOptionBool & cur_option = dynamic_cast((*grid_row)[(ObjectGridTable::GridColType) col]); @@ -891,7 +883,6 @@ void ObjectGrid::OnKeyDown( wxKeyEvent& event ) // see include/wx/defs.h enum wxKeyCode int keyCode = event.GetKeyCode(); int ctrlMask = wxMOD_CONTROL; - int shiftMask = wxMOD_SHIFT; // Coordinates of the selected block to copy to clipboard. wxGridBlockCoords selection; wxTextDataObject text_data; @@ -1544,7 +1535,6 @@ void ObjectGridTable::SetValue( int row, int col, const wxString& value ) return; ObjectGridRow* grid_row = m_grid_data[row - 1]; ObjectGridCol* grid_col = m_col_data[col]; - ObjectList* obj_list = wxGetApp().obj_list(); if (grid_col->type == coEnum) { int enum_value = 0; for (int i = 0; i < grid_col->choice_count; i++) @@ -1812,9 +1802,6 @@ wxString ObjectGridTable::convert_filament_string(int index, wxString& filament_ void ObjectGridTable::init_cols(ObjectGrid *object_grid) { - const float font_size = 1.5f * wxGetApp().em_unit(); - - // printable for object ObjectGridCol *col = new ObjectGridCol(coBool, "printable", ObjectGridTable::category_all, true, false, true, false, wxALIGN_CENTRE); col->size = object_grid->GetTextExtent(L("Printable")).x; @@ -1910,7 +1897,6 @@ void ObjectGridTable::init_cols(ObjectGrid *object_grid) col = new ObjectGridCol(coFloat, "inner_wall_speed_reset", L("Speed"), false, true, false, false, wxALIGN_LEFT); m_col_data.push_back(col); - return; } void ObjectGridTable::construct_object_configs(ObjectGrid *object_grid) @@ -1929,8 +1915,8 @@ void ObjectGridTable::construct_object_configs(ObjectGrid *object_grid) int object_count = m_panel->m_model->objects.size(); PartPlateList& partplate_list = m_panel->m_plater->get_partplate_list(); DynamicPrintConfig& global_config = wxGetApp().preset_bundle->prints.get_edited_preset().config; - const DynamicPrintConfig* plater_config = m_panel->m_plater->config(); - const DynamicPrintConfig& filament_config = *plater_config; + // const DynamicPrintConfig* plater_config = m_panel->m_plater->config(); + // const DynamicPrintConfig& filament_config = *plater_config; for (int i = 0; i < object_count; i++) { @@ -2826,7 +2812,7 @@ int ObjectTablePanel::init_filaments_and_colors() BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(", invalid color count:%1%, extruder count: %2%") %color_count %m_filaments_count; } - unsigned int i = 0; + int i = 0; ColorRGB rgb; while (i < m_filaments_count) { const std::string& txt_color = global_config->opt_string("filament_colour", i); @@ -3032,7 +3018,6 @@ void ObjectTablePanel::load_data() { ObjectGridTable::ObjectGridCol *grid_col = m_object_grid_table->get_grid_col(i); if (grid_col->size > 0) { - int fit_size1 = m_object_grid->GetColSize(i); m_object_grid->SetColSize(i, grid_col->size); } } @@ -3173,7 +3158,7 @@ void ObjectTablePanel::OnRowSize( wxGridSizeEvent& ev) g_dialog_max_height =(panel_size.GetHeight() > g_max_size_from_parent.GetHeight())?g_max_size_from_parent.GetHeight():panel_size.GetHeight(); this->SetMaxSize(wxSize(g_dialog_max_width, g_dialog_max_height)); - wxSize current_size = GetParent()->GetSize(); + // wxSize current_size = GetParent()->GetSize(); //if (current_size.GetHeight() < g_dialog_max_height) GetParent()->SetMaxSize(wxSize(g_dialog_max_width, g_dialog_max_height)); GetParent()->SetSize(wxSize(g_dialog_max_width, g_dialog_max_height)); @@ -3187,7 +3172,7 @@ void ObjectTablePanel::OnColSize( wxGridSizeEvent& ev) g_dialog_max_height =(panel_size.GetHeight() > g_max_size_from_parent.GetHeight())?g_max_size_from_parent.GetHeight():panel_size.GetHeight(); this->SetMaxSize(wxSize(g_dialog_max_width, g_dialog_max_height)); - wxSize current_size = GetParent()->GetSize(); + // wxSize current_size = GetParent()->GetSize(); //if (current_size.GetWidth() < g_dialog_max_width) GetParent()->SetMaxSize(wxSize(g_dialog_max_width, g_dialog_max_height)); GetParent()->SetSize(wxSize(g_dialog_max_width, g_dialog_max_height)); @@ -3471,8 +3456,6 @@ void GridCellTextEditor::SetSize(const wxRect &rect) { wxGridCellTextEditor::Set void GridCellTextEditor::BeginEdit(int row, int col, wxGrid *grid) { ObjectGridTable * table = dynamic_cast(grid->GetTable()); - ObjectGridTable::ObjectGridCol *grid_col = table->get_grid_col(col); - ObjectGridTable::ObjectGridRow *grid_row = table->get_grid_row(row - 1); auto val = table->GetValue(row, col); @@ -3506,10 +3489,6 @@ void GridCellTextEditor::BeginEdit(int row, int col, wxGrid *grid) bool GridCellTextEditor::EndEdit(int row, int col, const wxGrid *grid, const wxString &WXUNUSED(oldval), wxString *newval) { - ObjectGridTable * table = dynamic_cast(grid->GetTable()); - ObjectGridTable::ObjectGridCol *grid_col = table->get_grid_col(col); - ObjectGridTable::ObjectGridRow *grid_row = table->get_grid_row(row - 1); - wxCHECK_MSG(m_control, false, "wxGridCellTextEditor must be created first!"); const wxString value = Text()->GetTextCtrl()->GetValue(); diff --git a/src/slic3r/GUI/GUI_ObjectTableSettings.cpp b/src/slic3r/GUI/GUI_ObjectTableSettings.cpp index 10578be691..5e9dfd0f64 100644 --- a/src/slic3r/GUI/GUI_ObjectTableSettings.cpp +++ b/src/slic3r/GUI/GUI_ObjectTableSettings.cpp @@ -108,7 +108,6 @@ bool ObjectTableSettings::update_settings_list(bool is_object, bool is_multiple_ //SettingsFactory::Bundle cat_options = SettingsFactory::get_bundle(&config->get(), is_object); std::map> cat_options; std::vector category_settings = SettingsFactory::get_visible_options(category, !is_object); - bool display_multiple = false; auto is_option_modified = [this](std::string key) { ConfigOption* config_option1 = m_origin_config.option(key); ConfigOption* config_option2 = m_current_config.option(key); @@ -147,7 +146,6 @@ bool ObjectTableSettings::update_settings_list(bool is_object, bool is_multiple_ else it1 = cat_options.erase(it1); } - display_multiple = true; } else { cat_options.emplace(category, category_settings); diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index 91254111cf..13e67556e6 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -6,7 +6,6 @@ #include "GUI_App.hpp" #include "GUI.hpp" #include "I18N.hpp" -#include "3DScene.hpp" #include "BackgroundSlicingProcess.hpp" #include "OpenGLManager.hpp" #include "GLCanvas3D.hpp" @@ -15,19 +14,11 @@ #include "MainFrame.hpp" #include "format.hpp" -#include -#include #include #include -#include -#include -#include -#include -#include // this include must follow the wxWidgets ones or it won't compile on Windows -> see http://trac.wxwidgets.org/ticket/2421 #include "libslic3r/Print.hpp" -#include "libslic3r/SLAPrint.hpp" #include "NotificationManager.hpp" #ifdef _WIN32 @@ -536,7 +527,6 @@ void Preview::update_layers_slider_from_canvas(wxKeyEvent &event) const auto key = event.GetKeyCode(); IMSlider *m_layers_slider = m_canvas->get_gcode_viewer().get_layers_slider(); - IMSlider *m_moves_slider = m_canvas->get_gcode_viewer().get_moves_slider(); if (key == 'L') { if(!m_layers_slider->switch_one_layer_mode()) event.Skip(); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp index bee454af28..c9c324222d 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp @@ -3057,7 +3057,7 @@ bool GLGizmoEmboss::choose_font_by_wxdialog() } #endif // ALLOW_ADD_FONT_BY_OS_SELECTOR -#if defined ALLOW_ADD_FONT_BY_FILE or defined ALLOW_DEBUG_MODE +#if defined(ALLOW_ADD_FONT_BY_FILE) || defined(ALLOW_DEBUG_MODE) namespace priv { static std::string get_file_name(const std::string &file_path) { @@ -3693,7 +3693,6 @@ GuiCfg create_gui_configuration() cfg.height_of_volume_type_selector = separator_height + line_height_with_spacing + input_height; int max_style_image_width = static_cast(std::round(cfg.max_style_name_width/2 - 2 * style.FramePadding.x)); - int max_style_image_height = static_cast(std::round(input_height)); cfg.max_style_image_size = Vec2i32(max_style_image_width, line_height); cfg.face_name_size = Vec2i32(cfg.input_width, line_height_with_spacing); cfg.face_name_texture_offset_x = cfg.face_name_size.x() + space; diff --git a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp index 6ad62f1a8e..1cd3aee1e6 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoFdmSupports.cpp @@ -245,17 +245,10 @@ void GLGizmoFdmSupports::on_render_input_window(float x, float y, float bottom_l const float gap_fill_slider_left = m_imgui->calc_text_size(m_desc.at("gap_fill")).x + m_imgui->scaled(1.5f); const float highlight_slider_left = m_imgui->calc_text_size(m_desc.at("highlight_by_angle")).x + m_imgui->scaled(1.5f); const float reset_button_slider_left = m_imgui->calc_text_size(m_desc.at("reset_direction")).x + m_imgui->scaled(1.5f) + ImGui::GetStyle().FramePadding.x * 2; - const float on_overhangs_only_width = m_imgui->calc_text_size(m_desc["on_overhangs_only"]).x + m_imgui->scaled(1.5f); - const float remove_btn_width = m_imgui->calc_text_size(m_desc.at("remove_all")).x + m_imgui->scaled(1.5f); - const float filter_btn_width = m_imgui->calc_text_size(m_desc.at("perform")).x + m_imgui->scaled(1.5f); const float gap_area_txt_width = m_imgui->calc_text_size(m_desc.at("gap_area")).x + m_imgui->scaled(1.5f); const float smart_fill_angle_txt_width = m_imgui->calc_text_size(m_desc.at("smart_fill_angle")).x + m_imgui->scaled(1.5f); - const float buttons_width = remove_btn_width + filter_btn_width + m_imgui->scaled(1.5f); const float empty_button_width = m_imgui->calc_button_size("").x; - const float tips_width = m_imgui->calc_text_size(_L("Auto support threshold angle: ") + " 90 ").x + m_imgui->scaled(1.5f); - const float minimal_slider_width = m_imgui->scaled(4.f); - float caption_max = 0.f; float total_text_max = 0.f; for (const auto &t : std::array{"enforce", "block", "remove", "cursor_size", "clipping_of_view"}) { @@ -272,8 +265,6 @@ void GLGizmoFdmSupports::on_render_input_window(float x, float y, float bottom_l const float sliders_width = m_imgui->scaled(7.0f); const float drag_left_width = ImGui::GetStyle().WindowPadding.x + sliders_left_width + sliders_width - space_size; - float drag_pos_times = 0.7; - ImGui::AlignTextToFramePadding(); m_imgui->text(m_desc.at("tool_type")); std::array tool_ids = { ImGui::CircleButtonIcon, ImGui::SphereButtonIcon, ImGui::FillButtonIcon, ImGui::GapFillIcon }; @@ -697,7 +688,6 @@ wxString GLGizmoFdmSupports::handle_snapshot_action_name(bool shift_down, GLGizm void GLGizmoFdmSupports::init_print_instance() { const PrintObject* print_object = NULL; - PrintInstance print_instance = { 0 }; const Print *print = m_parent.fff_print(); if (!m_c->selection_info() || (m_print_instance.print_object)) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMeshBoolean.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMeshBoolean.cpp index ee9c779464..cb791597e6 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMeshBoolean.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMeshBoolean.cpp @@ -138,8 +138,6 @@ void GLGizmoMeshBoolean::on_render() BoundingBoxf3 src_bb; BoundingBoxf3 tool_bb; - const ModelObject* mo = m_c->selection_info()->model_object(); - const ModelInstance* mi = mo->instances[m_parent.get_selection().get_instance_idx()]; const Selection& selection = m_parent.get_selection(); const Selection::IndicesList& idxs = selection.get_volume_idxs(); for (unsigned int i : idxs) { @@ -163,16 +161,12 @@ void GLGizmoMeshBoolean::on_set_state() if (m_state == EState::On) { m_src.reset(); m_tool.reset(); - bool m_diff_delete_input = false; - bool m_inter_delete_input = false; m_operation_mode = MeshBooleanOperation::Union; m_selecting_state = MeshBooleanSelectingState::SelectSource; } else if (m_state == EState::Off) { m_src.reset(); m_tool.reset(); - bool m_diff_delete_input = false; - bool m_inter_delete_input = false; m_operation_mode = MeshBooleanOperation::Undef; m_selecting_state = MeshBooleanSelectingState::Undef; wxGetApp().notification_manager()->close_plater_warning_notification(warning_text); diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp index 3167266a5e..4193ba885f 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp @@ -403,7 +403,6 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott const float filter_btn_width = m_imgui->calc_text_size(m_desc.at("perform")).x + m_imgui->scaled(1.f); const float buttons_width = remove_btn_width + filter_btn_width + m_imgui->scaled(1.f); const float minimal_slider_width = m_imgui->scaled(4.f); - const float color_button_width = m_imgui->calc_text_size(std::string_view{""}).x + m_imgui->scaled(1.75f); float caption_max = 0.f; float total_text_max = 0.f; @@ -444,7 +443,6 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott float start_pos_x = ImGui::GetCursorPos().x; const ImVec2 max_label_size = ImGui::CalcTextSize("99", NULL, true); - const float item_spacing = m_imgui->scaled(0.8f); size_t n_extruder_colors = std::min((size_t)EnforcerBlockerType::ExtruderMax, m_extruders_colors.size()); for (int extruder_idx = 0; extruder_idx < n_extruder_colors; extruder_idx++) { const ColorRGBA &extruder_color = m_extruders_colors[extruder_idx]; diff --git a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp index 2dbf7778e0..cf512cd88e 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoPainterBase.cpp @@ -527,21 +527,10 @@ std::vector GLGizmoPainterBase::get_pr if (m_rr.mesh_id == -1) return hit_triangles_by_mesh; - ProjectedMousePosition mesh_hit_point = { m_rr.hit, m_rr.mesh_id, m_rr.facet }; float z_bot_world= (trafo_matrices[m_rr.mesh_id] * Vec3d(m_rr.hit(0), m_rr.hit(1), m_rr.hit(2))).z(); float z_top_world = z_bot_world+ m_cursor_height; hit_triangles_by_mesh.push_back({ z_bot_world, m_rr.mesh_id, size_t(m_rr.facet) }); - const Selection& selection = m_parent.get_selection(); - const ModelObject* mo = m_c->selection_info()->model_object(); - const ModelInstance* mi = mo->instances[selection.get_instance_idx()]; - const Transform3d instance_trafo = m_parent.get_canvas_type() == GLCanvas3D::CanvasAssembleView ? - mi->get_assemble_transformation().get_matrix() : - mi->get_transformation().get_matrix(); - const Transform3d instance_trafo_not_translate = m_parent.get_canvas_type() == GLCanvas3D::CanvasAssembleView ? - mi->get_assemble_transformation().get_matrix_no_offset() : - mi->get_transformation().get_matrix_no_offset(); - for (int mesh_idx = 0; mesh_idx < part_volumes.size(); mesh_idx++) { if (mesh_idx == m_rr.mesh_id) continue; @@ -712,7 +701,6 @@ bool GLGizmoPainterBase::gizmo_event(SLAGizmoEventType action, const Vec2d& mous // The mouse button click detection is enabled when there is a valid hit. // Missing the object entirely // shall not capture the mouse. - const bool dragging_while_painting = (action == SLAGizmoEventType::Dragging && m_button_down != Button::None); if (mesh_idx != -1 && m_button_down == Button::None) m_button_down = ((action == SLAGizmoEventType::LeftDown) ? Button::Left : Button::Right); @@ -1063,7 +1051,7 @@ void GLGizmoPainterBase::on_set_state() if (m_state == On && m_old_state != On) { // the gizmo was just turned on on_opening(); - const Selection& selection = m_parent.get_selection(); + // const Selection& selection = m_parent.get_selection(); //Camera& camera = wxGetApp().plater()->get_camera(); //Vec3d rotate_target = selection.get_bounding_box().center(); //rotate_target(2) = 0.f; diff --git a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp index 319c5c75f2..cf8b560198 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp @@ -186,7 +186,7 @@ bool GLGizmosManager::init() // Order of gizmos in the vector must match order in EType! //BBS: GUI refactor: add obj manipulation m_gizmos.clear(); - unsigned int sprite_id = 0; + // unsigned int sprite_id = 0; m_gizmos.emplace_back(new GLGizmoMove3D(m_parent, m_is_dark ? "toolbar_move_dark.svg" : "toolbar_move.svg", EType::Move, &m_object_manipulation)); m_gizmos.emplace_back(new GLGizmoRotate3D(m_parent, m_is_dark ? "toolbar_rotate_dark.svg" : "toolbar_rotate.svg", EType::Rotate, &m_object_manipulation)); m_gizmos.emplace_back(new GLGizmoScale3D(m_parent, m_is_dark ? "toolbar_scale_dark.svg" : "toolbar_scale.svg", EType::Scale, &m_object_manipulation)); @@ -1042,11 +1042,7 @@ void GLGizmosManager::render_arrow(const GLCanvas3D& parent, EType highlighted_t for (size_t idx : selectable_idxs) { if (idx == highlighted_type) { - int tex_width = m_icons_texture.get_width(); - int tex_height = m_icons_texture.get_height(); unsigned int tex_id = m_arrow_texture.get_id(); - float inv_tex_width = (tex_width != 0.0f) ? 1.0f / tex_width : 0.0f; - float inv_tex_height = (tex_height != 0.0f) ? 1.0f / tex_height : 0.0f; const float left_uv = 0.0f; const float right_uv = 1.0f; diff --git a/src/slic3r/GUI/Gizmos/GizmoObjectManipulation.cpp b/src/slic3r/GUI/Gizmos/GizmoObjectManipulation.cpp index a1490ebc70..57934b149d 100644 --- a/src/slic3r/GUI/Gizmos/GizmoObjectManipulation.cpp +++ b/src/slic3r/GUI/Gizmos/GizmoObjectManipulation.cpp @@ -591,7 +591,6 @@ void GizmoObjectManipulation::do_render_move_window(ImGuiWrapper *imgui_wrapper, float World_size = imgui_wrapper->calc_text_size(position_title).x + space_size; float caption_max = std::max(position_size, World_size) + 2 * space_size; - float end_text_size = imgui_wrapper->calc_text_size(this->m_new_unit_string).x; // position Vec3d original_position; @@ -601,8 +600,6 @@ void GizmoObjectManipulation::do_render_move_window(ImGuiWrapper *imgui_wrapper, original_position = this->m_new_position; Vec3d display_position = m_buffered_position; - // Rotation - Vec3d rotation = this->m_buffered_rotation; float unit_size = imgui_wrapper->calc_text_size(MAX_SIZE).x + space_size; int index = 1; int index_unit = 1; @@ -708,13 +705,6 @@ void GizmoObjectManipulation::do_render_rotate_window(ImGuiWrapper *imgui_wrappe float caption_max = std::max(position_size, World_size) + 2 * space_size; float end_text_size = imgui_wrapper->calc_text_size(this->m_new_unit_string).x; - // position - Vec3d original_position; - if (this->m_imperial_units) - original_position = this->m_new_position * this->mm_to_in; - else - original_position = this->m_new_position; - Vec3d display_position = m_buffered_position; // Rotation Vec3d rotation = this->m_buffered_rotation; @@ -835,10 +825,7 @@ void GizmoObjectManipulation::do_render_scale_input_window(ImGuiWrapper* imgui_w Vec3d scale = m_buffered_scale; Vec3d display_size = m_buffered_size; - Vec3d display_position = m_buffered_position; - float unit_size = imgui_wrapper->calc_text_size(MAX_SIZE).x + space_size; - bool imperial_units = this->m_imperial_units; int index = 2; int index_unit = 1; diff --git a/src/slic3r/GUI/HintNotification.cpp b/src/slic3r/GUI/HintNotification.cpp index c431e0fafb..a102f400e2 100644 --- a/src/slic3r/GUI/HintNotification.cpp +++ b/src/slic3r/GUI/HintNotification.cpp @@ -499,8 +499,7 @@ HintData* HintDatabase::get_hint(HintDataNavigation nav) m_hint_id = get_next_hint_id(); if(nav == HintDataNavigation::Prev) m_hint_id = get_prev_hint_id(); - if (nav == HintDataNavigation::Curr) - ; +// if (nav == HintDataNavigation::Curr) if (nav == HintDataNavigation::Random) init_random_hint_id(); } diff --git a/src/slic3r/GUI/IMSlider.cpp b/src/slic3r/GUI/IMSlider.cpp index a0f15066b1..538166f1d8 100644 --- a/src/slic3r/GUI/IMSlider.cpp +++ b/src/slic3r/GUI/IMSlider.cpp @@ -231,7 +231,7 @@ void IMSlider::SetTicksValues(const Info &custom_gcode_per_print_z) static bool last_spiral_vase_status = false; - const bool was_empty = m_ticks.empty(); + // const bool was_empty = m_ticks.empty(); m_ticks.ticks.clear(); const std::vector &heights = custom_gcode_per_print_z.gcodes; @@ -240,9 +240,9 @@ void IMSlider::SetTicksValues(const Info &custom_gcode_per_print_z) if (tick >= 0) m_ticks.ticks.emplace(TickCode{tick, h.type, h.extruder, h.color, h.extra}); } - if (!was_empty && m_ticks.empty()) +// if (!was_empty && m_ticks.empty()) // Switch to the "Feature type"/"Tool" from the very beginning of a new object slicing after deleting of the old one - ;// post_ticks_changed_event(); + // post_ticks_changed_event(); if (m_ticks.has_tick_with_code(ToolChange) && !m_can_change_color) { if (!wxGetApp().plater()->only_gcode_mode() && !wxGetApp().plater()->using_exported_file()) @@ -1034,8 +1034,6 @@ bool IMSlider::vertical_slider(const char* str_id, int* higher_value, int* lower context.IO.MouseClicked[0]) m_show_menu = false; - ImVec2 bar_center = higher_handle.GetCenter(); - // draw ticks draw_ticks(one_slideable_region); // draw colored band diff --git a/src/slic3r/GUI/ImGuiWrapper.cpp b/src/slic3r/GUI/ImGuiWrapper.cpp index 2595d3804d..f6ba5270b6 100644 --- a/src/slic3r/GUI/ImGuiWrapper.cpp +++ b/src/slic3r/GUI/ImGuiWrapper.cpp @@ -182,8 +182,6 @@ int ImGuiWrapper::TOOLBAR_WINDOW_FLAGS = ImGuiWindowFlags_AlwaysAutoResize bool get_data_from_svg(const std::string &filename, unsigned int max_size_px, ThumbnailData &thumbnail_data) { - bool compression_enabled = false; - NSVGimage *image = nsvgParseFromFile(filename.c_str(), "px", 96.0f); if (image == nullptr) { return false; } @@ -236,7 +234,6 @@ bool get_data_from_svg(const std::string &filename, unsigned int max_size_px, Th bool slider_behavior(ImGuiID id, const ImRect& region, const ImS32 v_min, const ImS32 v_max, ImS32* out_value, ImRect* out_handle, ImGuiSliderFlags flags/* = 0*/, const int fixed_value/* = -1*/, const ImVec4& fixed_rect/* = ImRect()*/) { ImGuiContext& context = *GImGui; - ImGuiIO& io = ImGui::GetIO(); const ImGuiAxis axis = (flags & ImGuiSliderFlags_Vertical) ? ImGuiAxis_Y : ImGuiAxis_X; @@ -1793,7 +1790,7 @@ void ImGuiWrapper::search_list(const ImVec2& size_, bool (*items_getter)(int, co ImGui::ListBoxFooter(); - auto check_box = [&edited, this](const wxString& label, bool& check) { + /*auto check_box = [&edited, this](const wxString& label, bool& check) { ImGui::SameLine(); bool ch = check; checkbox(label, ch); @@ -1801,7 +1798,7 @@ void ImGuiWrapper::search_list(const ImVec2& size_, bool (*items_getter)(int, co check = !check; edited = true; } - }; + };*/ ImGui::AlignTextToFramePadding(); @@ -3149,7 +3146,6 @@ bool IMTexture::load_from_svg_file(const std::string& filename, unsigned width, std::vector data(n_pixels * 4, 0); nsvgRasterize(rast, image, 0, 0, scale, data.data(), width, height, width * 4); - bool compress = false; GLint last_texture; unsigned m_image_texture{ 0 }; unsigned char* pixels = (unsigned char*)(&data[0]); diff --git a/src/slic3r/GUI/Jobs/ArrangeJob.cpp b/src/slic3r/GUI/Jobs/ArrangeJob.cpp index 6648b0e632..f0d82e3d30 100644 --- a/src/slic3r/GUI/Jobs/ArrangeJob.cpp +++ b/src/slic3r/GUI/Jobs/ArrangeJob.cpp @@ -136,7 +136,6 @@ void ArrangeJob::prepare_selected() { inst_sel[size_t(inst_id)] = true; for (size_t i = 0; i < inst_sel.size(); ++i) { - ModelInstance* mi = mo->instances[i]; ArrangePolygon&& ap = prepare_arrange_polygon(mo->instances[i]); //BBS: partplate_list preprocess //remove the locked plate's instances, neither in selected, nor in un-selected @@ -208,7 +207,6 @@ void ArrangeJob::prepare_all() { ModelObject *mo = model.objects[oidx]; for (size_t i = 0; i < mo->instances.size(); ++i) { - ModelInstance * mi = mo->instances[i]; ArrangePolygon&& ap = prepare_arrange_polygon(mo->instances[i]); //BBS: partplate_list preprocess //remove the locked plate's instances, neither in selected, nor in un-selected @@ -324,7 +322,6 @@ void ArrangeJob::prepare_wipe_tower() wipe_tower_ap.name = "WipeTower"; wipe_tower_ap.is_virt_object = true; wipe_tower_ap.is_wipe_tower = true; - const GLCanvas3D* canvas3D = static_cast(m_plater->canvas3D()); std::set extruder_ids; PartPlateList& ppl = wxGetApp().plater()->get_partplate_list(); @@ -530,7 +527,6 @@ void ArrangeJob::process(Ctl &ctl) auto & partplate_list = m_plater->get_partplate_list(); const Slic3r::DynamicPrintConfig& global_config = wxGetApp().preset_bundle->full_config(); - PresetBundle* preset_bundle = wxGetApp().preset_bundle; const bool is_bbl = wxGetApp().preset_bundle->is_bbl_vendor(); if (is_bbl && params.avoid_extrusion_cali_region && global_config.opt_bool("scan_first_layer")) partplate_list.preprocess_nonprefered_areas(m_unselected, MAX_NUM_PLATES); diff --git a/src/slic3r/GUI/Jobs/FillBedJob.cpp b/src/slic3r/GUI/Jobs/FillBedJob.cpp index e594f98ae1..d9af3631c7 100644 --- a/src/slic3r/GUI/Jobs/FillBedJob.cpp +++ b/src/slic3r/GUI/Jobs/FillBedJob.cpp @@ -127,8 +127,8 @@ void FillBedJob::prepare() m_bedpts = get_bed_shape(*m_plater->config()); - auto &objects = m_plater->model().objects; - /*BoundingBox bedbb = get_extents(m_bedpts); + /*auto &objects = m_plater->model().objects; + BoundingBox bedbb = get_extents(m_bedpts); for (size_t idx = 0; idx < objects.size(); ++idx) if (int(idx) != m_object_idx) @@ -209,9 +209,7 @@ void FillBedJob::process(Ctl &ctl) m_bedpts = get_shrink_bedpts(m_plater->config(), params); auto &partplate_list = m_plater->get_partplate_list(); - auto &print = wxGetApp().plater()->get_partplate_list().get_current_fff_print(); const Slic3r::DynamicPrintConfig& global_config = wxGetApp().preset_bundle->full_config(); - PresetBundle* preset_bundle = wxGetApp().preset_bundle; const bool is_bbl = wxGetApp().preset_bundle->is_bbl_vendor(); if (is_bbl && params.avoid_extrusion_cali_region && global_config.opt_bool("scan_first_layer")) partplate_list.preprocess_nonprefered_areas(m_unselected, MAX_NUM_PLATES); @@ -275,8 +273,6 @@ void FillBedJob::finalize(bool canceled, std::exception_ptr &eptr) int plate_cols = plate_list.get_plate_cols(); int cur_plate = plate_list.get_curr_plate_index(); - size_t inst_cnt = model_object->instances.size(); - int added_cnt = std::accumulate(m_selected.begin(), m_selected.end(), 0, [](int s, auto &ap) { return s + int(ap.priority == 0 && ap.bed_idx == 0); }); diff --git a/src/slic3r/GUI/Jobs/OrientJob.cpp b/src/slic3r/GUI/Jobs/OrientJob.cpp index be59225d8d..27dac69b56 100644 --- a/src/slic3r/GUI/Jobs/OrientJob.cpp +++ b/src/slic3r/GUI/Jobs/OrientJob.cpp @@ -46,7 +46,6 @@ void OrientJob::prepare_selection(std::vector obj_sel, bool only_one_plate ModelInstance* mi = mo->instances[inst_idx]; OrientMesh&& om = get_orient_mesh(mi); - bool locked = false; if (!only_one_plate) { int plate_index = plate_list.find_instance(oidx, inst_idx); if ((plate_index >= 0)&&(plate_index < plate_list.get_plate_count())) { diff --git a/src/slic3r/GUI/Jobs/PrintJob.cpp b/src/slic3r/GUI/Jobs/PrintJob.cpp index a54310c234..53fad3dbdd 100644 --- a/src/slic3r/GUI/Jobs/PrintJob.cpp +++ b/src/slic3r/GUI/Jobs/PrintJob.cpp @@ -103,9 +103,6 @@ wxString PrintJob::get_http_error_msg(unsigned int status, std::string body) if (!j["message"].is_null()) message = j["message"].get(); } - switch (status) { - ; - } } catch (...) { ; @@ -137,7 +134,6 @@ void PrintJob::process(Ctl &ctl) wxString error_str; int curr_percent = 10; NetworkAgent* m_agent = wxGetApp().getAgent(); - AppConfig* config = wxGetApp().app_config; if (this->connection_type == "lan") { msg = _u8L("Sending print job over LAN"); @@ -150,12 +146,9 @@ void PrintJob::process(Ctl &ctl) ctl.call_on_main_thread([this] { prepare(); }).wait(); int result = -1; - unsigned int http_code; std::string http_body; - int total_plate_num = plate_data.plate_count; if (!plate_data.is_valid) { - total_plate_num = m_plater->get_partplate_list().get_plate_count(); PartPlate *plate = m_plater->get_partplate_list().get_plate(job_data.plate_idx); if (plate == nullptr) { plate = m_plater->get_partplate_list().get_curr_plate(); @@ -312,7 +305,7 @@ void PrintJob::process(Ctl &ctl) try { stl_design_id = std::stoi(wxGetApp().model().stl_design_id); } - catch (const std::exception& e) { + catch (std::exception&) { stl_design_id = 0; } params.stl_design_id = stl_design_id; @@ -447,7 +440,7 @@ void PrintJob::process(Ctl &ctl) std::string curr_job_id; json job_info_j; try { - job_info_j.parse(job_info); + job_info_j = json::parse(job_info); if (job_info_j.contains("job_id")) { curr_job_id = job_info_j["job_id"].get(); } diff --git a/src/slic3r/GUI/Jobs/RotoptimizeJob.cpp b/src/slic3r/GUI/Jobs/RotoptimizeJob.cpp index 263273984b..3fd2b375bf 100644 --- a/src/slic3r/GUI/Jobs/RotoptimizeJob.cpp +++ b/src/slic3r/GUI/Jobs/RotoptimizeJob.cpp @@ -57,8 +57,7 @@ void RotoptimizeJob::process(Ctl &ctl) .print_config(&m_default_print_cfg) .statucb([this, &prev_status, &ctl/*, &statustxt*/](int s) { - if (s > 0 && s < 100) - ; +// if (s > 0 && s < 100) // ctl.update_status(prev_status + s / m_selected_object_ids.size(), // statustxt); diff --git a/src/slic3r/GUI/Jobs/SendJob.cpp b/src/slic3r/GUI/Jobs/SendJob.cpp index 6566060546..cb9f87e95a 100644 --- a/src/slic3r/GUI/Jobs/SendJob.cpp +++ b/src/slic3r/GUI/Jobs/SendJob.cpp @@ -67,9 +67,6 @@ wxString SendJob::get_http_error_msg(unsigned int status, std::string body) if (!j["message"].is_null()) message = j["message"].get(); } - switch (status) { - ; - } } catch (...) { ; @@ -109,9 +106,7 @@ void SendJob::process(Ctl &ctl) std::string msg; int curr_percent = 10; NetworkAgent* m_agent = wxGetApp().getAgent(); - AppConfig* config = wxGetApp().app_config; int result = -1; - unsigned int http_code; std::string http_body; if (this->connection_type == "lan") { diff --git a/src/slic3r/GUI/KBShortcutsDialog.cpp b/src/slic3r/GUI/KBShortcutsDialog.cpp index 9d368f9e86..56a575a350 100644 --- a/src/slic3r/GUI/KBShortcutsDialog.cpp +++ b/src/slic3r/GUI/KBShortcutsDialog.cpp @@ -183,11 +183,7 @@ void KBShortcutsDialog::fill_shortcuts() // Slice plate { ctrl + "R", L("Slice plate")}, // Send to Print -#ifdef __APPLE__ - { L("⌘+Shift+G"), L("Print plate")}, -#else - { L("Ctrl+Shift+G"), L("Print plate")}, -#endif // __APPLE + { ctrl + L("Shift+G"), L("Print plate")}, // Edit { ctrl + "X", L("Cut") }, @@ -226,16 +222,9 @@ void KBShortcutsDialog::fill_shortcuts() {L("Shift+R"), L("Auto orientates selected objects or all objects.If there are selected objects, it just orientates the selected ones.Otherwise, it will orientates all objects in the current disk.")}, {L("Shift+Tab"), L("Collapse/Expand the sidebar")}, - #ifdef __APPLE__ - {L("⌘+Any arrow"), L("Movement in camera space")}, - {L("⌥+Left mouse button"), L("Select a part")}, - {L("⌘+Left mouse button"), L("Select multiple objects")}, - #else - {L("Ctrl+Any arrow"), L("Movement in camera space")}, - {L("Alt+Left mouse button"), L("Select a part")}, - {L("Ctrl+Left mouse button"), L("Select multiple objects")}, - - #endif + { ctrl + L("Any arrow"), L("Movement in camera space")}, + { alt + L("Left mouse button"), L("Select a part")}, + { ctrl + L("Left mouse button"), L("Select multiple objects")}, {L("Shift+Left mouse button"), L("Select objects by rectangle")}, {L("Arrow Up"), L("Move selection 10 mm in positive Y direction")}, {L("Arrow Down"), L("Move selection 10 mm in negative Y direction")}, @@ -274,13 +263,8 @@ void KBShortcutsDialog::fill_shortcuts() Shortcuts gizmos_shortcuts = { {L("Esc"), L("Deselect all")}, {L("Shift+"), L("Move: press to snap by 1mm")}, - #ifdef __APPLE__ - {L("⌘+Mouse wheel"), L("Support/Color Painting: adjust pen radius")}, - {L("⌥+Mouse wheel"), L("Support/Color Painting: adjust section position")}, - #else - {L("Ctrl+Mouse wheel"), L("Support/Color Painting: adjust pen radius")}, - {L("Alt+Mouse wheel"), L("Support/Color Painting: adjust section position")}, - #endif + { ctrl + L("Mouse wheel"), L("Support/Color Painting: adjust pen radius")}, + { alt + L("Mouse wheel"), L("Support/Color Painting: adjust section position")}, }; m_full_shortcuts.push_back({{_L("Gizmo"), ""}, gizmos_shortcuts}); @@ -311,13 +295,8 @@ void KBShortcutsDialog::fill_shortcuts() { "Tab", L("Switch between Prepare/Preview") }, {L("Shift+Any arrow"), L("Move slider 5x faster")}, {L("Shift+Mouse wheel"), L("Move slider 5x faster")}, - #ifdef __APPLE__ - {L("⌘+Any arrow"), L("Move slider 5x faster")}, - {L("⌘+Mouse wheel"), L("Move slider 5x faster")}, - #else - {L("Ctrl+Any arrow"), L("Move slider 5x faster")}, - {L("Ctrl+Mouse wheel"), L("Move slider 5x faster")}, - #endif + { ctrl + L("Any arrow"), L("Move slider 5x faster")}, + { ctrl + L("Mouse wheel"), L("Move slider 5x faster")}, { L("Home"), L("Horizontal slider - Move to start position")}, { L("End"), L("Horizontal slider - Move to last position")}, }; diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 2f59daffbb..9a48e320d1 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -743,7 +743,6 @@ void MainFrame::update_layout() if (m_layout != ESettingsLayout::Unknown) restore_to_creation(); - ESettingsLayout old_layout = m_layout; m_layout = layout; // From the very beginning the Print settings should be selected @@ -1488,7 +1487,6 @@ bool MainFrame::can_reslice() const wxBoxSizer* MainFrame::create_side_tools() { enable_multi_machine = wxGetApp().is_enable_multi_machine(); - int em = em_unit(); wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL); m_slice_select = eSlicePlate; @@ -1779,7 +1777,7 @@ wxBoxSizer* MainFrame::create_side_tools() aux_btn->Bind(wxEVT_BUTTON, [](auto e) { wxGetApp().sidebar().show_auxiliary_dialog(); }); - sizer->Add(aux_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 1 * em / 10); + sizer->Add(aux_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 1 * em_unit() / 10); */ sizer->Add(FromDIP(19), 0, 0, 0, 0); @@ -1924,9 +1922,6 @@ bool MainFrame::get_enable_print_status() void MainFrame::update_side_button_style() { - // BBS - int em = em_unit(); - /*m_slice_btn->SetLayoutStyle(1); m_slice_btn->SetTextLayout(SideButton::EHorizontalOrientation::HO_Center, FromDIP(15)); m_slice_btn->SetMinSize(wxSize(-1, FromDIP(24))); @@ -2188,9 +2183,6 @@ static void add_common_publish_menu_items(wxMenu* publish_menu, MainFrame* mainF return; } - json j; - NetworkAgent* agent = GUI::wxGetApp().getAgent(); - //if (GUI::wxGetApp().plater()->model().objects.empty()) return; wxGetApp().open_publish_page_dialog(); }); @@ -2588,13 +2580,13 @@ void MainFrame::init_menubar_as_editor() //BBS perspective view wxWindowID camera_id_base = wxWindow::NewControlId(int(wxID_CAMERA_COUNT)); - auto perspective_item = append_menu_radio_item(viewMenu, wxID_CAMERA_PERSPECTIVE + camera_id_base, _L("Use Perspective View"), _L("Use Perspective View"), + append_menu_radio_item(viewMenu, wxID_CAMERA_PERSPECTIVE + camera_id_base, _L("Use Perspective View"), _L("Use Perspective View"), [this](wxCommandEvent&) { wxGetApp().app_config->set_bool("use_perspective_camera", true); wxGetApp().update_ui_from_settings(); }, nullptr); //BBS orthogonal view - auto orthogonal_item = append_menu_radio_item(viewMenu, wxID_CAMERA_ORTHOGONAL + camera_id_base, _L("Use Orthogonal View"), _L("Use Orthogonal View"), + append_menu_radio_item(viewMenu, wxID_CAMERA_ORTHOGONAL + camera_id_base, _L("Use Orthogonal View"), _L("Use Orthogonal View"), [this](wxCommandEvent&) { wxGetApp().app_config->set_bool("use_perspective_camera", false); wxGetApp().update_ui_from_settings(); @@ -2669,7 +2661,8 @@ void MainFrame::init_menubar_as_editor() //auto preference_item = new wxMenuItem(parent_menu, OrcaSlicerMenuPreferences + bambu_studio_id_base, _L("Preferences") + "\tCtrl+,", ""); #else wxMenu* parent_menu = m_topbar->GetTopMenu(); - auto preference_item = new wxMenuItem(parent_menu, ConfigMenuPreferences + config_id_base, _L("Preferences") + "\t" + ctrl + "P", ""); + // auto preference_item = + new wxMenuItem(parent_menu, ConfigMenuPreferences + config_id_base, _L("Preferences") + "\t" + ctrl + "P", ""); #endif //auto printer_item = new wxMenuItem(parent_menu, ConfigMenuPrinter + config_id_base, _L("Printer"), ""); @@ -3100,10 +3093,6 @@ void MainFrame::init_menubar_as_gcodeviewer() void MainFrame::update_menubar() { - if (wxGetApp().is_gcode_viewer()) - return; - - const bool is_fff = plater()->printer_technology() == ptFFF; } void MainFrame::reslice_now() @@ -3179,7 +3168,6 @@ void MainFrame::load_config_file() cfiles.push_back(into_u8(file)); m_last_config = file; } - bool update = false; wxGetApp().preset_bundle->import_presets(cfiles, [this](std::string const & name) { ConfigsOverwriteConfirmDialog dlg(this, from_u8(name), false); int res = dlg.ShowModal(); @@ -3749,7 +3737,6 @@ void MainFrame::on_select_default_preset(SimpleEvent& evt) wxICON_INFORMATION); /* get setting list */ - NetworkAgent* agent = wxGetApp().getAgent(); switch ( dialog.ShowModal() ) { case wxID_YES: { diff --git a/src/slic3r/GUI/MediaFilePanel.cpp b/src/slic3r/GUI/MediaFilePanel.cpp index b2032b09ad..faa694090b 100644 --- a/src/slic3r/GUI/MediaFilePanel.cpp +++ b/src/slic3r/GUI/MediaFilePanel.cpp @@ -328,7 +328,6 @@ void MediaFilePanel::SetMachineObject(MachineObject* obj) MessageDialog(this, m, _L("Download failed"), wxOK | wxICON_ERROR).ShowModal(); }); - NetworkAgent* agent = wxGetApp().getAgent(); if (result > 1 || result == 0) { json j; j["code"] = result; @@ -576,7 +575,7 @@ void MediaFilePanel::doAction(size_t index, int action) } else { MessageDialog dlg(this, _L("The .gcode.3mf file contains no G-code data.Please slice it with Orca Slicer and export a new .gcode.3mf file."), wxEmptyString, wxICON_WARNING | wxOK); - auto res = dlg.ShowModal(); + dlg.ShowModal(); } }); diff --git a/src/slic3r/GUI/MediaPlayCtrl.cpp b/src/slic3r/GUI/MediaPlayCtrl.cpp index 36500f69fa..da70eeff65 100644 --- a/src/slic3r/GUI/MediaPlayCtrl.cpp +++ b/src/slic3r/GUI/MediaPlayCtrl.cpp @@ -67,7 +67,7 @@ MediaPlayCtrl::MediaPlayCtrl(wxWindow *parent, wxMediaCtrl2 *media_ctrl, const w auto ip = str.find(' ', ik); if (ip == wxString::npos) ip = str.Length(); auto v = str.Mid(ik, ip - ik); - if (k == "T:" && v.Length() == 8) { + if (strcmp(k, "T:") == 0 && v.Length() == 8) { long h = 0,m = 0,s = 0; v.Left(2).ToLong(&h); v.Mid(3, 2).ToLong(&m); @@ -389,7 +389,7 @@ void MediaPlayCtrl::Stop(wxString const &msg) } auto tunnel = m_url.empty() ? "" : into_u8(wxURI(m_url).GetPath()).substr(1); - if (auto n = tunnel.find_first_of('/_'); n != std::string::npos) + if (auto n = tunnel.find_first_of("/_"); n != std::string::npos) tunnel = tunnel.substr(0, n); if (last_state != wxMEDIASTATE_PLAYING && m_failed_code != 0 && m_last_failed_codes.find(m_failed_code) == m_last_failed_codes.end() @@ -734,7 +734,7 @@ bool MediaPlayCtrl::start_stream_service(bool *need_install) auto file_dll = tools_dir + dll; auto file_dll2 = plugins_dir + dll; if (!boost::filesystem::exists(file_dll) || boost::filesystem::last_write_time(file_dll) != boost::filesystem::last_write_time(file_dll2)) - boost::filesystem::copy_file(file_dll2, file_dll, boost::filesystem::copy_option::overwrite_if_exists); + boost::filesystem::copy_file(file_dll2, file_dll, boost::filesystem::copy_options::overwrite_existing); } boost::process::child process_source(file_source, file_url2.ToStdWstring(), boost::process::start_dir(tools_dir), boost::process::windows::create_no_window, diff --git a/src/slic3r/GUI/ModelMall.cpp b/src/slic3r/GUI/ModelMall.cpp index f14de1ebf0..45833ba80c 100644 --- a/src/slic3r/GUI/ModelMall.cpp +++ b/src/slic3r/GUI/ModelMall.cpp @@ -133,7 +133,7 @@ namespace GUI { } } - catch (std::exception& e) { + catch (std::exception&) { // wxMessageBox(e.what(), "json Exception", MB_OK); } } diff --git a/src/slic3r/GUI/Monitor.cpp b/src/slic3r/GUI/Monitor.cpp index 333f4d3de0..3bcc0ce224 100644 --- a/src/slic3r/GUI/Monitor.cpp +++ b/src/slic3r/GUI/Monitor.cpp @@ -114,7 +114,7 @@ AddMachinePanel::~AddMachinePanel() { m_side_tools->get_panel()->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MonitorPanel::on_printer_clicked), NULL, this); - Bind(wxEVT_TIMER, &MonitorPanel::on_timer, this); + Bind(wxEVT_TIMER, [this](wxTimerEvent&) { on_timer(); }); Bind(wxEVT_SIZE, &MonitorPanel::on_size, this); Bind(wxEVT_COMMAND_CHOICE_SELECTED, &MonitorPanel::on_select_printer, this); @@ -160,7 +160,7 @@ MonitorPanel::~MonitorPanel() m_refresh_timer = new wxTimer(); m_refresh_timer->SetOwner(this); m_refresh_timer->Start(REFRESH_INTERVAL); - wxPostEvent(this, wxTimerEvent()); + on_timer(); Slic3r::DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager(); if (!dev) return; @@ -272,7 +272,7 @@ void MonitorPanel::on_update_all(wxMouseEvent &event) } } - void MonitorPanel::on_timer(wxTimerEvent& event) +void MonitorPanel::on_timer() { if (update_flag) { update_all(); @@ -306,9 +306,6 @@ void MonitorPanel::on_update_all(wxMouseEvent &event) void MonitorPanel::on_printer_clicked(wxMouseEvent &event) { - auto mouse_pos = ClientToScreen(event.GetPosition()); - wxPoint rect = m_side_tools->ClientToScreen(wxPoint(0, 0)); - if (!m_side_tools->is_in_interval()) { wxPoint pos = m_side_tools->ClientToScreen(wxPoint(0, 0)); pos.y += m_side_tools->GetRect().height; @@ -434,7 +431,6 @@ bool MonitorPanel::Show(bool show) wxGetApp().mainframe->SetMinSize(wxGetApp().plater()->GetMinSize()); #endif - NetworkAgent* m_agent = wxGetApp().getAgent(); DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager(); if (show) { start_update(); @@ -442,7 +438,7 @@ bool MonitorPanel::Show(bool show) m_refresh_timer->Stop(); m_refresh_timer->SetOwner(this); m_refresh_timer->Start(REFRESH_INTERVAL); - wxPostEvent(this, wxTimerEvent()); + on_timer(); if (dev) { //set a default machine when obj is null @@ -485,7 +481,6 @@ void MonitorPanel::show_status(int status) if (!m_initialized) return; if (last_status == status)return; if ((last_status & (int)MonitorStatus::MONITOR_CONNECTING) != 0) { - NetworkAgent* agent = wxGetApp().getAgent(); json j; j["dev_id"] = obj ? obj->dev_id : "obj_nullptr"; if ((status & (int)MonitorStatus::MONITOR_DISCONNECTED) != 0) { diff --git a/src/slic3r/GUI/Monitor.hpp b/src/slic3r/GUI/Monitor.hpp index 8da56ddc3b..761b059a0a 100644 --- a/src/slic3r/GUI/Monitor.hpp +++ b/src/slic3r/GUI/Monitor.hpp @@ -133,7 +133,7 @@ public: StatusPanel* get_status_panel() {return m_status_info_panel;}; void select_machine(std::string machine_sn); void on_update_all(wxMouseEvent &event); - void on_timer(wxTimerEvent& event); + void on_timer(); void on_select_printer(wxCommandEvent& event); void on_printer_clicked(wxMouseEvent &event); void on_size(wxSizeEvent &event); diff --git a/src/slic3r/GUI/MonitorBasePanel.cpp b/src/slic3r/GUI/MonitorBasePanel.cpp index 553b8f0993..24760577a6 100644 --- a/src/slic3r/GUI/MonitorBasePanel.cpp +++ b/src/slic3r/GUI/MonitorBasePanel.cpp @@ -6,7 +6,6 @@ /////////////////////////////////////////////////////////////////////////// #include "MonitorBasePanel.h" -#include "Printer/PrinterFileSystem.h" #include "Widgets/Label.hpp" /////////////////////////////////////////////////////////////////////////// @@ -21,7 +20,7 @@ MonitorBasePanel::MonitorBasePanel(wxWindow* parent, wxWindowID id, const wxPoin m_splitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D | wxSP_BORDER); m_splitter->SetSashGravity(0); - m_splitter->SetSashSize(0); + m_splitter->SetSashInvisible(); m_splitter->Connect(wxEVT_IDLE, wxIdleEventHandler(MonitorBasePanel::m_splitterOnIdle), NULL, this); m_splitter->SetMinimumPaneSize(182); @@ -281,7 +280,7 @@ VideoMonitoringBasePanel::~VideoMonitoringBasePanel() // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#include "MonitorBasePanel.h" +//#include "MonitorBasePanel.h" /////////////////////////////////////////////////////////////////////////// using namespace Slic3r::GUI; diff --git a/src/slic3r/GUI/MultiMachine.hpp b/src/slic3r/GUI/MultiMachine.hpp index 48a6ed4180..04ff304bca 100644 --- a/src/slic3r/GUI/MultiMachine.hpp +++ b/src/slic3r/GUI/MultiMachine.hpp @@ -9,16 +9,16 @@ namespace Slic3r { namespace GUI { -#define DEVICE_ITEM_MAX_WIDTH 900 -#define SEND_ITEM_MAX_HEIGHT 30 -#define DEVICE_ITEM_MAX_HEIGHT 50 +#define DEVICE_ITEM_MAX_WIDTH 900 +#define SEND_ITEM_MAX_HEIGHT 30 +#define DEVICE_ITEM_MAX_HEIGHT 50 #define TABLE_HEAR_NORMAL_COLOUR wxColour(238, 238, 238) #define TABLE_HEAD_PRESSED_COLOUR wxColour(150, 150, 150) #define CTRL_BUTTON_NORMAL_COLOUR wxColour(255, 255, 255) #define CTRL_BUTTON_PRESSEN_COLOUR wxColour(150, 150, 150) #define TABLE_HEAD_FONT Label::Body_13 -#define ICON_SIZE FromDIP(16) +#define MM_ICON_SIZE FromDIP(16) class DeviceItem : public wxWindow { diff --git a/src/slic3r/GUI/MultiMachineManagerPage.cpp b/src/slic3r/GUI/MultiMachineManagerPage.cpp index b37810f07f..9a112d32c3 100644 --- a/src/slic3r/GUI/MultiMachineManagerPage.cpp +++ b/src/slic3r/GUI/MultiMachineManagerPage.cpp @@ -320,7 +320,7 @@ MultiMachineManagerPage::MultiMachineManagerPage(wxWindow* parent) m_table_head_panel->SetBackgroundColour(TABLE_HEAR_NORMAL_COLOUR); m_table_head_sizer = new wxBoxSizer(wxHORIZONTAL); - m_printer_name = new Button(m_table_head_panel, _L("Device Name"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE); + m_printer_name = new Button(m_table_head_panel, _L("Device Name"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE); m_printer_name->SetBackgroundColor(head_bg); m_printer_name->SetFont(TABLE_HEAD_FONT); m_printer_name->SetCornerRadius(0); @@ -343,7 +343,7 @@ MultiMachineManagerPage::MultiMachineManagerPage(wxWindow* parent) }); - m_task_name = new Button(m_table_head_panel, _L("Task Name"), "", wxNO_BORDER, ICON_SIZE); + m_task_name = new Button(m_table_head_panel, _L("Task Name"), "", wxNO_BORDER, MM_ICON_SIZE); m_task_name->SetBackgroundColor(TABLE_HEAR_NORMAL_COLOUR); m_task_name->SetFont(TABLE_HEAD_FONT); m_task_name->SetCornerRadius(0); @@ -353,7 +353,7 @@ MultiMachineManagerPage::MultiMachineManagerPage(wxWindow* parent) - m_status = new Button(m_table_head_panel, _L("Device Status"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE); + m_status = new Button(m_table_head_panel, _L("Device Status"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE); m_status->SetBackgroundColor(head_bg); m_status->SetFont(TABLE_HEAD_FONT); m_status->SetCornerRadius(0); @@ -376,7 +376,7 @@ MultiMachineManagerPage::MultiMachineManagerPage(wxWindow* parent) }); - m_action = new Button(m_table_head_panel, _L("Actions"), "", wxNO_BORDER, ICON_SIZE, false); + m_action = new Button(m_table_head_panel, _L("Actions"), "", wxNO_BORDER, MM_ICON_SIZE, false); m_action->SetBackgroundColor(TABLE_HEAR_NORMAL_COLOUR); m_action->SetFont(TABLE_HEAD_FONT); m_action->SetCornerRadius(0); @@ -523,7 +523,7 @@ MultiMachineManagerPage::MultiMachineManagerPage(wxWindow* parent) Layout(); Fit(); - Bind(wxEVT_TIMER, &MultiMachineManagerPage::on_timer, this); + Bind(wxEVT_TIMER, [this](wxTimerEvent&) { on_timer(); }); } void MultiMachineManagerPage::update_page() @@ -676,7 +676,7 @@ void MultiMachineManagerPage::start_timer() m_flipping_timer->SetOwner(this); m_flipping_timer->Start(1000); - wxPostEvent(this, wxTimerEvent()); + on_timer(); } void MultiMachineManagerPage::update_page_number() @@ -688,7 +688,7 @@ void MultiMachineManagerPage::update_page_number() st_page_number->SetLabel(number); } -void MultiMachineManagerPage::on_timer(wxTimerEvent& event) +void MultiMachineManagerPage::on_timer() { m_flipping_timer->Stop(); if (btn_last_page) diff --git a/src/slic3r/GUI/MultiMachineManagerPage.hpp b/src/slic3r/GUI/MultiMachineManagerPage.hpp index c1086b4721..55eb500540 100644 --- a/src/slic3r/GUI/MultiMachineManagerPage.hpp +++ b/src/slic3r/GUI/MultiMachineManagerPage.hpp @@ -55,7 +55,7 @@ public: void start_timer(); void update_page_number(); - void on_timer(wxTimerEvent& event); + void on_timer(); void clear_page(); void page_num_enter_evt(); diff --git a/src/slic3r/GUI/MultiMachinePage.cpp b/src/slic3r/GUI/MultiMachinePage.cpp index 9aed022ba3..cb1fea926d 100644 --- a/src/slic3r/GUI/MultiMachinePage.cpp +++ b/src/slic3r/GUI/MultiMachinePage.cpp @@ -19,7 +19,7 @@ MultiMachinePage::MultiMachinePage(wxWindow* parent, wxWindowID id, const wxPoin wxGetApp().UpdateDarkUIWin(this); init_timer(); - Bind(wxEVT_TIMER, &MultiMachinePage::on_timer, this); + Bind(wxEVT_TIMER, [this](wxTimerEvent&) { on_timer(); }); } MultiMachinePage::~MultiMachinePage() @@ -59,7 +59,7 @@ bool MultiMachinePage::Show(bool show) m_refresh_timer->Stop(); m_refresh_timer->SetOwner(this); m_refresh_timer->Start(2000); - wxPostEvent(this, wxTimerEvent()); + on_timer(); } else { m_refresh_timer->Stop(); @@ -97,7 +97,7 @@ void MultiMachinePage::init_timer() //wxPostEvent(this, wxTimerEvent()); } -void MultiMachinePage::on_timer(wxTimerEvent& event) +void MultiMachinePage::on_timer() { m_local_task_manager->update_page(); m_cloud_task_manager->update_page(); diff --git a/src/slic3r/GUI/MultiMachinePage.hpp b/src/slic3r/GUI/MultiMachinePage.hpp index 0572c30d1b..7e948fa479 100644 --- a/src/slic3r/GUI/MultiMachinePage.hpp +++ b/src/slic3r/GUI/MultiMachinePage.hpp @@ -41,7 +41,7 @@ public: void init_tabpanel(); void init_timer(); - void on_timer(wxTimerEvent& event); + void on_timer(); void clear_page(); }; diff --git a/src/slic3r/GUI/MultiTaskManagerPage.cpp b/src/slic3r/GUI/MultiTaskManagerPage.cpp index f2d159a7de..3d295eb97c 100644 --- a/src/slic3r/GUI/MultiTaskManagerPage.cpp +++ b/src/slic3r/GUI/MultiTaskManagerPage.cpp @@ -4,7 +4,6 @@ #include "GUI_App.hpp" #include "MainFrame.hpp" #include "Widgets/RadioBox.hpp" -#include #include namespace Slic3r { @@ -574,7 +573,7 @@ LocalTaskManagerPage::LocalTaskManagerPage(wxWindow* parent) }); - m_task_name = new Button(m_table_head_panel, _L("Task Name"), "", wxNO_BORDER, ICON_SIZE); + m_task_name = new Button(m_table_head_panel, _L("Task Name"), "", wxNO_BORDER, MM_ICON_SIZE); m_task_name->SetBackgroundColor(TABLE_HEAR_NORMAL_COLOUR); m_task_name->SetFont(TABLE_HEAD_FONT); m_task_name->SetCornerRadius(0); @@ -583,7 +582,7 @@ LocalTaskManagerPage::LocalTaskManagerPage(wxWindow* parent) m_task_name->SetCenter(false); m_table_head_sizer->Add(m_task_name, 0, wxALIGN_CENTER_VERTICAL, 0); - m_printer_name = new Button(m_table_head_panel, _L("Device Name"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE); + m_printer_name = new Button(m_table_head_panel, _L("Device Name"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE); m_printer_name->SetBackgroundColor(head_bg); m_printer_name->SetFont(TABLE_HEAD_FONT); m_printer_name->SetCornerRadius(0); @@ -603,7 +602,7 @@ LocalTaskManagerPage::LocalTaskManagerPage(wxWindow* parent) }); m_table_head_sizer->Add(m_printer_name, 0, wxALIGN_CENTER_VERTICAL, 0); - m_status = new Button(m_table_head_panel, _L("Task Status"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE); + m_status = new Button(m_table_head_panel, _L("Task Status"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE); m_status->SetBackgroundColor(head_bg); m_status->SetFont(TABLE_HEAD_FONT); m_status->SetCornerRadius(0); @@ -623,7 +622,7 @@ LocalTaskManagerPage::LocalTaskManagerPage(wxWindow* parent) }); m_table_head_sizer->Add(m_status, 0, wxALIGN_CENTER_VERTICAL, 0); - m_info = new Button(m_table_head_panel, _L("Info"), "", wxNO_BORDER, ICON_SIZE); + m_info = new Button(m_table_head_panel, _L("Info"), "", wxNO_BORDER, MM_ICON_SIZE); m_info->SetBackgroundColor(TABLE_HEAR_NORMAL_COLOUR); m_info->SetFont(TABLE_HEAD_FONT); m_info->SetCornerRadius(0); @@ -632,7 +631,7 @@ LocalTaskManagerPage::LocalTaskManagerPage(wxWindow* parent) m_info->SetCenter(false); m_table_head_sizer->Add(m_info, 0, wxALIGN_CENTER_VERTICAL, 0); - m_send_time = new Button(m_table_head_panel, _L("Sent Time"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE, false); + m_send_time = new Button(m_table_head_panel, _L("Sent Time"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE, false); m_send_time->SetBackgroundColor(head_bg); m_send_time->SetFont(TABLE_HEAD_FONT); m_send_time->SetCornerRadius(0); @@ -652,7 +651,7 @@ LocalTaskManagerPage::LocalTaskManagerPage(wxWindow* parent) }); m_table_head_sizer->Add(m_send_time, 0, wxALIGN_CENTER_VERTICAL, 0); - m_action = new Button(m_table_head_panel, _L("Actions"), "", wxNO_BORDER, ICON_SIZE, false); + m_action = new Button(m_table_head_panel, _L("Actions"), "", wxNO_BORDER, MM_ICON_SIZE, false); m_action->SetBackgroundColor(TABLE_HEAR_NORMAL_COLOUR); m_action->SetFont(TABLE_HEAD_FONT); m_action->SetCornerRadius(0); @@ -946,7 +945,7 @@ CloudTaskManagerPage::CloudTaskManagerPage(wxWindow* parent) - m_task_name = new Button(m_table_head_panel, _L("Task Name"), "", wxNO_BORDER, ICON_SIZE); + m_task_name = new Button(m_table_head_panel, _L("Task Name"), "", wxNO_BORDER, MM_ICON_SIZE); m_task_name->SetBackgroundColor(TABLE_HEAR_NORMAL_COLOUR); m_task_name->SetFont(TABLE_HEAD_FONT); m_task_name->SetCornerRadius(0); @@ -955,7 +954,7 @@ CloudTaskManagerPage::CloudTaskManagerPage(wxWindow* parent) m_task_name->SetCenter(false); m_table_head_sizer->Add(m_task_name, 0, wxALIGN_CENTER_VERTICAL, 0); - m_printer_name = new Button(m_table_head_panel, _L("Device Name"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE); + m_printer_name = new Button(m_table_head_panel, _L("Device Name"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE); m_printer_name->SetBackgroundColor(head_bg); m_printer_name->SetFont(TABLE_HEAD_FONT); m_printer_name->SetCornerRadius(0); @@ -975,7 +974,7 @@ CloudTaskManagerPage::CloudTaskManagerPage(wxWindow* parent) }); m_table_head_sizer->Add(m_printer_name, 0, wxALIGN_CENTER_VERTICAL, 0); - m_status = new Button(m_table_head_panel, _L("Task Status"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE); + m_status = new Button(m_table_head_panel, _L("Task Status"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE); m_status->SetBackgroundColor(head_bg); m_status->SetFont(TABLE_HEAD_FONT); m_status->SetCornerRadius(0); @@ -995,7 +994,7 @@ CloudTaskManagerPage::CloudTaskManagerPage(wxWindow* parent) }); m_table_head_sizer->Add(m_status, 0, wxALIGN_CENTER_VERTICAL, 0); - m_info = new Button(m_table_head_panel, _L("Info"), "", wxNO_BORDER, ICON_SIZE); + m_info = new Button(m_table_head_panel, _L("Info"), "", wxNO_BORDER, MM_ICON_SIZE); m_info->SetBackgroundColor(TABLE_HEAR_NORMAL_COLOUR); m_info->SetFont(TABLE_HEAD_FONT); m_info->SetCornerRadius(0); @@ -1004,7 +1003,7 @@ CloudTaskManagerPage::CloudTaskManagerPage(wxWindow* parent) m_info->SetCenter(false); m_table_head_sizer->Add(m_info, 0, wxALIGN_CENTER_VERTICAL, 0); - m_send_time = new Button(m_table_head_panel, _L("Sent Time"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE, false); + m_send_time = new Button(m_table_head_panel, _L("Sent Time"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE, false); m_send_time->SetBackgroundColor(head_bg); m_send_time->SetFont(TABLE_HEAD_FONT); m_send_time->SetCornerRadius(0); @@ -1024,7 +1023,7 @@ CloudTaskManagerPage::CloudTaskManagerPage(wxWindow* parent) }); m_table_head_sizer->Add(m_send_time, 0, wxALIGN_CENTER_VERTICAL, 0); - m_action = new Button(m_table_head_panel, _L("Actions"), "", wxNO_BORDER, ICON_SIZE, false); + m_action = new Button(m_table_head_panel, _L("Actions"), "", wxNO_BORDER, MM_ICON_SIZE, false); m_action->SetBackgroundColor(TABLE_HEAR_NORMAL_COLOUR); m_action->SetFont(TABLE_HEAD_FONT); m_action->SetCornerRadius(0); @@ -1183,7 +1182,7 @@ CloudTaskManagerPage::CloudTaskManagerPage(wxWindow* parent) page_sizer = new wxBoxSizer(wxVERTICAL); page_sizer->Add(m_main_panel, 1, wxALL | wxEXPAND, FromDIP(25)); - Bind(wxEVT_TIMER, &CloudTaskManagerPage::on_timer, this); + Bind(wxEVT_TIMER, [this](wxTimerEvent&) { on_timer(); }); wxGetApp().UpdateDarkUIWin(this); @@ -1400,10 +1399,10 @@ void CloudTaskManagerPage::start_timer() m_flipping_timer->SetOwner(this); m_flipping_timer->Start(1000); - wxPostEvent(this, wxTimerEvent()); + on_timer(); } -void CloudTaskManagerPage::on_timer(wxTimerEvent& event) +void CloudTaskManagerPage::on_timer() { m_flipping_timer->Stop(); enable_buttons(true); diff --git a/src/slic3r/GUI/MultiTaskManagerPage.hpp b/src/slic3r/GUI/MultiTaskManagerPage.hpp index 0f676d06b3..b32c670d5e 100644 --- a/src/slic3r/GUI/MultiTaskManagerPage.hpp +++ b/src/slic3r/GUI/MultiTaskManagerPage.hpp @@ -135,7 +135,7 @@ public: bool Show(bool show); void update_page_number(); void start_timer(); - void on_timer(wxTimerEvent& event); + void on_timer(); void pause_all(wxCommandEvent& evt); void resume_all(wxCommandEvent& evt); diff --git a/src/slic3r/GUI/Notebook.hpp b/src/slic3r/GUI/Notebook.hpp index 7e6e94da3a..5ef90a9702 100644 --- a/src/slic3r/GUI/Notebook.hpp +++ b/src/slic3r/GUI/Notebook.hpp @@ -194,8 +194,6 @@ public: // check that only the selected page is visible and others are hidden: for (size_t page = 0; page < m_pages.size(); page++) { - wxWindow* win_a = GetPage(page); - wxWindow* win_b = GetPage(n); if (page != n && GetPage(page) != GetPage(n)) { m_pages[page]->Hide(); } diff --git a/src/slic3r/GUI/NotificationManager.cpp b/src/slic3r/GUI/NotificationManager.cpp index 08ef8c7493..685058bbb3 100644 --- a/src/slic3r/GUI/NotificationManager.cpp +++ b/src/slic3r/GUI/NotificationManager.cpp @@ -857,7 +857,7 @@ void NotificationManager::PopNotification::bbl_render_block_notif_buttons(ImGuiW void NotificationManager::PopNotification::bbl_render_block_notif_left_sign(ImGuiWrapper& imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y) { - auto window = ImGui::GetCurrentWindow(); + // auto window = ImGui::GetCurrentWindow(); //window->DrawList->AddImage(user_texture_id, bb.Min + padding + margin, bb.Max - padding - margin, uv0, uv1, ImGui::GetColorU32(tint_col)); std::wstring text; diff --git a/src/slic3r/GUI/OG_CustomCtrl.cpp b/src/slic3r/GUI/OG_CustomCtrl.cpp index dadde84ebc..6fa75d7895 100644 --- a/src/slic3r/GUI/OG_CustomCtrl.cpp +++ b/src/slic3r/GUI/OG_CustomCtrl.cpp @@ -405,7 +405,6 @@ void OG_CustomCtrl::OnMotion(wxMouseEvent& event) // Set tooltips with information for each icon // BBS: markdown tip if (!markdowntip.empty()) { - wxWindow* window = GetGrandParent(); assert(focusedLine); wxPoint pos2 = { 250, focusedLine->rect_label.y }; pos2 = ClientToScreen(pos2); diff --git a/src/slic3r/GUI/ObjColorDialog.cpp b/src/slic3r/GUI/ObjColorDialog.cpp index 648faffbf9..7ac8d20bd3 100644 --- a/src/slic3r/GUI/ObjColorDialog.cpp +++ b/src/slic3r/GUI/ObjColorDialog.cpp @@ -1,9 +1,6 @@ #include -#include -//#include "libslic3r/FlushVolCalc.hpp" #include "ObjColorDialog.hpp" #include "BitmapCache.hpp" -#include "GUI.hpp" #include "I18N.hpp" #include "GUI_App.hpp" #include "MsgDialog.hpp" @@ -244,7 +241,6 @@ ObjColorPanel::ObjColorPanel(wxWindow * parent, } //end first cluster //draw ui - auto sizer_width = FromDIP(300); // Create two switched panels with their own sizers m_sizer_simple = new wxBoxSizer(wxVERTICAL); m_page_simple = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); @@ -674,7 +670,6 @@ void ObjColorPanel::draw_table() m_scrolledWindow->SetSizer(m_gridsizer); int totalHeight = row_height *(row+1) * 2; m_scrolledWindow->SetVirtualSize(MIN_OBJCOLOR_DIALOG_WIDTH, totalHeight); - auto look = FIX_SCROLL_HEIGTH; if (totalHeight > FIX_SCROLL_HEIGTH) { m_scrolledWindow->SetMinSize(wxSize(MIN_OBJCOLOR_DIALOG_WIDTH, FIX_SCROLL_HEIGTH)); m_scrolledWindow->SetMaxSize(wxSize(MIN_OBJCOLOR_DIALOG_WIDTH, FIX_SCROLL_HEIGTH)); diff --git a/src/slic3r/GUI/OptionsGroup.cpp b/src/slic3r/GUI/OptionsGroup.cpp index 936afcacb9..febc326dff 100644 --- a/src/slic3r/GUI/OptionsGroup.cpp +++ b/src/slic3r/GUI/OptionsGroup.cpp @@ -9,12 +9,8 @@ #include "Widgets/StaticLine.hpp" #include -#include #include -#include -#include #include "libslic3r/Exception.hpp" -#include "libslic3r/Utils.hpp" #include "libslic3r/AppConfig.hpp" #include "I18N.hpp" #include diff --git a/src/slic3r/GUI/PartPlate.cpp b/src/slic3r/GUI/PartPlate.cpp index c4dfc651b9..99ec73a42a 100644 --- a/src/slic3r/GUI/PartPlate.cpp +++ b/src/slic3r/GUI/PartPlate.cpp @@ -1536,9 +1536,6 @@ std::vector PartPlate::get_extruders_without_support(bool conside_custom_gc return plate_extruders; } - // if 3mf file - const DynamicPrintConfig& glb_config = wxGetApp().preset_bundle->prints.get_edited_preset().config; - for (int obj_idx = 0; obj_idx < m_model->objects.size(); obj_idx++) { if (!contain_instance_totally(obj_idx, 0)) continue; @@ -1597,14 +1594,14 @@ Vec3d PartPlate::estimate_wipe_tower_size(const DynamicPrintConfig & config, con { Vec3d wipe_tower_size; - double layer_height = 0.08f; // hard code layer height + // double layer_height = 0.08f; // hard code layer height double max_height = 0.f; wipe_tower_size.setZero(); wipe_tower_size(0) = w; - const ConfigOption* layer_height_opt = config.option("layer_height"); - if (layer_height_opt) - layer_height = layer_height_opt->getFloat(); + // const ConfigOption* layer_height_opt = config.option("layer_height"); + // if (layer_height_opt) + // layer_height = layer_height_opt->getFloat(); // empty plate if (plate_extruder_size == 0) @@ -1652,7 +1649,6 @@ Vec3d PartPlate::estimate_wipe_tower_size(const DynamicPrintConfig & config, con // If wipe tower height is between the current and next member, set the min_depth as linear interpolation between them auto next_height_to_depth = *iter; if (next_height_to_depth.first > max_height) { - float height_base = curr_height_to_depth.first; float height_diff = next_height_to_depth.first - curr_height_to_depth.first; float min_depth_base = curr_height_to_depth.second; float depth_diff = next_height_to_depth.second - curr_height_to_depth.second; @@ -2041,7 +2037,6 @@ bool PartPlate::intersect_instance(int obj_id, int instance_id, BoundingBoxf3* b if (m_printable) { ModelObject* object = m_model->objects[obj_id]; - ModelInstance* instance = object->instances[instance_id]; BoundingBoxf3 instance_box = bounding_box? *bounding_box: object->instance_convex_hull_bounding_box(instance_id); result = get_plate_box().intersects(instance_box); } @@ -2065,7 +2060,6 @@ bool PartPlate::is_left_top_of(int obj_id, int instance_id) } ModelObject* object = m_model->objects[obj_id]; - ModelInstance* instance = object->instances[instance_id]; std::pair pair(obj_id, instance_id); BoundingBoxf3 instance_box = object->instance_convex_hull_bounding_box(instance_id); @@ -2461,7 +2455,7 @@ void PartPlate::generate_print_polygon(ExPolygon &print_polygon) { auto compute_points = [&print_polygon](Vec2d& center, double radius, double start_angle, double stop_angle, int count) { - double angle, angle_steps; + double angle_steps; angle_steps = (stop_angle - start_angle) / (count - 1); for(int j = 0; j < count; j++ ) { @@ -2480,7 +2474,7 @@ void PartPlate::generate_print_polygon(ExPolygon &print_polygon) { const Vec2d& p = m_shape[i]; Vec2d center; - double start_angle, stop_angle, angle_steps, radius_x, radius_y, radius; + double start_angle, stop_angle, radius_x, radius_y, radius; switch (i) { case 0: radius = 5.f; @@ -2531,7 +2525,7 @@ void PartPlate::generate_exclude_polygon(ExPolygon &exclude_polygon) { auto compute_exclude_points = [&exclude_polygon](Vec2d& center, double radius, double start_angle, double stop_angle, int count) { - double angle, angle_steps; + double angle_steps; angle_steps = (stop_angle - start_angle) / (count - 1); for(int j = 0; j < count; j++ ) { @@ -2550,7 +2544,7 @@ void PartPlate::generate_exclude_polygon(ExPolygon &exclude_polygon) { const Vec2d& p = m_exclude_area[i]; Vec2d center; - double start_angle, stop_angle, angle_steps, radius_x, radius_y, radius; + double start_angle, stop_angle, radius; switch (i) { case 0: radius = 5.f; @@ -3065,7 +3059,7 @@ void PartPlate::update_first_layer_print_sequence(size_t filament_nums) void PartPlate::print() const { - unsigned int count=0; + // unsigned int count=0; BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << boost::format(": plate index %1%, pointer %2%, print_index %3% print pointer %4%") % m_plate_index % this % m_print_index % m_print; BOOST_LOG_TRIVIAL(trace) << boost::format("\t origin {%1%,%2%,%3%}, width %4%, depth %5%, height %6%") % m_origin.x() % m_origin.y() % m_origin.z() % m_width % m_depth % m_height; @@ -4092,8 +4086,7 @@ int PartPlateList::find_instance_belongs(int obj_id, int instance_id) //newly added or modified int PartPlateList::notify_instance_update(int obj_id, int instance_id, bool is_new) { - int ret = 0, index; - PartPlate* plate = NULL; + int index; ModelObject* object = NULL; if ((obj_id >= 0) && (obj_id < m_model->objects.size())) @@ -4122,7 +4115,7 @@ int PartPlateList::notify_instance_update(int obj_id, int instance_id, bool is_n { //found it added before BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": found it in previous plate %1%") % index; - plate = m_plate_list[index]; + PartPlate* plate = m_plate_list[index]; if (!plate->intersect_instance(obj_id, instance_id, &boundingbox)) { //not include anymore, remove it from original plate @@ -4227,7 +4220,7 @@ int PartPlateList::notify_instance_update(int obj_id, int instance_id, bool is_n //notify instance is removed int PartPlateList::notify_instance_removed(int obj_id, int instance_id) { - int ret = 0, index, instance_to_delete = instance_id; + int index, instance_to_delete = instance_id; PartPlate* plate = NULL; BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": obj_id %1%, instance_id %2%") % obj_id % instance_id; @@ -4325,7 +4318,6 @@ int PartPlateList::reload_all_objects(bool except_locked, int plate_index) ModelObject* object = m_model->objects[i]; for (j = 0; j < (unsigned int)object->instances.size(); ++j) { - ModelInstance* instance = object->instances[j]; BoundingBoxf3 boundingbox = object->instance_convex_hull_bounding_box(j); for (k = 0; k < (unsigned int)m_plate_list.size(); ++k) { @@ -4376,9 +4368,7 @@ int PartPlateList::construct_objects_list_for_new_plate(int plate_index) ModelObject* object = m_model->objects[i]; for (j = 0; j < (unsigned int)object->instances.size(); ++j) { - ModelInstance* instance = object->instances[j]; already_included = false; - for (k = 0; k < (unsigned int)plate_index; ++k) { PartPlate* plate = m_plate_list[k]; @@ -4552,7 +4542,6 @@ bool PartPlateList::preprocess_nonprefered_areas(arrangement::ArrangePolygons& r nonprefered_regions.emplace_back(Vec2d{ 18,0 }, Vec2d{ 240,15 }); // new extrusion & hand-eye calibration region //has exclude areas - PartPlate* plate = m_plate_list[0]; for (int index = 0; index < nonprefered_regions.size(); index++) { Polygon ap = scaled(nonprefered_regions[index]).polygon(); @@ -4779,11 +4768,8 @@ void PartPlateList::set_render_option(bool bedtype_texture, bool plate_settings) int PartPlateList::select_plate_by_obj(int obj_index, int instance_index) { - int ret = 0, index; - PartPlate* plate = NULL; - BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": obj_id %1%, instance_id %2%") % obj_index % instance_index; - index = find_instance(obj_index, instance_index); + int index = find_instance(obj_index, instance_index); if (index != -1) { //found it in plate @@ -4821,8 +4807,6 @@ bool PartPlateList::set_shapes(const Pointfs& shape, const Pointfs& exclude_area m_height_to_lid = height_to_lid; m_height_to_rod = height_to_rod; - double stride_x = plate_stride_x(); - double stride_y = plate_stride_y(); for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i) { PartPlate* plate = m_plate_list[i]; @@ -5384,14 +5368,12 @@ void PartPlateList::BedTextureInfo::TexturePart::update_buffer() rectangle.push_back(Vec2d(x, y+h)); ExPolygon poly; - for (int i = 0; i < 4; i++) { - const Vec2d & p = rectangle[i]; - for (auto& p : rectangle) { - Vec2d pp = Vec2d(p.x() + offset.x(), p.y() + offset.y()); - poly.contour.append({ scale_(pp(0)), scale_(pp(1)) }); - } + for (const auto& p : rectangle) { + Vec2d pp = Vec2d(p.x() + offset.x(), p.y() + offset.y()); + poly.contour.append({ scale_(pp(0)), scale_(pp(1)) }); } + if (!buffer) buffer = new GLModel(); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 3dd1bb7075..9267fe9974 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -396,10 +396,9 @@ Sidebar::priv::~priv() void Sidebar::priv::show_preset_comboboxes() { - const bool showSLA = wxGetApp().preset_bundle->printers.get_edited_preset().printer_technology() == ptSLA; - //BBS #if 0 + const bool showSLA = wxGetApp().preset_bundle->printers.get_edited_preset().printer_technology() == ptSLA; for (size_t i = 0; i < 4; ++i) sizer_presets->Show(i, !showSLA); @@ -1102,7 +1101,7 @@ void Sidebar::init_filament_combo(PlaterPresetComboBox **combo, const int filame auto combo_and_btn_sizer = new wxBoxSizer(wxHORIZONTAL); // BBS: filament double columns - int em = wxGetApp().em_unit(); + // int em = wxGetApp().em_unit(); combo_and_btn_sizer->Add(FromDIP(8), 0, 0, 0, 0 ); (*combo)->clr_picker->SetLabel(wxString::Format("%d", filament_idx + 1)); combo_and_btn_sizer->Add((*combo)->clr_picker, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(3)); @@ -1268,7 +1267,6 @@ void Sidebar::update_all_preset_comboboxes() void Sidebar::update_presets(Preset::Type preset_type) { PresetBundle &preset_bundle = *wxGetApp().preset_bundle; - const auto print_tech = preset_bundle.printers.get_edited_preset().printer_technology(); BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": enter, preset_type %1%")%preset_type; switch (preset_type) { @@ -1276,6 +1274,7 @@ void Sidebar::update_presets(Preset::Type preset_type) { // BBS #if 0 + const auto print_tech = preset_bundle.printers.get_edited_preset().printer_technology(); const size_t extruder_cnt = print_tech != ptFFF ? 1 : dynamic_cast(preset_bundle.printers.get_edited_preset().config.option("nozzle_diameter"))->values.size(); const size_t filament_cnt = p->combos_filament.size() > extruder_cnt ? extruder_cnt : p->combos_filament.size(); @@ -1731,7 +1730,7 @@ void Sidebar::sync_ams_list() // BBS:Record consumables information before synchronization std::vector color_before_sync; - std::vector is_support_before; + std::vector is_support_before; DynamicPrintConfig& project_config = wxGetApp().preset_bundle->project_config; ConfigOptionStrings* color_opt = project_config.option("filament_colour"); for (int i = 0; i < p->combos_filament.size(); ++i) { @@ -1953,18 +1952,13 @@ void Sidebar::auto_calc_flushing_volumes(const int modify_id) { auto& preset_bundle = wxGetApp().preset_bundle; auto& project_config = preset_bundle->project_config; - auto& printer_config = preset_bundle->printers.get_edited_preset().config; const auto& full_config = wxGetApp().preset_bundle->full_config(); auto& ams_multi_color_filament = preset_bundle->ams_multi_color_filment; - auto& ams_filament_list = preset_bundle->filament_ams_list; const std::vector& init_matrix = (project_config.option("flush_volumes_matrix"))->values; - const std::vector& init_extruders = (project_config.option("flush_volumes_vector"))->values; const std::vector& min_flush_volumes= get_min_flush_volumes(full_config); - ConfigOptionFloat* flush_multi_opt = project_config.option("flush_multiplier"); - float flush_multiplier = flush_multi_opt ? flush_multi_opt->getFloat() : 1.f; std::vector matrix = init_matrix; int m_max_flush_volume = Slic3r::g_max_flush_volume; unsigned int m_number_of_extruders = (int)(sqrt(init_matrix.size()) + 0.001); @@ -2861,7 +2855,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) wxGLCanvas* view3D_canvas = view3D->get_wxglcanvas(); //BBS: GUI refactor - wxGLCanvas* preview_canvas = preview->get_wxglcanvas(); + // wxGLCanvas* preview_canvas = preview->get_wxglcanvas(); if (wxGetApp().is_editor()) { // 3DScene events: @@ -3579,11 +3573,8 @@ std::vector Plater::priv::load_files(const std::vector& input_ std::string designer_model_id; std::string designer_country_code; - int answer_convert_from_meters = wxOK_DEFAULT; - int answer_convert_from_imperial_units = wxOK_DEFAULT; int tolal_model_count = 0; - int progress_percent = 0; int total_files = input_files.size(); const int stage_percent[IMPORT_STAGE_MAX+1] = { 5, // IMPORT_STAGE_RESTORE @@ -3750,7 +3741,7 @@ std::vector Plater::priv::load_files(const std::vector& input_ wxString text = wxString::Format(_L("The 3mf's version %s is newer than %s's version %s, Found following keys unrecognized:"), file_version.to_string(), std::string(SLIC3R_APP_FULL_NAME), app_version.to_string()); text += "\n"; - bool first = true; + // bool first = true; // std::string context = into_u8(text); wxString context = text; // if (wxGetApp().app_config->get("user_mode") == "develop") { @@ -3856,7 +3847,7 @@ std::vector Plater::priv::load_files(const std::vector& input_ } // Based on the printer technology field found in the loaded config, select the base for the config, - PrinterTechnology printer_technology = Preset::printer_technology(config_loaded); + // PrinterTechnology printer_technology = Preset::printer_technology(config_loaded); config.apply(static_cast(FullPrintConfig::defaults())); // and place the loaded config over the base. @@ -3911,7 +3902,7 @@ std::vector Plater::priv::load_files(const std::vector& input_ MessageDialog dlg(q, _L("The 3mf has following modified G-codes in filament or printer presets:") + warning_message+ _L("Please confirm that these modified G-codes are safe to prevent any damage to the machine!"), _L("Modified G-codes")); dlg.show_dsa_button(); - auto res = dlg.ShowModal(); + dlg.ShowModal(); if (dlg.get_checkbox_state()) wxGetApp().app_config->set("no_warn_when_modified_gcodes", "true"); } @@ -3924,7 +3915,7 @@ std::vector Plater::priv::load_files(const std::vector& input_ //show_info(q, _L("The 3mf has following customized filament or printer presets:") + warning_message + _L("Please confirm that the G-codes within these presets are safe to prevent any damage to the machine!"), _L("Customized Preset")); MessageDialog dlg(q, _L("The 3mf has following customized filament or printer presets:") + from_u8(warning_message)+ _L("Please confirm that the G-codes within these presets are safe to prevent any damage to the machine!"), _L("Customized Preset")); dlg.show_dsa_button(); - auto res = dlg.ShowModal(); + dlg.ShowModal(); if (dlg.get_checkbox_state()) wxGetApp().app_config->set("no_warn_when_modified_gcodes", "true"); } @@ -4427,7 +4418,7 @@ std::vector Plater::priv::load_model_objects(const ModelObjectPtrs& mode #ifndef AUTOPLACEMENT_ON_LOAD // bool need_arrange = false; #endif /* AUTOPLACEMENT_ON_LOAD */ - bool scaled_down = false; + // bool scaled_down = false; std::vector obj_idxs; unsigned int obj_count = model.objects.size(); @@ -4464,15 +4455,15 @@ std::vector Plater::priv::load_model_objects(const ModelObjectPtrs& mode const Vec3d ratio = size.cwiseQuotient(bed_size); const double max_ratio = std::max(ratio(0), ratio(1)); if (max_ratio > 10000) { - MessageDialog dlg(q, _L("Your object appears to be too large, Do you want to scale it down to fit the heat bed automatically?"), _L("Object too large"), - wxICON_QUESTION | wxYES); - int answer = dlg.ShowModal(); + MessageDialog dlg(q, _L("Your object appears to be too large. It will be scaled down to fit the heat bed automatically."), _L("Object too large"), + wxICON_QUESTION | wxOK); + dlg.ShowModal(); // the size of the object is too big -> this could lead to overflow when moving to clipper coordinates, // so scale down the mesh object->scale_mesh_after_creation(1. / max_ratio); object->origin_translation = Vec3d::Zero(); object->center_around_origin(); - scaled_down = true; + // scaled_down = true; break; } else if (max_ratio > 10) { @@ -4481,7 +4472,7 @@ std::vector Plater::priv::load_model_objects(const ModelObjectPtrs& mode int answer = dlg.ShowModal(); if (answer == wxID_YES) { instance->set_scaling_factor(instance->get_scaling_factor() / max_ratio); - scaled_down = true; + // scaled_down = true; } } } @@ -5230,7 +5221,7 @@ unsigned int Plater::priv::update_background_process(bool force_validation, bool process_validation_warning(warning); return_state |= UPDATE_BACKGROUND_PROCESS_INVALID; if (printer_technology == ptFFF) { - const Print* print = background_process.fff_print(); + // const Print* print = background_process.fff_print(); //Polygons polygons; //if (print->config().print_sequence == PrintSequence::ByObject) // Print::sequential_print_clearance_valid(*print, &polygons); @@ -6374,7 +6365,6 @@ void Plater::priv::on_select_bed_type(wxCommandEvent &evt) int selection = combo->GetSelection(); std::string bed_type_name = print_config_def.get("curr_bed_type")->enum_values[selection]; - PresetBundle& preset_bundle = *wxGetApp().preset_bundle; DynamicPrintConfig& proj_config = wxGetApp().preset_bundle->project_config; const t_config_enum_values* keys_map = print_config_def.get("curr_bed_type")->enum_keys_map; @@ -8213,7 +8203,7 @@ void Plater::priv::on_create_filament(SimpleEvent &) update_ui_from_settings(); sidebar->update_all_preset_comboboxes(); CreatePresetSuccessfulDialog success_dlg(wxGetApp().mainframe, SuccessType::FILAMENT); - int res = success_dlg.ShowModal(); + success_dlg.ShowModal(); } } @@ -8325,7 +8315,7 @@ void Plater::priv::take_snapshot(const std::string& snapshot_name, const UndoRed // This is a workaround until we refactor the Wipe Tower position / orientation to live solely inside the Model, not in the Print config. // BBS: add partplate logic if (this->printer_technology == ptFFF) { - const DynamicPrintConfig& config = wxGetApp().preset_bundle->prints.get_edited_preset().config; + // const DynamicPrintConfig& config = wxGetApp().preset_bundle->prints.get_edited_preset().config; const DynamicPrintConfig& proj_cfg = wxGetApp().preset_bundle->project_config; const ConfigOptionFloats* tower_x_opt = proj_cfg.option("wipe_tower_x"); const ConfigOptionFloats* tower_y_opt = proj_cfg.option("wipe_tower_y"); @@ -8435,7 +8425,7 @@ void Plater::priv::undo_redo_to(std::vector::const_iterator // This is a workaround until we refactor the Wipe Tower position / orientation to live solely inside the Model, not in the Print config. // BBS: add partplate logic if (this->printer_technology == ptFFF) { - const DynamicPrintConfig& config = wxGetApp().preset_bundle->prints.get_edited_preset().config; + // const DynamicPrintConfig& config = wxGetApp().preset_bundle->prints.get_edited_preset().config; const DynamicPrintConfig& proj_cfg = wxGetApp().preset_bundle->project_config; const ConfigOptionFloats* tower_x_opt = proj_cfg.option("wipe_tower_x"); const ConfigOptionFloats* tower_y_opt = proj_cfg.option("wipe_tower_y"); @@ -8502,7 +8492,7 @@ void Plater::priv::undo_redo_to(std::vector::const_iterator // This is a workaround until we refactor the Wipe Tower position / orientation to live solely inside the Model, not in the Print config. // BBS: add partplate logic if (this->printer_technology == ptFFF) { - const DynamicPrintConfig& config = wxGetApp().preset_bundle->prints.get_edited_preset().config; + // const DynamicPrintConfig& config = wxGetApp().preset_bundle->prints.get_edited_preset().config; const DynamicPrintConfig& proj_cfg = wxGetApp().preset_bundle->project_config; ConfigOptionFloats* tower_x_opt = const_cast(proj_cfg.option("wipe_tower_x")); ConfigOptionFloats* tower_y_opt = const_cast(proj_cfg.option("wipe_tower_y")); @@ -8683,7 +8673,6 @@ void Plater::priv::record_start_print_preset(std::string action) { } j["record_event"] = action; - NetworkAgent* agent = wxGetApp().getAgent(); } catch (...) { return; @@ -8886,7 +8875,7 @@ void Plater::load_project(wxString const& filename2, // if res is empty no data has been loaded if (!res.empty() && (load_restore || !(strategy & LoadStrategy::Silence))) { - BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << __LINE__ << " call set_project_filename: " << load_restore ? originfile : filename; + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << __LINE__ << " call set_project_filename: " << (load_restore ? originfile : filename); p->set_project_filename(load_restore ? originfile : filename); if (load_restore && originfile.IsEmpty()) { p->set_project_name(_L("Untitled")); @@ -8968,8 +8957,6 @@ int Plater::save_project(bool saveAs) boost::uintmax_t size = boost::filesystem::file_size(into_path(filename)); j["file_size"] = size; j["file_name"] = std::string(filename.mb_str()); - - NetworkAgent* agent = wxGetApp().getAgent(); } catch (...) {} @@ -9002,7 +8989,7 @@ void Plater::import_model_id(wxString download_info) } } - catch (const std::exception& error) + catch (std::exception&) { //wxString sError = error.what(); } @@ -9043,8 +9030,6 @@ void Plater::import_model_id(wxString download_info) // NetworkAgent* m_agent = Slic3r::GUI::wxGetApp().getAgent(); // if (!m_agent) return; - int res = 0; - unsigned int http_code; std::string http_body; msg = _L("prepare 3mf file..."); @@ -9083,7 +9068,7 @@ void Plater::import_model_id(wxString download_info) if (sFile == filename) is_already_exist = true; } } - catch (const std::exception& error) + catch (std::exception&) { //wxString sError = error.what(); } @@ -9796,7 +9781,6 @@ void Plater::calib_retraction(const Calib_Params& params) add_model(false, Slic3r::resources_dir() + "/calib/retraction/retraction_tower.stl"); auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config; - auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config; auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config; auto obj = model().objects[0]; @@ -10127,7 +10111,7 @@ bool Plater::preview_zip_archive(const boost::filesystem::path& archive_path) std::replace(name.begin(), name.end(), '\\', '/'); // rename if file exists std::string filename = path.filename().string(); - std::string extension = boost::filesystem::extension(path); + std::string extension = path.extension().string(); std::string just_filename = filename.substr(0, filename.size() - extension.size()); std::string final_filename = just_filename; @@ -10433,7 +10417,6 @@ ProjectDropDialog::ProjectDropDialog(const std::string &filename) auto limit_width = m_fname_f->GetSize().GetWidth() - 2; auto current_width = 0; - auto cut_index = 0; auto fstring = wxString(""); auto bstring = wxString(""); @@ -10441,7 +10424,6 @@ ProjectDropDialog::ProjectDropDialog(const std::string &filename) auto file_name = wxString(filename); for (int x = 0; x < file_name.length(); x++) { current_width += m_fname_s->GetTextExtent(file_name[x]).GetWidth(); - cut_index = x; if (current_width > limit_width) { bstring += file_name[x]; @@ -11344,7 +11326,6 @@ void Plater::export_gcode(bool prefer_removable) if (preset_bundle) { j["gcode_printer_model"] = preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle); } - NetworkAgent *agent = wxGetApp().getAgent(); } catch (...) {} } @@ -11454,7 +11435,7 @@ TriangleMesh Plater::combine_mesh_fff(const ModelObject& mo, int instance_id, st std::vector csgmesh; csgmesh.reserve(2 * mo.volumes.size()); - bool has_splitable_volume = csg::model_to_csgmesh(mo, Transform3d::Identity(), std::back_inserter(csgmesh), + csg::model_to_csgmesh(mo, Transform3d::Identity(), std::back_inserter(csgmesh), csg::mpartsPositive | csg::mpartsNegative); std::string fail_msg = _u8L("Unable to perform boolean operation on model meshes. " @@ -11534,9 +11515,9 @@ void Plater::export_stl(bool extended, bool selection_only, bool multi_stls) wxBusyCursor wait; const auto& selection = p->get_selection(); - const auto obj_idx = selection.get_object_idx(); #if EXPORT_WITH_BOOLEAN + const auto obj_idx = selection.get_object_idx(); if (selection_only && (obj_idx == -1 || selection.is_wipe_tower())) return; #else @@ -12299,7 +12280,6 @@ void Plater::record_slice_preset(std::string action) } j["record_event"] = action; - NetworkAgent* agent = wxGetApp().getAgent(); } catch (...) { @@ -12482,7 +12462,7 @@ int Plater::send_gcode(int plate_idx, Export3mfProgressFn proFn) p->m_print_job_data._3mf_path = fs::path(plate->get_tmp_gcode_path()); p->m_print_job_data._3mf_path.replace_extension("3mf"); } - catch (std::exception& e) { + catch (std::exception&) { BOOST_LOG_TRIVIAL(error) << "generate 3mf path failed"; return -1; } @@ -12515,7 +12495,7 @@ int Plater::export_config_3mf(int plate_idx, Export3mfProgressFn proFn) try { p->m_print_job_data._3mf_config_path = fs::path(plate->get_temp_config_3mf_path()); } - catch (std::exception& e) { + catch (std::exception&) { BOOST_LOG_TRIVIAL(error) << "generate 3mf path failed"; return -1; } diff --git a/src/slic3r/GUI/Preferences.cpp b/src/slic3r/GUI/Preferences.cpp index 06ff46b125..2dad186e46 100644 --- a/src/slic3r/GUI/Preferences.cpp +++ b/src/slic3r/GUI/Preferences.cpp @@ -228,13 +228,13 @@ wxBoxSizer *PreferencesDialog::create_item_language_combobox( } } - auto check = [this](bool yes_or_no) { + /*auto check = [this](bool yes_or_no) { // if (yes_or_no) // return true; int act_btns = ActionButtons::SAVE; return wxGetApp().check_and_keep_current_preset_changes(_L("Switching application language"), _L("Switching application language while some presets are modified."), act_btns); - }; + };*/ m_current_language_selected = combobox->GetSelection(); if (m_current_language_selected >= 0 && m_current_language_selected < vlist.size()) { diff --git a/src/slic3r/GUI/PresetComboBoxes.cpp b/src/slic3r/GUI/PresetComboBoxes.cpp index e634c4fe1a..a710668d71 100644 --- a/src/slic3r/GUI/PresetComboBoxes.cpp +++ b/src/slic3r/GUI/PresetComboBoxes.cpp @@ -401,7 +401,7 @@ void PresetComboBox::add_ams_filaments(std::string selected, bool alias_name) auto color = tray.opt_string("filament_colour", 0u); auto name = tray.opt_string("tray_name", 0u); wxBitmap bmp(*get_extruder_color_icon(color, name, 24, 16)); - int item_id = Append(get_preset_name(*iter), bmp.ConvertToImage(), &m_first_ams_filament + entry.first); + Append(get_preset_name(*iter), bmp.ConvertToImage(), &m_first_ams_filament + entry.first); //validate_selection(id->value == selected); // can not select } m_last_ams_filament = GetCount(); @@ -668,7 +668,6 @@ PlaterPresetComboBox::PlaterPresetComboBox(wxWindow *parent, Preset::Type preset // BBS if (m_type == Preset::TYPE_FILAMENT) { - int em = wxGetApp().em_unit(); clr_picker = new wxBitmapButton(parent, wxID_ANY, {}, wxDefaultPosition, wxSize(FromDIP(20), FromDIP(20)), wxBU_EXACTFIT | wxBU_AUTODRAW | wxBORDER_NONE); clr_picker->SetToolTip(_L("Click to pick filament color")); clr_picker->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) { @@ -803,7 +802,6 @@ bool PlaterPresetComboBox::switch_to_tab() wxGetApp().params_dialog()->Popup(); tab->restore_last_select_item(); - const Preset* selected_filament_preset = nullptr; if (m_type == Preset::TYPE_FILAMENT) { const std::string& selected_preset = GetString(GetSelection()).ToUTF8().data(); @@ -983,7 +981,6 @@ void PlaterPresetComboBox::update() if (!preset.is_visible || (!preset.is_compatible && !is_selected)) continue; - bool single_bar = false; if (m_type == Preset::TYPE_FILAMENT) { #if 0 @@ -991,7 +988,7 @@ void PlaterPresetComboBox::update() filament_rgb = is_selected ? selected_filament_preset->config.opt_string("filament_colour", 0) : preset.config.opt_string("filament_colour", 0); extruder_rgb = (is_selected && !filament_color.empty()) ? filament_color : filament_rgb; - single_bar = filament_rgb == extruder_rgb; + bool single_bar = filament_rgb == extruder_rgb; bitmap_key += single_bar ? filament_rgb : filament_rgb + extruder_rgb; #endif @@ -1479,8 +1476,6 @@ void GUI::CalibrateFilamentComboBox::update() this->Clear(); invalidate_selection(); - const Preset* selected_filament_preset = nullptr; - m_nonsys_presets.clear(); m_system_presets.clear(); diff --git a/src/slic3r/GUI/Printer/PrinterFileSystem.cpp b/src/slic3r/GUI/Printer/PrinterFileSystem.cpp index 8d272057f8..f406553b0c 100644 --- a/src/slic3r/GUI/Printer/PrinterFileSystem.cpp +++ b/src/slic3r/GUI/Printer/PrinterFileSystem.cpp @@ -548,7 +548,6 @@ void PrinterFileSystem::BuildGroups() void PrinterFileSystem::UpdateGroupSelect() { m_group_flags.clear(); - int beg = 0; if (m_group_mode != G_NONE) { auto group = m_group_mode == G_YEAR ? m_group_year : m_group_month; if (m_group_mode == G_YEAR) diff --git a/src/slic3r/GUI/PrinterWebView.cpp b/src/slic3r/GUI/PrinterWebView.cpp index b67a8dc34a..a629790e78 100644 --- a/src/slic3r/GUI/PrinterWebView.cpp +++ b/src/slic3r/GUI/PrinterWebView.cpp @@ -1,11 +1,9 @@ #include "PrinterWebView.hpp" #include "I18N.hpp" -#include "slic3r/GUI/PrinterWebView.hpp" #include "slic3r/GUI/wxExtensions.hpp" #include "slic3r/GUI/GUI_App.hpp" #include "slic3r/GUI/MainFrame.hpp" -#include "libslic3r_version.h" #include #include diff --git a/src/slic3r/GUI/Project.cpp b/src/slic3r/GUI/Project.cpp index 003d0e4cdd..e69ba143db 100644 --- a/src/slic3r/GUI/Project.cpp +++ b/src/slic3r/GUI/Project.cpp @@ -266,7 +266,7 @@ void ProjectPanel::OnScriptMessage(wxWebViewEvent& evt) } } - catch (std::exception& e) { + catch (std::exception&) { // wxMessageBox(e.what(), "json Exception", MB_OK); } } diff --git a/src/slic3r/GUI/RecenterDialog.cpp b/src/slic3r/GUI/RecenterDialog.cpp index 6947763890..2a923fb181 100644 --- a/src/slic3r/GUI/RecenterDialog.cpp +++ b/src/slic3r/GUI/RecenterDialog.cpp @@ -86,8 +86,6 @@ void RecenterDialog::OnPaint(wxPaintEvent& event){ } void RecenterDialog::render(wxDC& dc) { - wxSize size = GetSize(); - dc.SetFont(Label::Body_14); dc.SetTextForeground(text_color); wxPoint pos_start = wxPoint(BORDER, BORDER); diff --git a/src/slic3r/GUI/ReleaseNote.cpp b/src/slic3r/GUI/ReleaseNote.cpp index 617397f32f..5937ff9d37 100644 --- a/src/slic3r/GUI/ReleaseNote.cpp +++ b/src/slic3r/GUI/ReleaseNote.cpp @@ -1375,7 +1375,6 @@ wxString ConfirmBeforeSendDialog::format_text(wxString str, int warp) Label st (this, str); wxString out_txt = str; wxString count_txt = ""; - int new_line_pos = 0; for (int i = 0; i < str.length(); i++) { auto text_size = st.GetTextExtent(count_txt); diff --git a/src/slic3r/GUI/RemovableDriveManager.cpp b/src/slic3r/GUI/RemovableDriveManager.cpp index a26e13448d..a0a68eb05b 100644 --- a/src/slic3r/GUI/RemovableDriveManager.cpp +++ b/src/slic3r/GUI/RemovableDriveManager.cpp @@ -6,13 +6,9 @@ #include #if _WIN32 -#include #include #include #include - -#include - #else // unix, linux & OSX includes #include diff --git a/src/slic3r/GUI/Search.cpp b/src/slic3r/GUI/Search.cpp index 186124a2c1..05958f7ac8 100644 --- a/src/slic3r/GUI/Search.cpp +++ b/src/slic3r/GUI/Search.cpp @@ -435,8 +435,6 @@ void SearchItem::OnPaint(wxPaintEvent &event) auto bold_pair = std::vector>(); - auto index = 0; - auto b_first_list = std::vector(); auto b_second_list = std::vector(); @@ -815,9 +813,9 @@ void SearchDialog::OnCheck(wxCommandEvent &event) void SearchDialog::OnMotion(wxMouseEvent &event) { - wxDataViewItem item; - wxDataViewColumn *col; - wxWindow * win = this; + // wxDataViewItem item; + // wxDataViewColumn *col; + // wxWindow * win = this; // search_list->HitTest(wxGetMousePosition() - win->GetScreenPosition(), item, col); // search_list->Select(item); diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index e6b2ac81c5..f641769b45 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -421,7 +421,7 @@ SelectMachinePopup::SelectMachinePopup(wxWindow *parent) m_refresh_timer = new wxTimer(); m_refresh_timer->SetOwner(this); Bind(EVT_UPDATE_USER_MACHINE_LIST, &SelectMachinePopup::update_machine_list, this); - Bind(wxEVT_TIMER, &SelectMachinePopup::on_timer, this); + Bind(wxEVT_TIMER, [this](wxTimerEvent&) { on_timer(); }); Bind(EVT_DISSMISS_MACHINE_LIST, &SelectMachinePopup::on_dissmiss_win, this); } @@ -459,7 +459,7 @@ void SelectMachinePopup::Popup(wxWindow *WXUNUSED(focus)) } } - wxPostEvent(this, wxTimerEvent()); + on_timer(); PopupWindow::Popup(); } @@ -529,7 +529,7 @@ wxWindow *SelectMachinePopup::create_title_panel(wxString text) return m_panel_title_own; } -void SelectMachinePopup::on_timer(wxTimerEvent &event) +void SelectMachinePopup::on_timer() { BOOST_LOG_TRIVIAL(trace) << "SelectMachinePopup on_timer"; wxGetApp().reset_to_active(); @@ -933,7 +933,6 @@ wxString SelectMachineDialog::format_text(wxString &m_msg) wxString out_txt = m_msg; wxString count_txt = ""; - int new_line_pos = 0; for (int i = 0; i < m_msg.length(); i++) { auto text_size = m_statictext_ams_msg->GetTextExtent(count_txt); @@ -2461,9 +2460,6 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event) //check blacklist for (auto i = 0; i < m_ams_mapping_result.size(); i++) { - - auto tid = m_ams_mapping_result[i].tray_id; - std::string filament_type = boost::to_upper_copy(m_ams_mapping_result[i].type); std::string filament_brand; @@ -3319,7 +3315,7 @@ void SelectMachineDialog::on_selection_changed(wxCommandEvent &event) if (m_list[i]->is_lan_mode_printer() && !m_list[i]->has_access_right()) { ConnectPrinterDialog dlg(wxGetApp().mainframe, wxID_ANY, _L("Input access code")); dlg.set_machine_object(m_list[i]); - auto res = dlg.ShowModal(); + dlg.ShowModal(); m_printer_last_select = ""; m_comboBox_printer->SetSelection(-1); m_comboBox_printer->Refresh(); @@ -3369,7 +3365,6 @@ void SelectMachineDialog::on_selection_changed(wxCommandEvent &event) void SelectMachineDialog::update_flow_cali_check(MachineObject* obj) { - auto bed_type = m_plater->get_partplate_list().get_curr_plate()->get_bed_type(true); auto show_cali_tips = true; if (obj && obj->get_printer_arch() == PrinterArch::ARCH_I3) { show_cali_tips = false; } @@ -3706,7 +3701,6 @@ void SelectMachineDialog::reset_ams_material() { MaterialHash::iterator iter = m_materialList.begin(); while (iter != m_materialList.end()) { - int id = iter->first; Material* item = iter->second; MaterialItem* m = item->item; wxString ams_id = "-"; @@ -3988,7 +3982,6 @@ void SelectMachineDialog::reset_and_sync_ams_list() BitmapCache bmcache; MaterialHash::iterator iter = m_materialList.begin(); while (iter != m_materialList.end()) { - int id = iter->first; Material *item = iter->second; item->item->Destroy(); delete item; @@ -4015,7 +4008,6 @@ void SelectMachineDialog::reset_and_sync_ams_list() item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, extruder](wxMouseEvent &e) { MaterialHash::iterator iter = m_materialList.begin(); while (iter != m_materialList.end()) { - int id = iter->first; Material * item = iter->second; MaterialItem *m = item->item; m->on_normal(); @@ -4025,9 +4017,6 @@ void SelectMachineDialog::reset_and_sync_ams_list() m_current_filament_id = extruder; item->on_selected(); - auto mouse_pos = ClientToScreen(e.GetPosition()); - wxPoint rect = item->ClientToScreen(wxPoint(0, 0)); - // update ams data DeviceManager *dev_manager = Slic3r::GUI::wxGetApp().getDeviceManager(); if (!dev_manager) return; @@ -4247,7 +4236,6 @@ void SelectMachineDialog::unify_deal_thumbnail_data(ThumbnailData &input_data, T MaterialHash::iterator iter = m_materialList.begin(); bool is_connect_printer = true; while (iter != m_materialList.end()) { - int id = iter->first; Material * item = iter->second; MaterialItem *m = item->item; if (m->m_ams_name == "-") { @@ -4359,10 +4347,10 @@ void SelectMachineDialog::set_default_normal(const ThumbnailData &data) MachineObject* obj_ = dev_manager->get_selected_machine(); update_flow_cali_check(obj_); +#ifdef __WINDOWS__ wxSize screenSize = wxGetDisplaySize(); auto dialogSize = this->GetSize(); -#ifdef __WINDOWS__ if (screenSize.GetHeight() < dialogSize.GetHeight()) { m_need_adaptation_screen = true; m_scrollable_view->SetScrollRate(0, 5); @@ -4423,7 +4411,6 @@ void SelectMachineDialog::set_default_from_sdcard() //init MaterialItem MaterialHash::iterator iter = m_materialList.begin(); while (iter != m_materialList.end()) { - int id = iter->first; Material* item = iter->second; item->item->Destroy(); delete item; @@ -4446,7 +4433,6 @@ void SelectMachineDialog::set_default_from_sdcard() item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, fo](wxMouseEvent& e) { MaterialHash::iterator iter = m_materialList.begin(); while (iter != m_materialList.end()) { - int id = iter->first; Material* item = iter->second; MaterialItem* m = item->item; m->on_normal(); @@ -4459,9 +4445,6 @@ void SelectMachineDialog::set_default_from_sdcard() catch (...) {} item->on_selected(); - - auto mouse_pos = ClientToScreen(e.GetPosition()); - wxPoint rect = item->ClientToScreen(wxPoint(0, 0)); // update ams data DeviceManager* dev_manager = Slic3r::GUI::wxGetApp().getDeviceManager(); if (!dev_manager) return; @@ -4485,7 +4468,7 @@ void SelectMachineDialog::set_default_from_sdcard() m_mapping_popup.Popup(); } } - }); + }); Material* material_item = new Material(); material_item->id = fo.id; @@ -4512,10 +4495,9 @@ void SelectMachineDialog::set_default_from_sdcard() set_flow_calibration_state(true); +#ifdef __WINDOWS__ wxSize screenSize = wxGetDisplaySize(); auto dialogSize = this->GetSize(); - -#ifdef __WINDOWS__ if (screenSize.GetHeight() < dialogSize.GetHeight()) { m_need_adaptation_screen = true; m_scrollable_view->SetScrollRate(0, 5); diff --git a/src/slic3r/GUI/SelectMachine.hpp b/src/slic3r/GUI/SelectMachine.hpp index 16da5e05d5..dadc3be613 100644 --- a/src/slic3r/GUI/SelectMachine.hpp +++ b/src/slic3r/GUI/SelectMachine.hpp @@ -278,7 +278,7 @@ private: private: void OnLeftUp(wxMouseEvent &event); - void on_timer(wxTimerEvent &event); + void on_timer(); void update_other_devices(); void update_user_devices(); diff --git a/src/slic3r/GUI/Selection.cpp b/src/slic3r/GUI/Selection.cpp index b952420b0d..baf0773ce7 100644 --- a/src/slic3r/GUI/Selection.cpp +++ b/src/slic3r/GUI/Selection.cpp @@ -1104,7 +1104,6 @@ void Selection::move_to_center(const Vec3d& displacement, bool local) if (!m_valid) return; - EMode translation_type = m_mode; //BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": %1%, displacement {%2%, %3%, %4%}") % __LINE__ % displacement(X) % displacement(Y) % displacement(Z); set_caches(); @@ -1125,7 +1124,6 @@ void Selection::move_to_center(const Vec3d& displacement, bool local) else { const Vec3d local_displacement = (m_cache.volumes_data[i].get_instance_rotation_matrix() * m_cache.volumes_data[i].get_instance_scale_matrix() * m_cache.volumes_data[i].get_instance_mirror_matrix()).inverse() * displacement; v.set_volume_offset(m_cache.volumes_data[i].get_volume_position() + local_displacement); - translation_type = Volume; } } } @@ -2179,7 +2177,8 @@ void Selection::update_type() obj_it->second.insert(inst_idx); } - bool requires_disable = false; + // BBL removed functionality below + // bool requires_disable = false; if (!m_valid) m_type = Invalid; @@ -2195,7 +2194,7 @@ void Selection::update_type() else if (first->is_modifier) { m_type = SingleModifier; - requires_disable = true; + // requires_disable = true; } else { @@ -2217,7 +2216,7 @@ void Selection::update_type() else { m_type = SingleVolume; - requires_disable = true; + // requires_disable = true; } } } @@ -2265,7 +2264,7 @@ void Selection::update_type() else if (modifiers_count == (unsigned int)m_list.size()) m_type = MultipleModifier; - requires_disable = true; + // requires_disable = true; } } else if ((selected_instances_count > 1) && (selected_instances_count * model_volumes_count + sla_volumes_count == (unsigned int)m_list.size())) diff --git a/src/slic3r/GUI/SendMultiMachinePage.cpp b/src/slic3r/GUI/SendMultiMachinePage.cpp index bf766d78d0..036409f4d9 100644 --- a/src/slic3r/GUI/SendMultiMachinePage.cpp +++ b/src/slic3r/GUI/SendMultiMachinePage.cpp @@ -300,7 +300,7 @@ SendMultiMachinePage::SendMultiMachinePage(Plater* plater) m_main_scroll->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {check_fcous_state(this); e.Skip(); }); init_timer(); - Bind(wxEVT_TIMER, &SendMultiMachinePage::on_timer, this); + Bind(wxEVT_TIMER, [this](wxTimerEvent&) { on_timer(); }); wxGetApp().UpdateDlgDarkUI(this); } @@ -451,8 +451,6 @@ BBL::PrintParams SendMultiMachinePage::request_params(MachineObject* obj) auto use_ams = false; AmsRadioSelectorList::Node* node = m_radio_group.GetFirst(); - auto groupid = 0; - while (node) { AmsRadioSelector* rs = node->GetData(); @@ -472,13 +470,11 @@ BBL::PrintParams SendMultiMachinePage::request_params(MachineObject* obj) PrintPrepareData job_data; m_plater->get_print_job_data(&job_data); - - if (&job_data) { - std::string temp_file = Slic3r::resources_dir() + "/check_access_code.txt"; - auto check_access_code_path = temp_file.c_str(); - BOOST_LOG_TRIVIAL(trace) << "sned_job: check_access_code_path = " << check_access_code_path; - job_data._temp_path = fs::path(check_access_code_path); - } + + std::string temp_file = Slic3r::resources_dir() + "/check_access_code.txt"; + auto check_access_code_path = temp_file.c_str(); + BOOST_LOG_TRIVIAL(trace) << "sned_job: check_access_code_path = " << check_access_code_path; + job_data._temp_path = fs::path(check_access_code_path); int curr_plate_idx; if (job_data.plate_idx >= 0) @@ -639,7 +635,7 @@ void SendMultiMachinePage::on_send(wxCommandEvent& event) int result = m_plater->send_gcode(m_print_plate_idx, [this](int export_stage, int current, int total, bool& cancel) { if (m_is_canceled) return; - bool cancelled = false; + // bool cancelled = false; wxString msg = _L("Preparing print job"); //m_status_bar->update_status(msg, cancelled, 10, true); //m_export_3mf_cancel = cancel = cancelled; @@ -738,7 +734,7 @@ bool SendMultiMachinePage::Show(bool show) m_refresh_timer->Stop(); m_refresh_timer->SetOwner(this); m_refresh_timer->Start(4000); - wxPostEvent(this, wxTimerEvent()); + on_timer(); } else { m_refresh_timer->Stop(); @@ -935,7 +931,6 @@ void SendMultiMachinePage::on_set_finish_mapping(wxCommandEvent& evt) if (selection_data_arr.size() == 6) { auto ams_colour = wxColour(wxAtoi(selection_data_arr[0]), wxAtoi(selection_data_arr[1]), wxAtoi(selection_data_arr[2]), wxAtoi(selection_data_arr[3])); - int old_filament_id = (int)wxAtoi(selection_data_arr[5]); int ctype = 0; std::vector material_cols; @@ -1147,7 +1142,7 @@ wxPanel* SendMultiMachinePage::create_page() e.Skip(); }); - m_printer_name = new Button(m_table_head_panel, _L("Device Name"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE); + m_printer_name = new Button(m_table_head_panel, _L("Device Name"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE); m_printer_name->SetBackgroundColor(head_bg); m_printer_name->SetCornerRadius(0); m_printer_name->SetFont(TABLE_HEAD_FONT); @@ -1169,7 +1164,7 @@ wxPanel* SendMultiMachinePage::create_page() m_table_head_sizer->Add( 0, 0, 0, wxLEFT, FromDIP(10) ); m_table_head_sizer->Add(m_printer_name, 0, wxALIGN_CENTER_VERTICAL, 0); - m_device_status = new Button(m_table_head_panel, _L("Device Status"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE); + m_device_status = new Button(m_table_head_panel, _L("Device Status"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE); m_device_status->SetBackgroundColor(head_bg); m_device_status->SetFont(TABLE_HEAD_FONT); m_device_status->SetCornerRadius(0); @@ -1212,7 +1207,7 @@ wxPanel* SendMultiMachinePage::create_page() //m_table_head_sizer->Add(m_task_status, 0, wxALIGN_CENTER_VERTICAL, 0); - m_ams = new Button(m_table_head_panel, _L("Ams Status"), "toolbar_double_directional_arrow", wxNO_BORDER, ICON_SIZE, false); + m_ams = new Button(m_table_head_panel, _L("Ams Status"), "toolbar_double_directional_arrow", wxNO_BORDER, MM_ICON_SIZE, false); m_ams->SetBackgroundColor(head_bg); m_ams->SetCornerRadius(0); m_ams->SetFont(TABLE_HEAD_FONT); @@ -1233,7 +1228,7 @@ wxPanel* SendMultiMachinePage::create_page() }); m_table_head_sizer->Add(m_ams, 0, wxALIGN_CENTER_VERTICAL, 0); - m_refresh_button = new Button(m_table_head_panel, "", "mall_control_refresh", wxNO_BORDER, ICON_SIZE, false); + m_refresh_button = new Button(m_table_head_panel, "", "mall_control_refresh", wxNO_BORDER, MM_ICON_SIZE, false); m_refresh_button->SetBackgroundColor(head_bg); m_refresh_button->SetCornerRadius(0); m_refresh_button->SetFont(TABLE_HEAD_FONT); @@ -1385,7 +1380,6 @@ void SendMultiMachinePage::sync_ams_list() BitmapCache bmcache; MaterialHash::iterator iter = m_material_list.begin(); while (iter != m_material_list.end()) { - int id = iter->first; Material* item = iter->second; item->item->Destroy(); delete item; @@ -1414,7 +1408,6 @@ void SendMultiMachinePage::sync_ams_list() item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, extruder](wxMouseEvent& e) { MaterialHash::iterator iter = m_material_list.begin(); while (iter != m_material_list.end()) { - int id = iter->first; Material* item = iter->second; MaterialItem* m = item->item; m->on_normal(); @@ -1424,9 +1417,6 @@ void SendMultiMachinePage::sync_ams_list() m_current_filament_id = extruder; item->on_selected(); - auto mouse_pos = ClientToScreen(e.GetPosition()); - wxPoint rect = item->ClientToScreen(wxPoint(0, 0)); - // update ams data if (get_value_radio("use_ams")) { if (m_mapping_popup->IsShown()) return; @@ -1656,7 +1646,7 @@ void SendMultiMachinePage::init_timer() m_refresh_timer = new wxTimer(); } -void SendMultiMachinePage::on_timer(wxTimerEvent& event) +void SendMultiMachinePage::on_timer() { for (auto it = m_device_items.begin(); it != m_device_items.end(); it++) { it->second->sync_state(); diff --git a/src/slic3r/GUI/SendMultiMachinePage.hpp b/src/slic3r/GUI/SendMultiMachinePage.hpp index 58014f065c..c6935f2d64 100644 --- a/src/slic3r/GUI/SendMultiMachinePage.hpp +++ b/src/slic3r/GUI/SendMultiMachinePage.hpp @@ -194,7 +194,7 @@ protected: void on_set_finish_mapping(wxCommandEvent& evt); void on_rename_click(wxCommandEvent& event); - void on_timer(wxTimerEvent& event); + void on_timer(); void init_timer(); private: diff --git a/src/slic3r/GUI/SendSystemInfoDialog.cpp b/src/slic3r/GUI/SendSystemInfoDialog.cpp index 73de9101c4..3740cbb690 100644 --- a/src/slic3r/GUI/SendSystemInfoDialog.cpp +++ b/src/slic3r/GUI/SendSystemInfoDialog.cpp @@ -443,7 +443,7 @@ static std::string generate_system_info_json() pt::ptree hw_node; { - hw_node.put("ArchName", wxPlatformInfo::Get().GetArchName()); + hw_node.put("ArchName", wxPlatformInfo::Get().GetBitnessName()); size_t num = std::round(Slic3r::total_physical_memory()/107374100.); hw_node.put("RAM_GiB", std::to_string(num / 10) + "." + std::to_string(num % 10)); } diff --git a/src/slic3r/GUI/SendToPrinter.cpp b/src/slic3r/GUI/SendToPrinter.cpp index 7d0fb5663c..51b6797a5f 100644 --- a/src/slic3r/GUI/SendToPrinter.cpp +++ b/src/slic3r/GUI/SendToPrinter.cpp @@ -59,7 +59,6 @@ wxString SendToPrinterDialog::format_text(wxString &m_msg) wxString out_txt = m_msg; wxString count_txt = ""; - int new_line_pos = 0; for (int i = 0; i < m_msg.length(); i++) { auto text_size = m_statictext_printer_msg->GetTextExtent(count_txt); @@ -1338,11 +1337,6 @@ void SendToPrinterDialog::set_default() Layout(); Fit(); - - wxSize screenSize = wxGetDisplaySize(); - auto dialogSize = this->GetSize(); - - // basic info auto aprint_stats = m_plater->get_partplate_list().get_current_fff_print().print_statistics(); wxString time; diff --git a/src/slic3r/GUI/SlicingProgressNotification.cpp b/src/slic3r/GUI/SlicingProgressNotification.cpp index bedcbc2eb7..219950ceff 100644 --- a/src/slic3r/GUI/SlicingProgressNotification.cpp +++ b/src/slic3r/GUI/SlicingProgressNotification.cpp @@ -224,8 +224,8 @@ void NotificationManager::SlicingProgressNotification::render(GLCanvas3D& canvas const float progress_panel_width = (m_window_width - 2 * progress_child_window_padding.x); const float progress_panel_height = (58.0f * scale); const float dailytips_panel_width = (m_window_width - 2 * dailytips_child_window_padding.x); - const float gcodeviewer_height = wxGetApp().plater()->get_preview_canvas3D()->get_gcode_viewer().get_legend_height(); - //const float dailytips_panel_height = std::min(380.0f * scale, std::max(90.0f, (cnv_size.get_height() - gcodeviewer_height - progress_panel_height - dailytips_child_window_padding.y - initial_y - m_line_height * 4))); + // const float gcodeviewer_height = wxGetApp().plater()->get_preview_canvas3D()->get_gcode_viewer().get_legend_height(); + // const float dailytips_panel_height = std::min(380.0f * scale, std::max(90.0f, (cnv_size.get_height() - gcodeviewer_height - progress_panel_height - dailytips_child_window_padding.y - initial_y - m_line_height * 4))); const float dailytips_panel_height = 125.0f * scale; float right_gap = right_margin + (move_from_overlay ? overlay_width + m_line_height * 5 : 0); diff --git a/src/slic3r/GUI/StatusPanel.cpp b/src/slic3r/GUI/StatusPanel.cpp index 2a7ff21b76..d4b1148df3 100644 --- a/src/slic3r/GUI/StatusPanel.cpp +++ b/src/slic3r/GUI/StatusPanel.cpp @@ -291,7 +291,6 @@ void PrintingTaskPanel::create_panel(wxWindow* parent) }); m_button_pause_resume->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) { - auto buf = m_button_pause_resume->GetClientData(); if (m_button_pause_resume->GetToolTipText() == _L("Pause")) { m_button_pause_resume->SetBitmap_("print_control_pause"); } @@ -2528,7 +2527,7 @@ void StatusPanel::update_misc_ctrl(MachineObject *obj) } bool light_on = obj->chamber_light != MachineObject::LIGHT_EFFECT::LIGHT_EFFECT_OFF; - BOOST_LOG_TRIVIAL(trace) << "light: " << light_on ? "on" : "off"; + BOOST_LOG_TRIVIAL(trace) << "light: " << (light_on ? "on" : "off"); if (m_switch_lamp_timeout > 0) m_switch_lamp_timeout--; else { @@ -2592,7 +2591,6 @@ void StatusPanel::update_ams(MachineObject *obj) } bool is_support_virtual_tray = obj->ams_support_virtual_tray; - bool is_support_filament_backup = obj->is_support_filament_backup; AMSModel ams_mode = AMSModel::GENERIC_AMS; if (obj) { @@ -2663,9 +2661,6 @@ void StatusPanel::update_ams(MachineObject *obj) std::string curr_ams_id = m_ams_control->GetCurentAms(); std::string curr_can_id = m_ams_control->GetCurrentCan(curr_ams_id); - bool is_vt_tray = false; - if (obj->m_tray_tar == std::to_string(VIRTUAL_TRAY_ID)) - is_vt_tray = true; // set segment 1, 2 if (obj->m_tray_now == std::to_string(VIRTUAL_TRAY_ID) ) { @@ -4907,7 +4902,6 @@ wxBoxSizer *ScoreDialog::get_button_sizer() if (m_upload_status_code == StatusCode::UPLOAD_PROGRESS) { int need_upload_nums = need_upload_images.size(); int upload_nums = 0; - int upload_failed_nums = 0; ProgressDialog *progress_dialog = new ProgressDialog(_L("Upload Pictrues"), _L("Number of images successfully uploaded") + ": " + std::to_string(upload_nums) + "/" + std::to_string(need_upload_nums), need_upload_nums, this); for (std::set>::iterator it = need_upload_images.begin(); it != need_upload_images.end();) { std::pair need_upload = *it; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 9fd2f823a0..806cbad985 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1221,7 +1221,7 @@ void Tab::msw_rescale() // recreate and set new ImageList for tree_ctrl m_icons->RemoveAll(); m_icons = new wxImageList(m_scaled_icons_list.front().bmp().GetWidth(), m_scaled_icons_list.front().bmp().GetHeight(), false); - for (ScalableBitmap& bmp : m_scaled_icons_list) + // for (ScalableBitmap& bmp : m_scaled_icons_list) //m_icons->Add(bmp.bmp()); m_tabctrl->AssignImageList(m_icons); @@ -1255,7 +1255,7 @@ void Tab::sys_color_changed() // recreate and set new ImageList for tree_ctrl m_icons->RemoveAll(); m_icons = new wxImageList(m_scaled_icons_list.front().bmp().GetWidth(), m_scaled_icons_list.front().bmp().GetHeight(), false); - for (ScalableBitmap& bmp : m_scaled_icons_list) + // for (ScalableBitmap& bmp : m_scaled_icons_list) //m_icons->Add(bmp.bmp()); m_tabctrl->AssignImageList(m_icons); @@ -1609,19 +1609,6 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) } } - - // -1 means caculate all - auto update_flush_volume = [](int idx = -1) { - if (idx < 0) { - size_t filament_size = wxGetApp().plater()->get_extruder_colors_from_plater_config().size(); - for (size_t i = 0; i < filament_size; ++i) - wxGetApp().plater()->sidebar().auto_calc_flushing_volumes(i); - } - else - wxGetApp().plater()->sidebar().auto_calc_flushing_volumes(idx); - }; - - string opt_key_without_idx = opt_key.substr(0, opt_key.find('#')); if (opt_key_without_idx == "long_retractions_when_cut") { @@ -2588,8 +2575,6 @@ void TabPrintModel::update_model_config() // Reset m_config manually because there's no corresponding config in m_parent_tab->m_config for (auto plate_item : m_object_configs) { const DynamicPrintConfig& plate_config = plate_item.second->get(); - BedType plate_bed_type = (BedType)0; - PrintSequence plate_print_seq = (PrintSequence)0; if (!plate_config.has("curr_bed_type")) { // same as global DynamicConfig& global_cfg = wxGetApp().preset_bundle->project_config; @@ -2900,7 +2885,6 @@ void TabPrintPlate::on_value_change(const std::string& opt_key, const boost::any void TabPrintPlate::notify_changed(ObjectBase* object) { - auto plate = dynamic_cast(object); auto objects_list = wxGetApp().obj_list(); wxDataViewItemArray items; objects_list->GetSelections(items); @@ -4680,14 +4664,14 @@ void Tab::rebuild_page_tree() if (sel_item == m_last_select_item) m_last_select_item = item; else - m_last_select_item = NULL; + m_last_select_item = 0; // allow activate page before selection of a page_tree item m_disable_tree_sel_changed_event = false; //BBS: GUI refactor if (item >= 0) { - bool ret = update_current_page_in_background(item); + update_current_page_in_background(item); //if m_active_page is changed in update_current_page_in_background //will just update the selected item of the treectrl if (m_parent->is_active_and_shown_tab(this)) // FIX: modify state not update @@ -5507,7 +5491,6 @@ void Tab::delete_preset() if (m_presets->get_preset_base(current_preset) == ¤t_preset) { //root preset is_base_preset = true; if (current_preset.type == Preset::Type::TYPE_PRINTER && !current_preset.is_system) { //Customize third-party printers - Preset ¤t_preset = m_presets->get_selected_preset(); int filament_preset_num = 0; int process_preset_num = 0; for (const Preset &preset : m_preset_bundle->filaments.get_presets()) { @@ -5771,7 +5754,6 @@ wxSizer* TabPrinter::create_bed_shape_widget(wxWindow* parent) sizer->Add(btn, 0, wxALIGN_CENTER_VERTICAL); btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e) { - bool is_configed_by_BBL = PresetUtils::system_printer_bed_model(m_preset_bundle->printers.get_edited_preset()).size() > 0; BedShapeDialog dlg(this); dlg.build_dialog(*m_config->option("printable_area"), *m_config->option("bed_custom_texture"), diff --git a/src/slic3r/GUI/Tabbook.hpp b/src/slic3r/GUI/Tabbook.hpp index 7dd19389de..61eee685b8 100644 --- a/src/slic3r/GUI/Tabbook.hpp +++ b/src/slic3r/GUI/Tabbook.hpp @@ -198,8 +198,6 @@ public: // check that only the selected page is visible and others are hidden: for (size_t page = 0; page < m_pages.size(); page++) { - wxWindow* win_a = GetPage(page); - wxWindow* win_b = GetPage(n); if (page != n && GetPage(page) != GetPage(n)) { m_pages[page]->Hide(); } diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index b47f3c0389..1b46e2b7dd 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -1654,7 +1654,7 @@ void UnsavedChangesDialog::update_tree(Preset::Type type, PresetCollection* pres const DynamicPrintConfig& new_config = presets->get_edited_preset().config; type = presets->type(); - const std::map& category_icon_map = wxGetApp().get_tab(type)->get_category_icon_map(); + // const std::map& category_icon_map = wxGetApp().get_tab(type)->get_category_icon_map(); //m_tree->model->AddPreset(type, from_u8(presets->get_edited_preset().name), old_pt); diff --git a/src/slic3r/GUI/UpdateDialogs.cpp b/src/slic3r/GUI/UpdateDialogs.cpp index d78136a094..deba5a7a97 100644 --- a/src/slic3r/GUI/UpdateDialogs.cpp +++ b/src/slic3r/GUI/UpdateDialogs.cpp @@ -24,12 +24,11 @@ namespace Slic3r { namespace GUI { - -static const char* URL_CHANGELOG = "%1%"; -static const char* URL_DOWNLOAD = "%1%"; -static const char* URL_DEV = "%1%"; - -static const std::string CONFIG_UPDATE_WIKI_URL(""); +// Orca: Replace static char* with macro defs +// currently disabled until needed +// #define URL_CHANGELOG "%1%" +// #define URL_DOWNLOAD "%1%" +// #define URL_DEV "%1%" // MsgUpdateSlic3r diff --git a/src/slic3r/GUI/UpgradePanel.cpp b/src/slic3r/GUI/UpgradePanel.cpp index e9384c385b..e2376326e4 100644 --- a/src/slic3r/GUI/UpgradePanel.cpp +++ b/src/slic3r/GUI/UpgradePanel.cpp @@ -670,8 +670,6 @@ void MachineInfoPanel::update_ams_ext(MachineObject *obj) show_ams(true); std::map ver_list = obj->get_ams_version(); - AmsPanelHash::iterator iter = m_amspanel_list.begin(); - for (auto i = 0; i < m_amspanel_list.GetCount(); i++) { AmsPanel* amspanel = m_amspanel_list[i]; amspanel->Hide(); diff --git a/src/slic3r/GUI/UserManager.cpp b/src/slic3r/GUI/UserManager.cpp index 29f5f2d137..0fd8dfce25 100644 --- a/src/slic3r/GUI/UserManager.cpp +++ b/src/slic3r/GUI/UserManager.cpp @@ -25,7 +25,6 @@ void UserManager::set_agent(NetworkAgent* agent) int UserManager::parse_json(std::string payload) { - bool restored_json = false; json j; json j_pre = json::parse(payload); if (j_pre.empty()) { @@ -41,7 +40,7 @@ int UserManager::parse_json(std::string payload) //bind if (j_pre["bind"]["command"].get() == "bind") { std::string dev_id; - std:; string result; + std::string result; if (j_pre["bind"].contains("dev_id")) { dev_id = j_pre["bind"]["dev_id"].get(); diff --git a/src/slic3r/GUI/WebDownPluginDlg.cpp b/src/slic3r/GUI/WebDownPluginDlg.cpp index 82d2816f2e..49fc439887 100644 --- a/src/slic3r/GUI/WebDownPluginDlg.cpp +++ b/src/slic3r/GUI/WebDownPluginDlg.cpp @@ -1,27 +1,17 @@ #include "WebDownPluginDlg.hpp" -#include "ConfigWizard.hpp" - -#include #include "I18N.hpp" #include "libslic3r/AppConfig.hpp" -#include "slic3r/GUI/wxExtensions.hpp" #include "slic3r/GUI/GUI_App.hpp" -#include "libslic3r_version.h" #include -#include #include - #include #include -#include #include #include -#include #include "MainFrame.hpp" -#include #include #include #include @@ -227,7 +217,7 @@ void DownPluginFrame::OnScriptMessage(wxWebViewEvent &evt) auto plugin_folder = (boost::filesystem::path(wxStandardPaths::Get().GetUserDataDir().ToUTF8().data()) / "plugins").make_preferred().string(); desktop_open_any_folder(plugin_folder); } - } catch (std::exception &e) { + } catch (std::exception&) { // wxMessageBox(e.what(), "json Exception", MB_OK); } } diff --git a/src/slic3r/GUI/WebGuideDialog.cpp b/src/slic3r/GUI/WebGuideDialog.cpp index 63255d73c6..ecc3d533c5 100644 --- a/src/slic3r/GUI/WebGuideDialog.cpp +++ b/src/slic3r/GUI/WebGuideDialog.cpp @@ -882,13 +882,13 @@ bool GuideFrame::apply_config(AppConfig *app_config, PresetBundle *preset_bundle } std::string first_added_filament; - auto get_first_added_material_preset = [this, app_config](const std::string& section_name, std::string& first_added_preset) { + /*auto get_first_added_material_preset = [this, app_config](const std::string& section_name, std::string& first_added_preset) { if (m_appconfig_new.has_section(section_name)) { // get first of new added preset names const std::map& old_presets = app_config->has_section(section_name) ? app_config->get_section(section_name) : std::map(); first_added_preset = get_first_added_preset(old_presets, m_appconfig_new.get_section(section_name)); } - }; + };*/ // Not switch filament //get_first_added_material_preset(AppConfig::SECTION_FILAMENTS, first_added_filament); @@ -949,7 +949,6 @@ bool GuideFrame::run() BOOST_LOG_TRIVIAL(info) << "GuideFrame cancelled"; if (app.preset_bundle->printers.only_default_printers()) { //we install the default here - bool apply_keeped_changes = false; //clear filament section and use default materials app.app_config->set_variant(PresetBundle::BBL_BUNDLE, PresetBundle::BBL_DEFAULT_PRINTER_MODEL, PresetBundle::BBL_DEFAULT_PRINTER_VARIANT, "true"); @@ -1129,7 +1128,7 @@ int GuideFrame::LoadProfile() wxString strVendor = from_u8(iter->path().string()).BeforeLast('.'); strVendor = strVendor.AfterLast( '\\'); - strVendor = strVendor.AfterLast('\/'); + strVendor = strVendor.AfterLast('/'); wxString strExtension = from_u8(iter->path().string()).AfterLast('.').Lower(); if (w2s(strVendor) == PresetBundle::BBL_BUNDLE && strExtension.CmpNoCase("json") == 0) @@ -1148,7 +1147,7 @@ int GuideFrame::LoadProfile() //cout << iter->path().string() << endl; wxString strVendor = from_u8(iter->path().string()).BeforeLast('.'); strVendor = strVendor.AfterLast( '\\'); - strVendor = strVendor.AfterLast('\/'); + strVendor = strVendor.AfterLast('/'); wxString strExtension = from_u8(iter->path().string()).AfterLast('.').Lower(); if (w2s(strVendor) != PresetBundle::BBL_BUNDLE && strExtension.CmpNoCase("json")==0) @@ -1530,9 +1529,6 @@ int GuideFrame::LoadProfileFamily(std::string strVendor, std::string strFilePath BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "Vendor: " << strVendor <<", tFilaList Add: " << s1; } - int nFalse = 0; - int nModel = 0; - int nFinish = 0; BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", got %1% filaments") % nsize; for (int n = 0; n < nsize; n++) { json OneFF = pFilament.at(n); @@ -1642,7 +1638,7 @@ std::string GuideFrame::w2s(wxString sSrc) void GuideFrame::GetStardardFilePath(std::string &FilePath) { StrReplace(FilePath, "\\", w2s(wxString::Format("%c", boost::filesystem::path::preferred_separator))); - StrReplace(FilePath, "\/", w2s(wxString::Format("%c", boost::filesystem::path::preferred_separator))); + StrReplace(FilePath, "/", w2s(wxString::Format("%c", boost::filesystem::path::preferred_separator))); } bool GuideFrame::LoadFile(std::string jPath, std::string &sContent) diff --git a/src/slic3r/GUI/WebUserLoginDialog.cpp b/src/slic3r/GUI/WebUserLoginDialog.cpp index b95aa50b5f..4385f43dae 100644 --- a/src/slic3r/GUI/WebUserLoginDialog.cpp +++ b/src/slic3r/GUI/WebUserLoginDialog.cpp @@ -3,7 +3,6 @@ #include #include "I18N.hpp" #include "libslic3r/AppConfig.hpp" -#include "slic3r/GUI/wxExtensions.hpp" #include "slic3r/GUI/GUI_App.hpp" #include "libslic3r_version.h" @@ -13,11 +12,9 @@ #include #include -#include #include #include -#include #include #include "MainFrame.hpp" diff --git a/src/slic3r/GUI/WebViewDialog.cpp b/src/slic3r/GUI/WebViewDialog.cpp index fab48fa679..a5e17afab4 100644 --- a/src/slic3r/GUI/WebViewDialog.cpp +++ b/src/slic3r/GUI/WebViewDialog.cpp @@ -5,7 +5,6 @@ #include "slic3r/GUI/GUI_App.hpp" #include "slic3r/GUI/MainFrame.hpp" #include "libslic3r_version.h" -#include "../Utils/Http.hpp" #include #include diff --git a/src/slic3r/GUI/Widgets/AMSControl.cpp b/src/slic3r/GUI/Widgets/AMSControl.cpp index ea2fea852c..c9a7e5c6e1 100644 --- a/src/slic3r/GUI/Widgets/AMSControl.cpp +++ b/src/slic3r/GUI/Widgets/AMSControl.cpp @@ -137,7 +137,7 @@ void AMSrefresh::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, con wxWindow::Create(parent, id, pos, size, wxBORDER_NONE); SetBackgroundColour(AMS_CONTROL_DEF_BLOCK_BK_COLOUR); - Bind(wxEVT_TIMER, &AMSrefresh::on_timer, this); + Bind(wxEVT_TIMER, [this](wxTimerEvent&) { on_timer(); }); Bind(wxEVT_PAINT, &AMSrefresh::paintEvent, this); Bind(wxEVT_ENTER_WINDOW, &AMSrefresh::OnEnterWindow, this); Bind(wxEVT_LEAVE_WINDOW, &AMSrefresh::OnLeaveWindow, this); @@ -166,14 +166,14 @@ void AMSrefresh::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, con m_playing_timer = new wxTimer(); m_playing_timer->SetOwner(this); - wxPostEvent(this, wxTimerEvent()); + on_timer(); SetSize(AMS_REFRESH_SIZE); SetMinSize(AMS_REFRESH_SIZE); SetMaxSize(AMS_REFRESH_SIZE); } -void AMSrefresh::on_timer(wxTimerEvent &event) +void AMSrefresh::on_timer() { //if (m_rotation_angle >= m_rfid_bitmap_list.size()) { // m_rotation_angle = 0; @@ -472,7 +472,7 @@ void AMSextruder::doRender(wxDC& dc) { //m_current_colur = wxSize size = GetSize(); - dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxSOLID)); + dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxPENSTYLE_SOLID)); dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH)); if (!m_none_ams_mode) { @@ -484,24 +484,24 @@ void AMSextruder::doRender(wxDC& dc) if (m_vams_loading) { - if (m_current_colur.Alpha() == 0) { dc.SetPen(wxPen(*wxWHITE, 6, wxSOLID)); } - else { dc.SetPen(wxPen(m_current_colur, 6, wxSOLID)); } + if (m_current_colur.Alpha() == 0) { dc.SetPen(wxPen(*wxWHITE, 6, wxPENSTYLE_SOLID)); } + else { dc.SetPen(wxPen(m_current_colur, 6, wxPENSTYLE_SOLID)); } dc.DrawRoundedRectangle(-size.x / 2, size.y * 0.1, size.x, size.y, 4); if ((m_current_colur == *wxWHITE || m_current_colur.Alpha() == 0) && !wxGetApp().dark_mode()) { - dc.SetPen(wxPen(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, 1, wxSOLID)); + dc.SetPen(wxPen(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, 1, wxPENSTYLE_SOLID)); dc.DrawRoundedRectangle(-size.x / 2 - FromDIP(3), size.y * 0.1 + FromDIP(3), size.x, size.y, 3); dc.DrawRoundedRectangle(-size.x / 2 + FromDIP(3), size.y * 0.1 - FromDIP(3), size.x, size.y, 5); } } if (m_ams_loading && !m_none_ams_mode) { - if (m_current_colur.Alpha() == 0) {dc.SetPen(wxPen(*wxWHITE, 6, wxSOLID));} - else {dc.SetPen(wxPen(m_current_colur, 6, wxSOLID));} + if (m_current_colur.Alpha() == 0) {dc.SetPen(wxPen(*wxWHITE, 6, wxPENSTYLE_SOLID));} + else {dc.SetPen(wxPen(m_current_colur, 6, wxPENSTYLE_SOLID));} dc.DrawLine(size.x / 2, -1, size.x / 2, size.y * 0.6 - 1); if ((m_current_colur == *wxWHITE || m_current_colur.Alpha() == 0) && !wxGetApp().dark_mode()) { - dc.SetPen(wxPen(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, 1, wxSOLID)); + dc.SetPen(wxPen(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, 1, wxPENSTYLE_SOLID)); dc.DrawLine(size.x / 2 - FromDIP(4), -1, size.x / 2 - FromDIP(3), size.y * 0.6 - 1); dc.DrawLine(size.x / 2 + FromDIP(3), -1, size.x / 2 + FromDIP(3), size.y * 0.6 - 1); } @@ -509,12 +509,12 @@ void AMSextruder::doRender(wxDC& dc) } else { if (m_ams_loading) { - if (m_current_colur.Alpha() == 0) { dc.SetPen(wxPen(*wxWHITE, 6, wxSOLID)); } - else { dc.SetPen(wxPen(m_current_colur, 6, wxSOLID)); } + if (m_current_colur.Alpha() == 0) { dc.SetPen(wxPen(*wxWHITE, 6, wxPENSTYLE_SOLID)); } + else { dc.SetPen(wxPen(m_current_colur, 6, wxPENSTYLE_SOLID)); } dc.DrawLine(size.x / 2, -1, size.x / 2, size.y * 0.6 - 1); if ((m_current_colur == *wxWHITE || m_current_colur.Alpha() == 0) && !wxGetApp().dark_mode()) { - dc.SetPen(wxPen(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, 1, wxSOLID)); + dc.SetPen(wxPen(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, 1, wxPENSTYLE_SOLID)); dc.DrawLine(size.x / 2 - FromDIP(4), -1, size.x / 2 - FromDIP(3), size.y * 0.6 - 1); dc.DrawLine(size.x / 2 + FromDIP(3), -1, size.x / 2 + FromDIP(3), size.y * 0.6 - 1); } @@ -587,18 +587,18 @@ void AMSVirtualRoad::doRender(wxDC& dc) wxSize size = GetSize(); if (m_vams_loading) { - if (m_current_color.Alpha() == 0) { dc.SetPen(wxPen(*wxWHITE, 6, wxSOLID)); } - else { dc.SetPen(wxPen(m_current_color, 6, wxSOLID)); } + if (m_current_color.Alpha() == 0) { dc.SetPen(wxPen(*wxWHITE, 6, wxPENSTYLE_SOLID)); } + else { dc.SetPen(wxPen(m_current_color, 6, wxPENSTYLE_SOLID)); } } else { - dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxSOLID)); + dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxPENSTYLE_SOLID)); } dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH)); dc.DrawRoundedRectangle(size.x / 2, -size.y / 1.1 + FromDIP(1), size.x, size.y, 4); if ((m_current_color == *wxWHITE || m_current_color.Alpha() == 0) && !wxGetApp().dark_mode()) { - dc.SetPen(wxPen(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, 1, wxSOLID)); + dc.SetPen(wxPen(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, 1, wxPENSTYLE_SOLID)); dc.DrawRoundedRectangle(size.x / 2 - FromDIP(3), -size.y / 1.1 + FromDIP(4), size.x, size.y, 5); dc.DrawRoundedRectangle(size.x / 2 + FromDIP(3), -size.y / 1.1 - FromDIP(2), size.x, size.y, 3); } @@ -988,11 +988,11 @@ void AMSLib::render_extra_lib(wxDC& dc) //draw road - dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxSOLID)); + dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxPENSTYLE_SOLID)); dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH)); if (m_pass_road) { - dc.SetPen(wxPen(m_info.material_colour, 6, wxSOLID)); + dc.SetPen(wxPen(m_info.material_colour, 6, wxPENSTYLE_SOLID)); } if (m_can_index == 0 || m_can_index == 3) { @@ -1114,9 +1114,9 @@ void AMSLib::render_generic_lib(wxDC &dc) // selected if (m_selected) { - dc.SetPen(wxPen(tmp_lib_colour, 2, wxSOLID)); + dc.SetPen(wxPen(tmp_lib_colour, 2, wxPENSTYLE_SOLID)); if (tmp_lib_colour.Alpha() == 0) { - dc.SetPen(wxPen(wxColour(tmp_lib_colour.Red(), tmp_lib_colour.Green(),tmp_lib_colour.Blue(),128), 2, wxSOLID)); + dc.SetPen(wxPen(wxColour(tmp_lib_colour.Red(), tmp_lib_colour.Green(),tmp_lib_colour.Blue(),128), 2, wxPENSTYLE_SOLID)); } dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH)); if (m_radius == 0) { @@ -1131,7 +1131,7 @@ void AMSLib::render_generic_lib(wxDC &dc) } if (!m_selected && m_hover) { - dc.SetPen(wxPen(AMS_CONTROL_BRAND_COLOUR, 2, wxSOLID)); + dc.SetPen(wxPen(AMS_CONTROL_BRAND_COLOUR, 2, wxPENSTYLE_SOLID)); dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH)); if (m_radius == 0) { dc.DrawRectangle(0, 0, size.x, size.y); @@ -1144,7 +1144,7 @@ void AMSLib::render_generic_lib(wxDC &dc) dc.SetBrush(wxBrush(tmp_lib_colour)); } else { - dc.SetPen(wxPen(tmp_lib_colour, 1, wxSOLID)); + dc.SetPen(wxPen(tmp_lib_colour, 1, wxPENSTYLE_SOLID)); dc.SetBrush(wxBrush(tmp_lib_colour)); } @@ -1230,7 +1230,7 @@ void AMSLib::render_generic_lib(wxDC &dc) dc.SetBrush(wxBrush(tmp_lib_colour)); } else { - dc.SetPen(wxPen(tmp_lib_colour, 1, wxSOLID)); + dc.SetPen(wxPen(tmp_lib_colour, 1, wxPENSTYLE_SOLID)); dc.SetBrush(wxBrush(tmp_lib_colour)); } } @@ -1260,7 +1260,7 @@ void AMSLib::render_generic_lib(wxDC &dc) #endif } if (tmp_lib_colour.Red() > 238 && tmp_lib_colour.Green() > 238 && tmp_lib_colour.Blue() > 238) { - dc.SetPen(wxPen(wxColour(130, 129, 128), 1, wxSOLID)); + dc.SetPen(wxPen(wxColour(130, 129, 128), 1, wxPENSTYLE_SOLID)); dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH)); dc.DrawLine(FromDIP(4), FromDIP(4) + top, size.x - FromDIP(4), FromDIP(4) + top); } @@ -1268,10 +1268,10 @@ void AMSLib::render_generic_lib(wxDC &dc) else { dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH)); if (tmp_lib_colour.Red() > 238 && tmp_lib_colour.Green() > 238 && tmp_lib_colour.Blue() > 238) { - dc.SetPen(wxPen(wxColour(130, 129, 128), 2, wxSOLID)); + dc.SetPen(wxPen(wxColour(130, 129, 128), 2, wxPENSTYLE_SOLID)); } else { - dc.SetPen(wxPen(tmp_lib_colour, 2, wxSOLID)); + dc.SetPen(wxPen(tmp_lib_colour, 2, wxPENSTYLE_SOLID)); } #ifdef __APPLE__ @@ -1285,7 +1285,7 @@ void AMSLib::render_generic_lib(wxDC &dc) } //border - dc.SetPen(wxPen(wxColour(130, 130, 128), 1, wxSOLID)); + dc.SetPen(wxPen(wxColour(130, 130, 128), 1, wxPENSTYLE_SOLID)); dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH)); #ifdef __APPLE__ dc.DrawRoundedRectangle(FromDIP(4), FromDIP(4), size.x - FromDIP(7), size.y - FromDIP(7), m_radius); @@ -1371,7 +1371,6 @@ AMSRoad::AMSRoad(wxWindow *parent, wxWindowID id, Caninfo info, int canindex, in m_info = info; m_canindex = canindex; // road type - auto mode = AMSRoadMode::AMS_ROAD_MODE_END; if (m_canindex == 0 && maxcan == 1) { m_rode_mode = AMSRoadMode::AMS_ROAD_MODE_NONE; } else if (m_canindex == 0 && maxcan > 1) { @@ -1492,7 +1491,7 @@ void AMSRoad::doRender(wxDC &dc) { wxSize size = GetSize(); - dc.SetPen(wxPen(m_road_def_color, 2, wxSOLID)); + dc.SetPen(wxPen(m_road_def_color, 2, wxPENSTYLE_SOLID)); dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH)); // left mode if (m_rode_mode == AMSRoadMode::AMS_ROAD_MODE_LEFT) { dc.DrawRoundedRectangle(-10, -10, size.x / 2 + 10, size.y * 0.6 + 10, 4); } @@ -1535,8 +1534,8 @@ void AMSRoad::doRender(wxDC &dc) // mode none // if (m_pass_rode_mode.size() == 1 && m_pass_rode_mode[0] == AMSPassRoadMode::AMS_ROAD_MODE_NONE) return; - if (m_road_color.Alpha() == 0) {dc.SetPen(wxPen(*wxWHITE, m_passroad_width, wxSOLID));} - else {dc.SetPen(wxPen(m_road_color, m_passroad_width, wxSOLID));} + if (m_road_color.Alpha() == 0) {dc.SetPen(wxPen(*wxWHITE, m_passroad_width, wxPENSTYLE_SOLID));} + else {dc.SetPen(wxPen(m_road_color, m_passroad_width, wxPENSTYLE_SOLID));} dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH)); @@ -1563,7 +1562,7 @@ void AMSRoad::doRender(wxDC &dc) // end mode if (m_rode_mode == AMSRoadMode::AMS_ROAD_MODE_END || m_rode_mode == AMSRoadMode::AMS_ROAD_MODE_END_ONLY) { - dc.SetPen(wxPen(m_road_def_color, 2, wxSOLID)); + dc.SetPen(wxPen(m_road_def_color, 2, wxPENSTYLE_SOLID)); dc.SetBrush(wxBrush(m_road_def_color)); dc.DrawRoundedRectangle(size.x * 0.37 / 2, size.y * 0.6 - size.y / 6, size.x * 0.63, size.y / 3, m_radius); } @@ -2244,7 +2243,7 @@ void AmsCans::doRender(wxDC& dc) // A1 - dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxSOLID)); + dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxPENSTYLE_SOLID)); dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH)); try @@ -2285,32 +2284,32 @@ void AmsCans::doRender(wxDC& dc) if (!m_road_canid.empty()) { if (m_road_canid == "0") { - dc.SetPen(wxPen(m_road_colour, passroad_width, wxSOLID)); + dc.SetPen(wxPen(m_road_colour, passroad_width, wxPENSTYLE_SOLID)); dc.DrawLine(a1_left, FromDIP(30), a1_left, a1_top); dc.DrawLine(a1_left, a1_top, end_top, a1_top); } if (m_road_canid == "1") { - dc.SetPen(wxPen(m_road_colour, passroad_width, wxSOLID)); + dc.SetPen(wxPen(m_road_colour, passroad_width, wxPENSTYLE_SOLID)); dc.DrawLine(a2_left, FromDIP(160), a2_left, a2_top); dc.DrawLine(a2_left, a2_top, end_top, a2_top); } if (m_road_canid == "2") { - dc.SetPen(wxPen(m_road_colour, passroad_width, wxSOLID)); + dc.SetPen(wxPen(m_road_colour, passroad_width, wxPENSTYLE_SOLID)); dc.DrawLine(a3_left, FromDIP(160), a3_left, a3_top); dc.DrawLine(a3_left, a3_top, end_top, a3_top); } if (m_road_canid == "3") { - dc.SetPen(wxPen(m_road_colour, passroad_width, wxSOLID)); + dc.SetPen(wxPen(m_road_colour, passroad_width, wxPENSTYLE_SOLID)); dc.DrawLine(a4_left, FromDIP(30), a4_left, a4_top); dc.DrawLine(a4_left, a4_top, end_top, a4_top); } } //to Extruder - dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxSOLID)); + dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxPENSTYLE_SOLID)); dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH)); dc.DrawLine(end_top, a1_top, end_top, size.y); @@ -2318,19 +2317,19 @@ void AmsCans::doRender(wxDC& dc) if (!m_road_canid.empty()) { if (!m_road_canid.empty()) { if (m_road_canid == "0") { - dc.SetPen(wxPen(m_road_colour, passroad_width, wxSOLID)); + dc.SetPen(wxPen(m_road_colour, passroad_width, wxPENSTYLE_SOLID)); dc.DrawLine(end_top, a1_top, end_top, size.y); } else if (m_road_canid == "1") { - dc.SetPen(wxPen(m_road_colour, passroad_width, wxSOLID)); + dc.SetPen(wxPen(m_road_colour, passroad_width, wxPENSTYLE_SOLID)); dc.DrawLine(end_top, a2_top, end_top, size.y); } else if (m_road_canid == "2") { - dc.SetPen(wxPen(m_road_colour, passroad_width, wxSOLID)); + dc.SetPen(wxPen(m_road_colour, passroad_width, wxPENSTYLE_SOLID)); dc.DrawLine(end_top, a3_top, end_top, size.y); } else if (m_road_canid == "3") { - dc.SetPen(wxPen(m_road_colour, passroad_width, wxSOLID)); + dc.SetPen(wxPen(m_road_colour, passroad_width, wxPENSTYLE_SOLID)); dc.DrawLine(end_top, a4_top, end_top, size.y); } } @@ -3100,7 +3099,6 @@ void AMSControl::SetClibrationLink(wxString link) void AMSControl::PlayRridLoading(wxString amsid, wxString canid) { AmsCansHash::iterator iter = m_ams_cans_list.begin(); - auto count_item_index = 0; for (auto i = 0; i < m_ams_cans_list.GetCount(); i++) { AmsCansWindow *cans = m_ams_cans_list[i]; @@ -3112,7 +3110,6 @@ void AMSControl::PlayRridLoading(wxString amsid, wxString canid) void AMSControl::StopRridLoading(wxString amsid, wxString canid) { AmsCansHash::iterator iter = m_ams_cans_list.begin(); - auto count_item_index = 0; for (auto i = 0; i < m_ams_cans_list.GetCount(); i++) { AmsCansWindow *cans = m_ams_cans_list[i]; diff --git a/src/slic3r/GUI/Widgets/AMSControl.hpp b/src/slic3r/GUI/Widgets/AMSControl.hpp index afcee66365..701be1bf34 100644 --- a/src/slic3r/GUI/Widgets/AMSControl.hpp +++ b/src/slic3r/GUI/Widgets/AMSControl.hpp @@ -175,7 +175,7 @@ public: void PlayLoading(); void StopLoading(); void create(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size); - void on_timer(wxTimerEvent &event); + void on_timer(); void OnEnterWindow(wxMouseEvent &evt); void OnLeaveWindow(wxMouseEvent &evt); void OnClick(wxMouseEvent &evt); diff --git a/src/slic3r/GUI/Widgets/ComboBox.cpp b/src/slic3r/GUI/Widgets/ComboBox.cpp index 55b8e12bcb..fc66d524a5 100644 --- a/src/slic3r/GUI/Widgets/ComboBox.cpp +++ b/src/slic3r/GUI/Widgets/ComboBox.cpp @@ -24,7 +24,7 @@ static wxWindow *GetScrollParent(wxWindow *pWindow) wxWindow *pWin = pWindow; while (pWin->GetParent()) { auto pWin2 = pWin->GetParent(); - if (auto top = dynamic_cast(pWin2)) + if (dynamic_cast(pWin2)) return dynamic_cast(pWin); pWin = pWin2; } diff --git a/src/slic3r/GUI/Widgets/FanControl.cpp b/src/slic3r/GUI/Widgets/FanControl.cpp index 222362e917..e7430037d4 100644 --- a/src/slic3r/GUI/Widgets/FanControl.cpp +++ b/src/slic3r/GUI/Widgets/FanControl.cpp @@ -112,7 +112,7 @@ void Fan::render(wxDC& dc) void Fan::doRender(wxDC& dc) { - auto rpm = wxT("rpm"); + // auto rpm = wxT("rpm"); wxSize size = GetSize(); dc.DrawBitmap(m_bitmap_bk.bmp(), wxPoint(0,0)); diff --git a/src/slic3r/GUI/Widgets/ImageSwitchButton.cpp b/src/slic3r/GUI/Widgets/ImageSwitchButton.cpp index af48b6d27a..d30f94976d 100644 --- a/src/slic3r/GUI/Widgets/ImageSwitchButton.cpp +++ b/src/slic3r/GUI/Widgets/ImageSwitchButton.cpp @@ -108,7 +108,6 @@ void ImageSwitchButton::render(wxDC& dc) wxSize size = GetSize(); wxSize szIcon; - wxSize szContent = textSize; ScalableBitmap &icon = GetValue() ? m_on : m_off; int content_height = icon.GetBmpHeight() + textSize.y + m_padding; @@ -268,7 +267,6 @@ void FanSwitchButton::render(wxDC& dc) wxSize size = GetSize(); wxSize szIcon; - wxSize szContent = textSize; ScalableBitmap& icon = GetValue() ? m_on : m_off; //int content_height = icon.GetBmpHeight() + textSize.y + m_padding; diff --git a/src/slic3r/GUI/Widgets/RoundedRectangle.cpp b/src/slic3r/GUI/Widgets/RoundedRectangle.cpp index 07f2aa0b30..f86f144ddc 100644 --- a/src/slic3r/GUI/Widgets/RoundedRectangle.cpp +++ b/src/slic3r/GUI/Widgets/RoundedRectangle.cpp @@ -1,5 +1,4 @@ #include "RoundedRectangle.hpp" -#include "../wxExtensions.hpp" #include #include diff --git a/src/slic3r/GUI/Widgets/SpinInput.cpp b/src/slic3r/GUI/Widgets/SpinInput.cpp index 5c8b91a0c7..cee447769e 100644 --- a/src/slic3r/GUI/Widgets/SpinInput.cpp +++ b/src/slic3r/GUI/Widgets/SpinInput.cpp @@ -205,8 +205,6 @@ void SpinInput::messureSize() if (size.y < h) { size.y = h; } - wxSize minSize = size; - minSize.x = GetMinWidth(); StaticBox::SetSize(size); SetMinSize(size); wxSize btnSize = {14, (size.y - 4) / 2}; diff --git a/src/slic3r/GUI/Widgets/StepCtrl.cpp b/src/slic3r/GUI/Widgets/StepCtrl.cpp index 73a3e80dd3..cdd25ea1f0 100644 --- a/src/slic3r/GUI/Widgets/StepCtrl.cpp +++ b/src/slic3r/GUI/Widgets/StepCtrl.cpp @@ -322,7 +322,6 @@ void StepIndicator::doRender(wxDC &dc) dc.DrawEllipse(circleX - radius, circleY - radius, radius * 2, radius * 2); // Draw content ( icon or text ) in circle if (disabled) { - wxSize sz = bmp_ok.GetBmpSize(); dc.DrawBitmap(bmp_ok.bmp(), circleX - radius, circleY - radius); } else { dc.SetFont(font_tip); diff --git a/src/slic3r/GUI/Widgets/TempInput.cpp b/src/slic3r/GUI/Widgets/TempInput.cpp index f581f73bf1..6ae82776de 100644 --- a/src/slic3r/GUI/Widgets/TempInput.cpp +++ b/src/slic3r/GUI/Widgets/TempInput.cpp @@ -412,7 +412,6 @@ void TempInput::render(wxDC &dc) /*if (!text.IsEmpty()) { }*/ - wxSize textSize = text_ctrl->GetSize(); if (align_right) { if (pt.x + labelSize.x > size.x) text = wxControl::Ellipsize(text, dc, wxELLIPSIZE_END, size.x - pt.x); pt.y = (size.y - labelSize.y) / 2; diff --git a/src/slic3r/GUI/Widgets/WebView.cpp b/src/slic3r/GUI/Widgets/WebView.cpp index 11f431c308..2bbe519c46 100644 --- a/src/slic3r/GUI/Widgets/WebView.cpp +++ b/src/slic3r/GUI/Widgets/WebView.cpp @@ -373,7 +373,7 @@ bool WebView::RunScript(wxWebView *webView, wxString const &javascript) }, NULL); return true; #endif - } catch (std::exception &e) { + } catch (std::exception&) { return false; } } diff --git a/src/slic3r/GUI/WipeTowerDialog.cpp b/src/slic3r/GUI/WipeTowerDialog.cpp index 78662c1f3a..e965c803ff 100644 --- a/src/slic3r/GUI/WipeTowerDialog.cpp +++ b/src/slic3r/GUI/WipeTowerDialog.cpp @@ -3,7 +3,6 @@ #include "libslic3r/FlushVolCalc.hpp" #include "WipeTowerDialog.hpp" #include "BitmapCache.hpp" -#include "GUI.hpp" #include "I18N.hpp" #include "GUI_App.hpp" #include "MsgDialog.hpp" @@ -735,9 +734,6 @@ void WipingPanel::update_warning_texts() static const wxColour g_warning_color = *wxRED; static const wxColour g_normal_color = *wxBLACK; - wxString multi_str = m_flush_multiplier_ebox->GetValue(); - float multiplier = wxAtof(multi_str); - bool has_exception_flush = false; for (int i = 0; i < edit_boxes.size(); i++) { auto& box_vec = edit_boxes[i]; diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp index b542723e15..65ed46ba42 100644 --- a/src/slic3r/GUI/wxExtensions.cpp +++ b/src/slic3r/GUI/wxExtensions.cpp @@ -491,7 +491,6 @@ wxBitmap* get_default_extruder_color_icon(bool thin_icon/* = false*/) const double em = Slic3r::GUI::wxGetApp().em_unit(); const int icon_width = lround((thin_icon ? 2 : 4.5) * em); const int icon_height = lround(2 * em); - bool dark_mode = Slic3r::GUI::wxGetApp().dark_mode(); wxClientDC cdc((wxWindow*)Slic3r::GUI::wxGetApp().mainframe); wxMemoryDC dc(&cdc); diff --git a/src/slic3r/Utils/ASCIIFolding.cpp b/src/slic3r/Utils/ASCIIFolding.cpp index 0eb02a5f8c..7e47448067 100644 --- a/src/slic3r/Utils/ASCIIFolding.cpp +++ b/src/slic3r/Utils/ASCIIFolding.cpp @@ -1953,8 +1953,7 @@ std::string fold_utf8_to_ascii(const std::string &src, bool is_convert_for_filen for (wchar_t c : wstr) fold_to_ascii(c, out); if (is_convert_for_filename) { - std::wstring_convert> converter; - auto dstStr = converter.to_bytes(dst); + auto dstStr = boost::locale::conv::utf_to_utf(dst); std::size_t found = dstStr.find_last_of("/\\"); if (found != std::string::npos) { @@ -1964,7 +1963,7 @@ std::string fold_utf8_to_ascii(const std::string &src, bool is_convert_for_filen std::string newFileName = regex_replace(filename, reg, ""); dstStr = dir + "\\" + newFileName; } - dst = converter.from_bytes(dstStr); + return dstStr; } return boost::locale::conv::utf_to_utf(dst.c_str(), dst.c_str() + dst.size()); diff --git a/src/slic3r/Utils/CalibUtils.cpp b/src/slic3r/Utils/CalibUtils.cpp index b5f9aaf0ed..88c59075ea 100644 --- a/src/slic3r/Utils/CalibUtils.cpp +++ b/src/slic3r/Utils/CalibUtils.cpp @@ -519,7 +519,7 @@ bool CalibUtils::calib_flowrate(int pass, const CalibInfo &calib_info, wxString const ConfigOptionFloats *nozzle_diameter_config = printer_config.option("nozzle_diameter"); assert(nozzle_diameter_config->values.size() > 0); float nozzle_diameter = nozzle_diameter_config->values[0]; - float xyScale = nozzle_diameter / 0.6; + // float xyScale = nozzle_diameter / 0.6; // scale z to have 7 layers double first_layer_height = print_config.option("initial_layer_print_height")->value; double layer_height = nozzle_diameter / 2.0; // prefer 0.2 layer height for 0.4 nozzle @@ -1067,7 +1067,6 @@ bool CalibUtils::process_and_store_3mf(Model *model, const DynamicPrintConfig &f { GLVolumeCollection glvolume_collection; std::vector colors_out(1); - unsigned char rgb_color[4] = {255, 255, 255, 255}; ColorRGBA new_color {1.0f, 1.0f, 1.0f, 1.0f}; colors_out.push_back(new_color); @@ -1080,9 +1079,9 @@ bool CalibUtils::process_and_store_3mf(Model *model, const DynamicPrintConfig &f const ModelObject &model_object = *model->objects[obj_idx]; for (int volume_idx = 0; volume_idx < (int)model_object.volumes.size(); ++ volume_idx) { - const ModelVolume &model_volume = *model_object.volumes[volume_idx]; + // const ModelVolume &model_volume = *model_object.volumes[volume_idx]; for (int instance_idx = 0; instance_idx < (int)model_object.instances.size(); ++ instance_idx) { - const ModelInstance &model_instance = *model_object.instances[instance_idx]; + // const ModelInstance &model_instance = *model_object.instances[instance_idx]; glvolume_collection.load_object_volume(&model_object, obj_idx, volume_idx, instance_idx, "volume", true, false, true); glvolume_collection.volumes.back()->set_render_color(new_color); glvolume_collection.volumes.back()->set_color(new_color); @@ -1128,11 +1127,11 @@ bool CalibUtils::process_and_store_3mf(Model *model, const DynamicPrintConfig &f store_params.strategy = SaveStrategy::Silence | SaveStrategy::WithGcode | SaveStrategy::SplitModel | SaveStrategy::SkipModel; - bool success = Slic3r::store_bbs_3mf(store_params); + Slic3r::store_bbs_3mf(store_params); store_params.strategy = SaveStrategy::Silence | SaveStrategy::SplitModel | SaveStrategy::WithSliceInfo | SaveStrategy::SkipAuxiliary; store_params.path = config_3mf_path.c_str(); - success = Slic3r::store_bbs_3mf(store_params); + Slic3r::store_bbs_3mf(store_params); release_PlateData_list(plate_data_list); return true; diff --git a/src/slic3r/Utils/ESP3D.cpp b/src/slic3r/Utils/ESP3D.cpp index 57b917e3a1..4c035bc1f9 100644 --- a/src/slic3r/Utils/ESP3D.cpp +++ b/src/slic3r/Utils/ESP3D.cpp @@ -1,8 +1,6 @@ #include "ESP3D.hpp" #include -#include -#include #include #include #include @@ -12,13 +10,7 @@ #include #include -#include #include -#include -#include -#include -#include -#include #include "libslic3r/PrintConfig.hpp" #include "slic3r/GUI/GUI.hpp" @@ -26,7 +18,6 @@ #include "slic3r/GUI/MsgDialog.hpp" #include "Http.hpp" #include "SerialMessage.hpp" -#include "SerialMessageType.hpp" namespace fs = boost::filesystem; namespace pt = boost::property_tree; diff --git a/src/slic3r/Utils/Obico.cpp b/src/slic3r/Utils/Obico.cpp index 5541d1c683..6486e43114 100644 --- a/src/slic3r/Utils/Obico.cpp +++ b/src/slic3r/Utils/Obico.cpp @@ -10,10 +10,8 @@ #include #include #include -#include #include -#include #include #include "slic3r/GUI/GUI.hpp" @@ -22,8 +20,6 @@ #include "slic3r/GUI/format.hpp" #include "Http.hpp" #include "libslic3r/AppConfig.hpp" -#include "Bonjour.hpp" -#include "slic3r/GUI/BonjourDialog.hpp" namespace fs = boost::filesystem; namespace pt = boost::property_tree; diff --git a/src/slic3r/Utils/PresetUpdater.cpp b/src/slic3r/Utils/PresetUpdater.cpp index cdd91eb22e..55bb426463 100644 --- a/src/slic3r/Utils/PresetUpdater.cpp +++ b/src/slic3r/Utils/PresetUpdater.cpp @@ -52,7 +52,6 @@ using Slic3r::GUI::Config::SnapshotDB; namespace Slic3r { -static const char *INDEX_FILENAME = "index.idx"; static const char *TMP_EXTENSION = ".data"; diff --git a/src/slic3r/Utils/UndoRedo.cpp b/src/slic3r/Utils/UndoRedo.cpp index eaf90c7349..8e7bd703c3 100644 --- a/src/slic3r/Utils/UndoRedo.cpp +++ b/src/slic3r/Utils/UndoRedo.cpp @@ -1071,7 +1071,7 @@ bool StackImpl::has_redo_snapshot() const // BBS: undo-redo until modify record auto it = std::lower_bound(m_snapshots.begin(), m_snapshots.end(), Snapshot(m_active_snapshot_time)); - for (it; it != m_snapshots.end(); ++it) { + for (; it != m_snapshots.end(); ++it) { if (snapshot_modifies_project(*it)) return true; } @@ -1340,12 +1340,12 @@ bool StackImpl::has_real_change_from(size_t time) const Snapshot(m_active_snapshot_time)); if (it_active == m_snapshots.end()) return true; if (it_active > it_time) { - for (it_time; it_time < it_active; ++it_time) { + for (; it_time < it_active; ++it_time) { if (snapshot_modifies_project(*it_time)) return true; } } else { - for (it_active; it_active < it_time; ++it_active) { + for (; it_active < it_time; ++it_active) { if (snapshot_modifies_project(*it_active)) return true; }