diff --git a/.github/workflows/release_windows.yml b/.github/workflows/release_windows.yml index 9bf14601..ecb858fd 100644 --- a/.github/workflows/release_windows.yml +++ b/.github/workflows/release_windows.yml @@ -2,3 +2,55 @@ name: Release Windows on: workflow_dispatch: + release: + types: published + +env: + PACKAGE: ${{ github.event.repository.name }} + +jobs: + run: + + runs-on: ubuntu-latest + + steps: + - name: Chekout + uses: actions/checkout@v4 + + - name: 'Dependencies: Nix' + uses: cachix/install-nix-action@v26 + with: + nix_path: nixpkgs=channel:nixos-unstable + + - name: Setup Nix cache + uses: DeterminateSystems/magic-nix-cache-action@v4 + + - name: Build + env: + NIXPKGS_ALLOW_BROKEN: 1 + NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM: 1 + run: nix build -L --no-update-lock-file --show-trace --impure .#${{ env.PACKAGE }}Mingw64Zip + + - name: Extract informations + id: extract + shell: bash + run: | + echo "upload_url=$(curl -sL ${{ github.api_url }}/repos/${{ github.repository }}/releases/tags/${{ github.ref_name }}} | jq -r '.upload_url')" >> $GITHUB_OUTPUT + + - name: Deploy .zip on Github + if: ${{ github.event_name == 'release' }} + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.extract.outputs.upload_url }} + asset_path: result/${{ env.PACKAGE }}-x86_64-w64-mingw32-${{ github.ref_name }}.zip + asset_name: ${{ env.PACKAGE }}-${{ github.ref_name }}-x86_64-w64-mingw32.zip + asset_content_type: application/zip + + - name: Fail + if: ${{ github.event_name != 'release' }} + uses: actions/github-script@v7 + with: + script: | + core.setFailed("Trigger event: ${{ github.event_name }} (should be release), Git ref: ${{ github.ref_name }}") diff --git a/CMakeLists.txt b/CMakeLists.txt index 156fb98d..9417de4c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,19 +18,8 @@ if( NOT CMAKE_BUILD_TYPE ) endif() message( STATUS "Build type: ${CMAKE_BUILD_TYPE}" ) -#[[ -set( CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS - OWNER_READ - OWNER_WRITE - OWNER_EXECUTE - GROUP_READ - GROUP_EXECUTE - WORLD_READ - WORLD_EXECUTE - ) -#]] - option( CPM_DISABLE "Don't use CPM to retrieve dependencies" "$ENV{CPM_DISABLE}" ) +option( OEMSH_PORTABILITY_TWEAKS "Enable some portability tweaks" OFF ) if( NOT CPM_DISABLE ) message( STATUS "Downloading dependencies with CPM" ) @@ -53,7 +42,7 @@ if( NOT CPM_DISABLE ) CPMAddPackage( NAME pugixml GITHUB_REPOSITORY zeux/pugixml - VERSION 1.12.1 + VERSION 1.15 OPTIONS "BUILD_SHARED_LIBS ON" ) @@ -63,7 +52,7 @@ if( NOT CPM_DISABLE ) CPMAddPackage( NAME CLI11 GITHUB_REPOSITORY CLIUtils/CLI11 - VERSION 2.3.1 + VERSION 2.5.0 ) set( CLI11_DIR "${CLI11_BINARY_DIR}" ) @@ -81,7 +70,7 @@ if( pugixml_FOUND ) message( STATUS "Found pugixml: ${pugixml_DIR} ${PUGIXML_VERSION}" ) endif() -find_package( CLI11 REQUIRED ) +find_package( CLI11 2.4.0 REQUIRED ) if( CLI11_FOUND ) message( STATUS "Found CLI11: ${CLI11_DIR} ${CLI11_VERSION}" ) endif() @@ -109,6 +98,18 @@ if( CMakeUtils_FOUND ) include( CMakeUtils ) endif() +include( GNUInstallDirs ) + +set( CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS + OWNER_READ + OWNER_WRITE + OWNER_EXECUTE + GROUP_READ + GROUP_EXECUTE + WORLD_READ + WORLD_EXECUTE + ) + add_subdirectory( "${CMAKE_SOURCE_DIR}/src" ) add_subdirectory( "${CMAKE_SOURCE_DIR}/test" ) add_subdirectory( "${CMAKE_SOURCE_DIR}/icon" ) diff --git a/README.md b/README.md index fb6219a5..b2bf8fc5 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ [![SonarCloud quality gate](https://sonarcloud.io/api/project_badges/measure?project=Open-RFlab_openemsh&metric=alert_status)](https://sonarcloud.io/dashboard?id=Open-RFlab_openemsh) [![SonarCloud coverage](https://sonarcloud.io/api/project_badges/measure?project=Open-RFlab_openemsh&metric=coverage)](https://sonarcloud.io/dashboard?id=Open-RFlab_openemsh) +[![Package Windows](https://img.shields.io/github/actions/workflow/status/Open-RFlab/openemsh/release_windows.yml?label=package&logo=mingww64)](https://github.com/Open-RFlab/openemsh/releases) + # OpenEMSH : OpenEMS Mesher [WIP] _This project is under heavy development and not yet usable, for now the best way to contribute is to give a symbolic tip. :)_ diff --git a/default.nix b/default.nix index f847c821..9a1b2aea 100644 --- a/default.nix +++ b/default.nix @@ -1,6 +1,5 @@ { lib -, pkgs ? import {} -, stdenv ? pkgs.stdenv +, stdenv , cmake , cmake-utils , git @@ -9,12 +8,11 @@ , pugixml , qtbase , wrapQtAppsHook +, withPortabilityTweaks ? false }: -with pkgs; - stdenv.mkDerivation { - name = "openemsh"; + pname = "openemsh"; version = "0.0.0"; src = lib.nix-filter { @@ -47,7 +45,8 @@ stdenv.mkDerivation { ]; cmakeFlags = [ - "-DCPM_DISABLE=ON" + (lib.cmakeBool "CPM_DISABLE" true) + (lib.cmakeBool "OEMSH_PORTABILITY_TWEAKS" withPortabilityTweaks) ]; shellHook = '' @@ -55,6 +54,13 @@ stdenv.mkDerivation { export CPM_DISABLE=ON ''; + postInstall = lib.optionals stdenv.hostPlatform.isWindows '' + mkdir -p $out/bin/platforms + ln -t $out/bin/platforms -s ${qtbase}/lib/qt-6/plugins/platforms/qwindows.dll + ''; + + dontWrapQtApps = stdenv.hostPlatform.isWindows; + QT_XCB_GL_INTEGRATION = "none"; meta = { diff --git a/flake.lock b/flake.lock index b78d3fb0..778f6deb 100644 --- a/flake.lock +++ b/flake.lock @@ -10,11 +10,11 @@ ] }, "locked": { - "lastModified": 1733826552, - "narHash": "sha256-A+wd21QaeVZf4R/MkL52tnF4tUqAqaeEVytWEf2RZuk=", + "lastModified": 1755572725, + "narHash": "sha256-YYOcjrYqytxoWvxWRaTsys2BQcd1C7wn0Et6Qe98pJM=", "owner": "conformism", "repo": "cmake-utils", - "rev": "5d9ae4e7ec85050bfcb798c6d2bc98a1ecf04e58", + "rev": "9cb1962902ef3a78c84702237bec4e846fe321b7", "type": "github" }, "original": { @@ -66,11 +66,11 @@ ] }, "locked": { - "lastModified": 1713543440, - "narHash": "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=", + "lastModified": 1752054764, + "narHash": "sha256-Ob/HuUhANoDs+nvYqyTKrkcPXf4ZgXoqMTQoCK0RFgQ=", "owner": "nix-community", "repo": "nixGL", - "rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a", + "rev": "a8e1ce7d49a149ed70df676785b07f63288f53c5", "type": "github" }, "original": { @@ -81,11 +81,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1722618413, - "narHash": "sha256-7Wn87QQv6Nwm97DImoUdoCDQ7DGiufQdbAIoMaa5Bw4=", + "lastModified": 1754990257, + "narHash": "sha256-u7ubvtxdTnFPpV27AHpgoKn7qHuE7sgWgza/1oj5nzA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "930c6cf5da5433b1c7774baf1696447bfd211ace", + "rev": "7a732ed41ca0dd64b4b71b563ab9805a80a7d693", "type": "github" }, "original": { @@ -94,13 +94,30 @@ "type": "github" } }, + "nixpkgs-mingw": { + "locked": { + "lastModified": 1714253743, + "narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994", + "type": "github" + } + }, "root": { "inputs": { "cmake-utils": "cmake-utils", "flake-utils": "flake-utils", "nix-filter": "nix-filter", "nixGL": "nixGL", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nixpkgs-mingw": "nixpkgs-mingw" } }, "systems": { diff --git a/flake.nix b/flake.nix index 802cd30b..998434b6 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,9 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs"; + # Known to work version, nixpkgs is often broken for cross compilation. + nixpkgs-mingw.url = "github:NixOS/nixpkgs/58a1abdbae3217ca6b702f03d3b35125d88a2994"; + nix-filter.url = "github:numtide/nix-filter"; flake-utils.url = "github:numtide/flake-utils"; @@ -25,6 +28,7 @@ outputs = { self , nixpkgs + , nixpkgs-mingw , nix-filter , cmake-utils , flake-utils @@ -41,6 +45,48 @@ self.overlays.pkgs ]; + pkgs-mingw = nixpkgs-mingw.legacyPackages.${system}.appendOverlays [ + (final: prev: { inherit (pkgs) cli11; }) + cmake-utils.overlays.pkgs + self.overlays.pkgs + ]; + + wineWrapper = package: pkgs.stdenvNoCC.mkDerivation { + inherit (package) pname version meta; + doCheck = false; + dontUnpack = true; + dontBuild = true; + installPhase = + let + script = '' + #!/bin/sh + exec ${pkgs.wine64}/bin/wine64 ${package}/bin/${package.pname}.exe "$@" + ''; + in '' + mkdir -p $out/bin + printf '${script}' > $out/bin/${package.pname} + chmod +x $out/bin/${package.pname} +# mkdir -p $out/share +# ${pkgs.xorg.lndir}/bin/lndir -silent ${package}/share $out/share + ''; + }; + + zipWrapper = package: pkgs.stdenvNoCC.mkDerivation { + inherit (package) pname version meta; + doCheck = false; + dontUnpack = true; + nativeBuildInputs = [ pkgs.zip ]; + buildPhase = '' + cp -rL ${package} ${package.name} + chmod -R ug+w ${package.name} + zip -r ${package.name}.zip ${package.name}/* + ''; + installPhase = '' + mkdir -p $out + mv ${package.name}.zip $out/ + ''; + }; + in { devShells = { default = pkgs.mkShell { @@ -77,16 +123,23 @@ packages = { default = pkgs.openemsh; openemsh = pkgs.openemsh; + openemshMingw64 = pkgs-mingw.openemshMingw64; + openemshMingw64Zip = zipWrapper pkgs-mingw.openemshMingw64; + openemshWine64 = wineWrapper (pkgs-mingw.openemshMingw64.override { withPortabilityTweaks = true; }); }; }) // { overlays = { pkgs = final: prev: { openemsh = prev.qt6.callPackage ./default.nix { inherit lib; - stdenv = prev.llvmPackages_13.stdenv; }; - inherit (prev.python310Packages) cairosvg; + openemshMingw64 = prev.pkgsCross.mingwW64.qt6.callPackage ./default.nix { + inherit lib; + inherit (final) texlive; + }; + + inherit (prev.python3Packages) cairosvg; csxcad = (prev.csxcad.overrideAttrs (new: old: { version = "0.6.3"; diff --git a/icon/CMakeLists.txt b/icon/CMakeLists.txt index 5d5e379a..6f771137 100644 --- a/icon/CMakeLists.txt +++ b/icon/CMakeLists.txt @@ -1,35 +1,39 @@ -# As TikZ fadings are buggy, SVG generation requires going through a PDF -# intermediate plus a manual edition step. -compile_latex_file( "icon" REGISTER_TO "ICON_SVG_FILE" ) +if( CMakeUtils_Latex_FOUND ) + # As TikZ fadings are buggy, SVG generation requires going through a PDF + # intermediate plus a manual edition step. + compile_latex_file( "icon" REGISTER_TO "ICON_SVG_FILE" ) +endif() -# Warning : order matters. -#svg_to_png( "openemsh" SIZE 512 REGISTER_TO "ICON_PNG_FILES" ) -svg_to_png( "openemsh" SIZE 256 REGISTER_TO "ICON_PNG_FILES" ) -svg_to_png( "openemsh" SIZE 128 REGISTER_TO "ICON_PNG_FILES" ) -svg_to_png( "openemsh" SIZE 64 REGISTER_TO "ICON_PNG_FILES" ) -svg_to_png( "openemsh" SIZE 48 REGISTER_TO "ICON_PNG_FILES" ) -svg_to_png( "openemsh" SIZE 32 REGISTER_TO "ICON_PNG_FILES" ) -svg_to_png( "openemsh" SIZE 22 REGISTER_TO "ICON_PNG_FILES" ) -svg_to_png( "openemsh" SIZE 16 REGISTER_TO "ICON_PNG_FILES" ) +if( CMakeUtils_Icon_FOUND ) + # Warning : order matters. + #svg_to_png( "openemsh" SIZE 512 REGISTER_TO "ICON_PNG_FILES" ) + svg_to_png( "openemsh" SIZE 256 REGISTER_TO "ICON_PNG_FILES" ) + svg_to_png( "openemsh" SIZE 128 REGISTER_TO "ICON_PNG_FILES" ) + svg_to_png( "openemsh" SIZE 64 REGISTER_TO "ICON_PNG_FILES" ) + svg_to_png( "openemsh" SIZE 48 REGISTER_TO "ICON_PNG_FILES" ) + svg_to_png( "openemsh" SIZE 32 REGISTER_TO "ICON_PNG_FILES" ) + svg_to_png( "openemsh" SIZE 22 REGISTER_TO "ICON_PNG_FILES" ) + svg_to_png( "openemsh" SIZE 16 REGISTER_TO "ICON_PNG_FILES" ) -png_to_ico( "openemsh" INPUT ${ICON_PNG_FILES} REGISTER_TO "ICON_ICO_FILE" ) + png_to_ico( "openemsh" INPUT ${ICON_PNG_FILES} REGISTER_TO "ICON_ICO_FILE" ) -add_custom_target( "icon" - DEPENDS - ${ICON_SVG_FILE} - ${ICON_PNG_FILES} - ${ICON_ICO_FILE} - ) + add_custom_target( "icon" + DEPENDS + ${ICON_SVG_FILE} + ${ICON_PNG_FILES} + ${ICON_ICO_FILE} + ) -add_custom_target( "icon_replace" - DEPENDS -# ${ICON_SVG_FILE} - ${ICON_PNG_FILES} - ${ICON_ICO_FILE} - COMMAND ${CMAKE_COMMAND} -E copy - ${ICON_PNG_FILES} - ${ICON_ICO_FILE} - "${CMAKE_CURRENT_SOURCE_DIR}/" - COMMENT "Copying icon png and ico files back to ${CMAKE_CURRENT_SOURCE_DIR}/" - ) + add_custom_target( "icon_replace" + DEPENDS + # ${ICON_SVG_FILE} + ${ICON_PNG_FILES} + ${ICON_ICO_FILE} + COMMAND ${CMAKE_COMMAND} -E copy + ${ICON_PNG_FILES} + ${ICON_ICO_FILE} + "${CMAKE_CURRENT_SOURCE_DIR}/" + COMMENT "Copying icon png and ico files back to ${CMAKE_CURRENT_SOURCE_DIR}/" + ) +endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9042e823..53f59fe7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -68,7 +68,7 @@ target_link_libraries( openemsh pugixml::shared ) -add_executable( openemsh_bin ) +add_executable( openemsh_bin WIN32 ) target_sources( openemsh_bin PRIVATE @@ -117,6 +117,7 @@ target_sources( openemsh_bin "${CMAKE_CURRENT_SOURCE_DIR}/ui/qt/style.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/ui/qt/resources.qrc" "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/openemsh.rc" ) target_compile_definitions( openemsh_bin @@ -126,6 +127,7 @@ target_compile_definitions( openemsh_bin OEMSH_FUNDING="${OEMSH_FUNDING}" OEMSH_BUGREPORT="${OEMSH_BUGREPORT}" OEMSH_OEMS_MESHING="${OEMSH_OEMS_MESHING}" + $<$:OEMSH_PORTABILITY_TWEAKS> # OEMSH_NODEGRAPH_DEBUG ) @@ -167,11 +169,18 @@ install( set_target_properties( openemsh_bin PROPERTIES + OUTPUT_NAME "openemsh" + POSITION_INDEPENDENT_CODE ON AUTOMOC ON AUTORCC ON AUTOUIC ON ) +install( + TARGETS openemsh_bin openemsh + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + ) + if( CMakeUtils_FOUND ) file( GLOB_RECURSE OPENEMSH_HEADERS "*.hpp" ) diff --git a/src/infra/parsers/parser_from_csx.cpp b/src/infra/parsers/parser_from_csx.cpp index 09d98cb1..be808ac5 100644 --- a/src/infra/parsers/parser_from_csx.cpp +++ b/src/infra/parsers/parser_from_csx.cpp @@ -294,7 +294,7 @@ ParserFromCsx::~ParserFromCsx() = default; //****************************************************************************** void ParserFromCsx::parse() { pugi::xml_document doc; - pugi::xml_parse_result res = doc.load_file(input.c_str()); + pugi::xml_parse_result res = doc.load_file(input.native().c_str()); if(res.status != pugi::status_ok) { cerr << res.description() << endl; diff --git a/src/infra/serializers/serializer_to_csx.cpp b/src/infra/serializers/serializer_to_csx.cpp index 2c006111..69e18b7f 100644 --- a/src/infra/serializers/serializer_to_csx.cpp +++ b/src/infra/serializers/serializer_to_csx.cpp @@ -57,7 +57,7 @@ SerializerToCsx::SerializerToCsx(filesystem::path const& input, filesystem::path //****************************************************************************** void SerializerToCsx::visit(Board& board) { pugi::xml_document doc; - pugi::xml_parse_result const res = doc.load_file(input.c_str()); + pugi::xml_parse_result const res = doc.load_file(input.native().c_str()); if(res.status != pugi::status_ok) { cerr << res.description() << endl; @@ -91,5 +91,5 @@ void SerializerToCsx::visit(Board& board) { add_meshlines_to_xml_doc(Z); cerr << "output: " << output << endl; - doc.save_file(output.c_str()); + doc.save_file(output.native().c_str()); } diff --git a/src/main.cpp b/src/main.cpp index dfe311d6..9ce8f1d5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -22,6 +22,11 @@ int main(int argc, char* argv[]) { oemsh.write(); } else { QApplication a(argc, argv); + +#ifdef OEMSH_PORTABILITY_TWEAKS + a.setAttribute(Qt::AA_DontUseNativeDialogs); +#endif // OEMSH_PORTABILITY_TWEAKS + // Avoid a stold() bug introduced by QApplication() performing setlocale(LC_ALL, "") setlocale(LC_NUMERIC, "C"); ui::qt::MainWindow w(oemsh); diff --git a/src/openemsh.rc b/src/openemsh.rc new file mode 100644 index 00000000..d2799bee --- /dev/null +++ b/src/openemsh.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON "../icon/openemsh.ico" diff --git a/src/ui/cli.cpp b/src/ui/cli.cpp index 7b3b893c..2b4282a6 100644 --- a/src/ui/cli.cpp +++ b/src/ui/cli.cpp @@ -4,7 +4,6 @@ /// @author Thomas Lepoix ///***************************************************************************** -#include //#include //#include //#include @@ -19,6 +18,10 @@ #include "cli.hpp" +// As of 2.4.0, including this before "cli.hpp" seems to do some nasty side +// effects with "relation.hpp" "IN" and "OUT" enumerators. (MinGW) +#include + // TODO CLI --board // TODO CLI --structure -zx -yz -xy @@ -105,8 +108,15 @@ app::OpenEMSH::Params cli(int const argc, char* argv[]) { app::OpenEMSH::Params params; vector> domain_overrides; + CLI::App app("OpenEMSH mesher"); + +#ifdef _WIN32 + argv = app.ensure_utf8(argv); +#endif // _WIN32 + + app.name(argv[0]); + // auto fmt = make_shared(); - CLI::App app("OpenEMSH mesher", argv[0]); // app.formatter(fmt); app.set_help_flag("-h,--help", "Display help and exit."); diff --git a/src/ui/qt/main_window.ui b/src/ui/qt/main_window.ui index 29163c5e..fb0e9320 100644 --- a/src/ui/qt/main_window.ui +++ b/src/ui/qt/main_window.ui @@ -622,6 +622,7 @@ + Qt::TopToolBarArea @@ -647,6 +648,7 @@ + About @@ -686,7 +688,7 @@ - 🗋 + Open Open CSX file @@ -697,7 +699,7 @@ - 🗎 + Save Save mesh overwriting input CSX file @@ -708,7 +710,7 @@ - 🗎 + Save as... Save mesh as... @@ -719,7 +721,7 @@ - 🖉 + Edit Edit parameters @@ -730,7 +732,7 @@ - + Next Run the next meshing step @@ -741,7 +743,7 @@ - + Prev Go back to previous meshing step @@ -752,7 +754,7 @@ - + Undo Undo @@ -763,7 +765,7 @@ - + Redo Redo diff --git a/src/ui/qt/processing_view/processing_polygon.cpp b/src/ui/qt/processing_view/processing_polygon.cpp index e2f0b933..b5644d79 100644 --- a/src/ui/qt/processing_view/processing_polygon.cpp +++ b/src/ui/qt/processing_view/processing_polygon.cpp @@ -49,7 +49,7 @@ ProcessingPolygon::ProcessingPolygon(domain::Polygon const* polygon, QGraphicsIt setData(DataKeys::TYPE, "Polygon"); setData(DataKeys::ID, (qulonglong) polygon->id); - setData(DataKeys::NAME, polygon->name.c_str()); + setData(DataKeys::NAME, QString::fromStdString(polygon->name)); setData(DataKeys::ENTITY, DataKeys::set_entity(polygon)); retrieve_highlightable_children(); } diff --git a/src/ui/qt/structure_view/structure_conflict_colinear_edges.cpp b/src/ui/qt/structure_view/structure_conflict_colinear_edges.cpp index cf6bc94e..fda99185 100644 --- a/src/ui/qt/structure_view/structure_conflict_colinear_edges.cpp +++ b/src/ui/qt/structure_view/structure_conflict_colinear_edges.cpp @@ -48,7 +48,7 @@ StructureConflictColinearEdges::StructureConflictColinearEdges(domain::ViewAxis setData(DataKeys::TYPE, "ConflictColinearEdges"); setData(DataKeys::ID, (qulonglong) conflict->id); setData(DataKeys::ENTITY, DataKeys::set_entity(conflict)); -// setData(DataKeys::NAME, conflict->name.c_str()); +// setData(DataKeys::NAME, QString::fromStdString(conflict->name)); } //****************************************************************************** diff --git a/src/ui/qt/structure_view/structure_conflict_too_close_meshline_policies.cpp b/src/ui/qt/structure_view/structure_conflict_too_close_meshline_policies.cpp index 194d9f04..ee0ffeb2 100644 --- a/src/ui/qt/structure_view/structure_conflict_too_close_meshline_policies.cpp +++ b/src/ui/qt/structure_view/structure_conflict_too_close_meshline_policies.cpp @@ -51,7 +51,7 @@ StructureConflictTooCloseMeshlinePolicies::StructureConflictTooCloseMeshlinePoli setData(DataKeys::TYPE, "ConflictTooCloseMeshlinePolicies"); setData(DataKeys::ID, (qulonglong) conflict->id); setData(DataKeys::ENTITY, DataKeys::set_entity(conflict)); -// setData(DataKeys::NAME, conflict->name.c_str()); +// setData(DataKeys::NAME, QString::fromStdString(conflict->name)); } //****************************************************************************** diff --git a/src/ui/qt/structure_view/structure_interval.cpp b/src/ui/qt/structure_view/structure_interval.cpp index c9356a61..65c269c1 100644 --- a/src/ui/qt/structure_view/structure_interval.cpp +++ b/src/ui/qt/structure_view/structure_interval.cpp @@ -54,7 +54,7 @@ StructureInterval::StructureInterval(domain::ViewAxis axis, domain::Interval con setData(DataKeys::TYPE, "Interval"); setData(DataKeys::ID, (qulonglong) interval->id); setData(DataKeys::ENTITY, DataKeys::set_entity(interval)); -// setData(DataKeys::NAME, interval->name.c_str()); +// setData(DataKeys::NAME, QString::fromStdString(interval->name)); } //****************************************************************************** diff --git a/src/ui/qt/structure_view/structure_meshline.cpp b/src/ui/qt/structure_view/structure_meshline.cpp index 93cb9fa6..77503bc5 100644 --- a/src/ui/qt/structure_view/structure_meshline.cpp +++ b/src/ui/qt/structure_view/structure_meshline.cpp @@ -47,7 +47,7 @@ StructureMeshline::StructureMeshline(domain::ViewAxis axis, domain::Meshline con setData(DataKeys::TYPE, "Meshline"); setData(DataKeys::ID, (qulonglong) meshline->id); setData(DataKeys::ENTITY, DataKeys::set_entity(meshline)); -// setData(DataKeys::NAME, meshline->name.c_str()); +// setData(DataKeys::NAME, QString::fromStdString(meshline->name)); } //****************************************************************************** diff --git a/src/ui/qt/structure_view/structure_meshline_policy.cpp b/src/ui/qt/structure_view/structure_meshline_policy.cpp index 72875f16..8189485a 100644 --- a/src/ui/qt/structure_view/structure_meshline_policy.cpp +++ b/src/ui/qt/structure_view/structure_meshline_policy.cpp @@ -96,7 +96,7 @@ StructureMeshlinePolicy::StructureMeshlinePolicy(domain::ViewAxis axis, domain:: setData(DataKeys::TYPE, "MeshlinePolicy"); setData(DataKeys::ID, (qulonglong) meshline_policy->id); setData(DataKeys::ENTITY, DataKeys::set_entity(meshline_policy)); -// setData(DataKeys::NAME, meshline_policy->name.c_str()); +// setData(DataKeys::NAME, QString::fromStdString(meshline_policy->name)); } //****************************************************************************** diff --git a/src/ui/qt/structure_view/structure_polygon.cpp b/src/ui/qt/structure_view/structure_polygon.cpp index 0e56044e..3216edbe 100644 --- a/src/ui/qt/structure_view/structure_polygon.cpp +++ b/src/ui/qt/structure_view/structure_polygon.cpp @@ -39,7 +39,7 @@ StructurePolygon::StructurePolygon(domain::Polygon const* polygon, QGraphicsItem setData(DataKeys::TYPE, "Polygon"); setData(DataKeys::ID, (qulonglong) polygon->id); setData(DataKeys::ENTITY, DataKeys::set_entity(polygon)); - setData(DataKeys::NAME, polygon->name.c_str()); + setData(DataKeys::NAME, QString::fromStdString(polygon->name)); } //****************************************************************************** diff --git "a/test/\316\265\316\273\316\273\316\267\316\275\316\271\316\272\316\254\347\213\227.csx" "b/test/\316\265\316\273\316\273\316\267\316\275\316\271\316\272\316\254\347\213\227.csx" new file mode 100644 index 00000000..f1dea2b4 --- /dev/null +++ "b/test/\316\265\316\273\316\273\316\267\316\275\316\271\316\272\316\254\347\213\227.csx" @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +