From 5bc85776fef3e27599c42294cf51d566ef3cc800 Mon Sep 17 00:00:00 2001 From: bb1950328 Date: Fri, 5 Jan 2024 00:34:06 +0100 Subject: [PATCH] reformat everything --- .clang-format | 4 +- .idea/codeStyles/Project.xml | 31 ++++++++++ .idea/codeStyles/codeStyleConfig.xml | 1 - src/benchmarks/bench_matmul.cpp | 42 ++++++------- .../bench_triangle_clockwise_check.cpp | 38 ++++++------ src/binary_file.cpp | 3 +- src/binary_file.h | 4 +- src/config/read.h | 1 + src/connection/bounding.cpp | 3 +- src/connection/bounding.h | 4 ++ src/connection/connection.cpp | 10 +-- src/connection/connection_check.cpp | 23 +++++-- src/connection/connection_check.h | 2 + src/connection/connection_graph.cpp | 11 ++++ src/connection/connection_graph.h | 4 +- src/connection/connector/clip.cpp | 9 ++- src/connection/connector/clip.h | 1 + src/connection/connector/connector.cpp | 7 +++ src/connection/connector/connector.h | 1 + src/connection/connector/cylindrical.cpp | 13 +++- src/connection/connector/cylindrical.h | 1 - src/connection/connector/finger.cpp | 10 ++- src/connection/connector/finger.h | 1 + src/connection/connector/generic.cpp | 9 ++- src/connection/connector/generic.h | 1 + src/connection/connector_conversion.cpp | 45 +++++++++----- src/connection/connector_conversion.h | 1 + src/connection/connector_data_provider.h | 1 + src/connection/degrees_of_freedom.cpp | 11 +++- src/connection/engine.cpp | 48 ++++++++------ src/connection/engine.h | 1 + src/connection/intersection_graph.cpp | 12 +++- src/connection/intersection_graph.h | 1 + src/connection/ldcad_meta/base.cpp | 28 ++++++--- src/connection/ldcad_meta/base.h | 6 ++ src/connection/ldcad_meta/clear_command.cpp | 5 +- src/connection/ldcad_meta/clp_command.cpp | 5 +- src/connection/ldcad_meta/cyl_command.cpp | 4 +- src/connection/ldcad_meta/fgr_command.cpp | 4 +- src/connection/ldcad_meta/gen_command.cpp | 4 +- src/connection/ldcad_meta/incl_command.cpp | 4 +- .../ldcad_meta/mirror_info_command.cpp | 7 ++- src/connection/ldcad_meta/parse.cpp | 12 ++++ src/connection/ldcad_meta/parse.h | 1 + src/connection/ldcad_meta/write.cpp | 12 ++++ src/connection/ldcad_meta/write.h | 1 + src/connection/pair_checker.cpp | 19 +++--- src/connection/pair_checker.h | 2 +- .../connection_graphviz_generator.cpp | 17 +++-- .../connection_graphviz_generator.h | 4 ++ .../connector_data_visualizer.cpp | 22 +++++-- .../visualization/connector_data_visualizer.h | 1 - src/connection/visualization/meshes.cpp | 23 ++++++- src/constant_data/constants.cpp | 38 ++++++------ src/controller.cpp | 60 ++++++++++++------ src/controller.h | 4 +- src/db.cpp | 11 +++- src/editor/editor.cpp | 44 ++++++++++--- src/editor/editor.h | 1 - src/editor/tools.cpp | 23 ++++--- src/editor/tools.h | 2 +- src/element_tree.cpp | 57 +++++++++++------ src/element_tree.h | 2 + src/graphics/camera.cpp | 5 +- src/graphics/camera.h | 1 - src/graphics/connection_visualization.h | 2 +- src/graphics/mesh/mesh.cpp | 10 ++- src/graphics/mesh/mesh.h | 1 - src/graphics/mesh/mesh_collection.cpp | 9 ++- src/graphics/mesh/mesh_generated.cpp | 8 ++- src/graphics/mesh/mesh_generated.h | 2 - src/graphics/mesh/mesh_line_data.cpp | 2 + src/graphics/mesh/mesh_simple_classes.cpp | 2 - src/graphics/mesh/mesh_simple_classes.h | 1 - .../mesh/mesh_textured_triangle_data.cpp | 16 +++-- src/graphics/mesh/mesh_triangle_data.cpp | 18 ++++-- src/graphics/opengl_native_or_replacement.cpp | 3 +- src/graphics/opengl_native_or_replacement.h | 2 +- src/graphics/orientation_cube.h | 1 - src/graphics/overlay2d/arrow_element.cpp | 2 +- src/graphics/overlay2d/arrow_element.h | 2 +- .../overlay2d/dashed_line_element.cpp | 15 ++++- src/graphics/overlay2d/dashed_line_element.h | 3 +- .../overlay2d/dashed_poly_line_element.cpp | 12 ++-- .../overlay2d/dashed_poly_line_element.h | 2 +- src/graphics/overlay2d/data.h | 1 + src/graphics/overlay2d/element.cpp | 1 + src/graphics/overlay2d/element.h | 2 +- src/graphics/overlay2d/element_collection.cpp | 4 +- src/graphics/overlay2d/element_collection.h | 1 + src/graphics/overlay2d/line_element.cpp | 2 +- src/graphics/overlay2d/line_element.h | 1 + .../overlay2d/regular_polygon_element.cpp | 1 - .../overlay2d/regular_polygon_element.h | 2 +- src/graphics/overlay2d/square_element.cpp | 2 +- src/graphics/overlay2d/square_element.h | 2 +- src/graphics/overlay2d/triangle_element.cpp | 1 + src/graphics/overlay2d/triangle_element.h | 2 +- src/graphics/overlay2d/vertex_generator.cpp | 9 +-- src/graphics/overlay2d/vertex_generator.h | 8 ++- src/graphics/scene.cpp | 23 ++++--- src/graphics/shaders.cpp | 1 - src/graphics/texmap_projection.cpp | 1 - src/graphics/texmap_projection.h | 3 +- src/graphics/texture.cpp | 5 +- src/graphics/texture.h | 1 + src/graphics/thumbnail_generator.cpp | 12 +++- src/graphics/thumbnail_generator.h | 1 + .../components/component_orientation_cube.cpp | 22 ++++--- src/gui/context_menu/context_menu_handler.cpp | 6 ++ src/gui/context_menu/context_menu_handler.h | 1 + src/gui/context_menu/node_context_menu.cpp | 5 +- src/gui/context_menu/node_context_menu.h | 2 +- src/gui/dialogs.cpp | 14 +++-- src/gui/graphical_transform/base_action.cpp | 21 +++++-- src/gui/graphical_transform/base_action.h | 4 ++ src/gui/graphical_transform/move.cpp | 10 ++- src/gui/graphical_transform/provider.cpp | 13 ++-- src/gui/graphical_transform/provider.h | 1 + src/gui/graphical_transform/rotation.cpp | 8 +++ src/gui/graphical_transform/translation.cpp | 6 +- src/gui/gui.cpp | 18 ++++-- src/gui/gui.h | 6 +- src/gui/gui_internal.cpp | 18 +++--- src/gui/icons.cpp | 9 ++- src/gui/icons.h | 1 + src/gui/main_menu_bar.cpp | 9 +++ src/gui/main_menu_bar.h | 1 + src/gui/modals.cpp | 12 ++-- src/gui/modals.h | 2 + src/gui/mouse_cursor_handler.cpp | 4 +- src/gui/windows/window_about.cpp | 16 ++--- .../window_connection_visualization.cpp | 1 + src/gui/windows/window_debug.cpp | 23 ++++--- src/gui/windows/window_editor_meta_info.h | 3 +- src/gui/windows/window_element_properties.cpp | 12 ++-- src/gui/windows/window_element_properties.h | 1 - src/gui/windows/window_element_tree.cpp | 1 + .../windows/window_ldraw_file_inspector.cpp | 21 ++++--- src/gui/windows/window_ldraw_file_inspector.h | 2 +- src/gui/windows/window_log.cpp | 39 ++++++++---- src/gui/windows/window_mesh_inspector.cpp | 2 +- src/gui/windows/window_mesh_inspector.h | 1 + src/gui/windows/window_model_info.cpp | 3 +- src/gui/windows/window_model_info.h | 3 +- src/gui/windows/window_orientation_cube.cpp | 1 - src/gui/windows/window_part_palette.cpp | 6 +- src/gui/windows/window_system_info.cpp | 1 + src/gui/windows/window_view3d.cpp | 7 ++- src/gui/windows/windows.cpp | 6 +- src/gui/windows/windows.h | 1 + src/helpers/bounding_volumes.cpp | 20 +++--- src/helpers/bounding_volumes.h | 8 +-- src/helpers/color.cpp | 12 ++++ src/helpers/color.h | 7 ++- src/helpers/debug_nodes.cpp | 4 +- src/helpers/debug_nodes.h | 6 +- src/helpers/earcut_hpp_with_glm.h | 3 +- src/helpers/geometry.cpp | 6 +- src/helpers/geometry.h | 2 + src/helpers/glm_eigen_conversion.h | 1 + src/helpers/graphviz_wrapper.cpp | 24 +++---- src/helpers/graphviz_wrapper.h | 1 + src/helpers/palanteer_implementation.cpp | 2 +- src/helpers/parts_library_downloader.h | 2 + src/helpers/platform_detection.h | 15 ++--- src/helpers/polygon_clipping.cpp | 2 + src/helpers/polygon_clipping.h | 4 +- src/helpers/ray.cpp | 2 +- src/helpers/ray.h | 1 + src/helpers/stringutil.cpp | 62 ++++++++++++------- src/helpers/stringutil.h | 6 ++ src/helpers/system_info.cpp | 3 +- .../bricklink_constants_provider.cpp | 4 +- .../part_color_availability_provider.cpp | 2 - src/info_providers/price_guide_provider.cpp | 1 - src/info_providers/price_guide_provider.h | 1 + src/ldr/colors.cpp | 23 ++++--- src/ldr/colors.h | 1 + src/ldr/file_repo.cpp | 15 +++-- src/ldr/file_repo.h | 1 - src/ldr/files.cpp | 40 +++++++----- src/ldr/files.h | 1 + src/ldr/regular_file_repo.cpp | 1 - src/ldr/shadow_file_repo.cpp | 18 ++++-- src/ldr/zip_file_repo.cpp | 4 +- src/logging/logger.cpp | 1 - src/logging/logger.h | 2 +- src/metrics.cpp | 4 +- src/metrics.h | 6 +- src/persistent_state.cpp | 2 +- src/snapping/snap_common.cpp | 5 +- src/snapping/snap_common.h | 1 + src/snapping/snap_const.h | 21 ++++--- src/snapping/snap_handler.cpp | 8 +++ src/snapping/snap_rotational.h | 1 - src/tasks.cpp | 4 +- src/tasks.h | 2 + src/test/catchMain.cpp | 2 +- src/test/helpers/test_almost_comparations.cpp | 2 + src/test/helpers/test_fraction.cpp | 2 +- src/test/helpers/test_geometry.cpp | 19 +++--- src/test/helpers/test_polygon_clipping.cpp | 3 +- src/test/helpers/test_stringutil.cpp | 6 +- src/test/helpers/test_util.cpp | 1 - src/test/testing_tools.h | 3 + src/test/utilities/test_gears.cpp | 1 - src/types.h | 6 +- src/user_actions.cpp | 17 +++-- src/utilities/gears.cpp | 24 ++++--- 210 files changed, 1181 insertions(+), 592 deletions(-) diff --git a/.clang-format b/.clang-format index 2c2ff485..cfc0ee91 100644 --- a/.clang-format +++ b/.clang-format @@ -7,7 +7,7 @@ AllowAllArgumentsOnNextLine: false AllowAllConstructorInitializersOnNextLine: false AllowAllParametersOfDeclarationOnNextLine: false AllowShortBlocksOnASingleLine: Always -AllowShortCaseLabelsOnASingleLine: true +AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: Inline AllowShortIfStatementsOnASingleLine: Never AllowShortLambdasOnASingleLine: All @@ -16,7 +16,7 @@ AlwaysBreakAfterReturnType: None AlwaysBreakTemplateDeclarations: Yes BreakBeforeBraces: Custom BraceWrapping: - AfterCaseLabel: false + AfterCaseLabel: true AfterClass: false AfterControlStatement: Never AfterEnum: false diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 0d18d99c..b96f9923 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -6,6 +6,37 @@