From fe12cdb1d0321f2b74e6252e19327397d7874c79 Mon Sep 17 00:00:00 2001 From: Thomas Kroes Date: Mon, 8 Apr 2024 12:10:35 +0200 Subject: [PATCH 01/17] Update build.yml Update build matrix --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b0f77cc..ecce826 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,23 +34,23 @@ jobs: build-runtime: MD build-config: Release - - name: Linux_gcc10 + - name: Linux_gcc11 os: ubuntu-22.04 build-cc: gcc build-cxx: g++ build-compiler: gcc - build-cversion: 10 + build-cversion: 11 build-config: Release build-os: Linux build-libcxx: libstdc++ - - name: Macos_xcode12.4 - os: macos-11 + - name: Macos_xcode13.4 + os: macos-12 build-compiler: apple-clang - build-cversion: "12.0" + build-cversion: 13 build-config: Release build-os: Macos - build-xcode-version: 12.4 + build-xcode-version: 13.4 build-libcxx: libc++ steps: From 0f4d25f266d2f3a258db1ffe07a921f308f672b9 Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Mon, 8 Apr 2024 13:11:26 +0200 Subject: [PATCH 02/17] Create LICENSE (#5) * Create LICENSE * Update build.yml --- .github/workflows/build.yml | 2 +- LICENSE | 167 ++++++++++++++++++++++++++++++++++++ 2 files changed, 168 insertions(+), 1 deletion(-) create mode 100644 LICENSE diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ecce826..39ce0d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,7 +77,7 @@ jobs: - name: Setup python version uses: actions/setup-python@v1 with: - python-version: "3.7" + python-version: "3.11" # windows-2016 need the SSHAgentFeature added - name: Start ssh key agent diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4b7725f --- /dev/null +++ b/LICENSE @@ -0,0 +1,167 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. + + END OF TERMS AND CONDITIONS From c1d056f784e74913afea4343a1c818219dde1486 Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Wed, 10 Apr 2024 15:31:27 +0200 Subject: [PATCH 03/17] Add readme and do not recompute when selecting multiple (#6) * Same meta data as core and examples * Fix: Performing a transformation on multiple datasets at once executed the transformation multiple times * Update README.md --- README.md | 18 ++++++- src/PointDataConversionPlugin.cpp | 80 +++++++++++++++---------------- src/PointDataConversionPlugin.h | 2 +- 3 files changed, 57 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 6b7769e..868f12f 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,16 @@ -# Point data conversion plugin -HDPS plugin for point data conversion +# Point data conversion plugin ![Build Status](https://github.com/ManiVaultStudio/PointDataConversionPlugin/actions/workflows/build.yml/badge.svg?branch=master) + +Point data conversion plugin for the [ManiVault](https://github.com/ManiVaultStudio/core) visual analytics framework. + +```bash +git clone git@github.com:ManiVaultStudio/PointDataConversionPlugin.git +``` + +Applies an element-wise transformation to a selected dataset in-place. + +Implemented transformations: +- [Inverse hyperbolic sine](https://en.wikipedia.org/wiki/Inverse_hyperbolic_functions) (`asinh`) +- [Binary logarithm](https://en.wikipedia.org/wiki/Binary_logarithm) (`log2`) + +## How to use +- Right-click on a point dataset and select `Transform` -> `Conversion` and chose the transformation function diff --git a/src/PointDataConversionPlugin.cpp b/src/PointDataConversionPlugin.cpp index 32c3f59..bcf79e8 100644 --- a/src/PointDataConversionPlugin.cpp +++ b/src/PointDataConversionPlugin.cpp @@ -8,7 +8,7 @@ #include -Q_PLUGIN_METADATA(IID "nl.BioVault.PointDataConversionPlugin") +Q_PLUGIN_METADATA(IID "studio.manivault.PointDataConversionPlugin") using namespace mv; @@ -25,55 +25,55 @@ PointDataConversionPlugin::PointDataConversionPlugin(const PluginFactory* factor void PointDataConversionPlugin::transform() { - for (auto inputDataset : getInputDatasets()) { - auto points = Dataset(inputDataset); + auto points = getInputDataset(); - if (!points.isValid()) - continue; + if (!points.isValid()) + return; - QApplication::processEvents(); - - auto& task = points->getTask(); + QApplication::processEvents(); - task.setName("Converting"); - task.setRunning(); - task.setProgressDescription(QString("%1 conversion").arg(getTypeName(_type))); + auto& task = points->getTask(); - points->visitData([this, &points, &task](auto pointData) { - std::uint32_t noPointsProcessed = 0; + task.setName("Converting"); + task.setRunning(); + task.setProgressDescription(QString("%1 conversion").arg(getTypeName(_type))); + + qDebug() << "PointDataConversionPlugin:: Apply " << getTypeName(_type) << " conversion to " << points->getGuiName(); + + points->visitData([this, &points, &task](auto pointData) { + std::uint32_t noPointsProcessed = 0; - for (auto point : pointData) { - for (std::int32_t dimensionIndex = 0; dimensionIndex < points->getNumDimensions(); dimensionIndex++) { - switch (_type) - { - case PointDataConversionPlugin::Type::Log2: - point[dimensionIndex] = log2(point[dimensionIndex] + 1); - break; + for (auto point : pointData) { + for (std::int32_t dimensionIndex = 0; dimensionIndex < points->getNumDimensions(); dimensionIndex++) { + switch (_type) + { + case PointDataConversionPlugin::Type::Log2: + point[dimensionIndex] = std::log2(point[dimensionIndex] + 1); + break; - case PointDataConversionPlugin::Type::ArcSin: - point[dimensionIndex] = asinh(point[dimensionIndex] / 5.0f); - break; + case PointDataConversionPlugin::Type::ArcSin: + point[dimensionIndex] = std::asinh(point[dimensionIndex] / 5.0f); + break; - default: - break; - } + default: + break; } + } - ++noPointsProcessed; + ++noPointsProcessed; - if (noPointsProcessed % 1000 == 0) { - task.setProgress(static_cast(noPointsProcessed) / static_cast(points->getNumPoints())); + if (noPointsProcessed % 1000 == 0) { + task.setProgress(static_cast(noPointsProcessed) / static_cast(points->getNumPoints())); - QApplication::processEvents(); - } + QApplication::processEvents(); } - }); + } + }); - task.setProgress(1.0f); - task.setFinished(); + task.setProgress(1.0f); + task.setFinished(); - events().notifyDatasetDataChanged(points); - } + events().notifyDatasetDataChanged(points); } PointDataConversionPlugin::Type PointDataConversionPlugin::getType() const @@ -116,10 +116,10 @@ PluginTriggerActions PointDataConversionPluginFactory::getPluginTriggerActions(c const auto typeName = PointDataConversionPlugin::getTypeName(type); auto pluginTriggerAction = new PluginTriggerAction(const_cast(this), this, QString("Conversion/%1").arg(typeName), QString("Perform %1 data conversion").arg(typeName), getIcon(), [this, datasets, type](PluginTriggerAction& pluginTriggerAction) -> void { - for (auto dataset : datasets) { + for (const auto& dataset : datasets) { auto pluginInstance = dynamic_cast(plugins().requestPlugin(getKind())); - pluginInstance->setInputDatasets(datasets); + pluginInstance->setInputDataset(dataset); pluginInstance->setType(type); pluginInstance->transform(); } @@ -145,10 +145,10 @@ PluginTriggerActions PointDataConversionPluginFactory::getPluginTriggerActions(c const auto typeName = PointDataConversionPlugin::getTypeName(type); auto pluginTriggerAction = new PluginTriggerAction(const_cast(this), this, QString("Conversion/%1").arg(typeName), QString("Perform %1 data conversion").arg(typeName), getIcon(), [this, type](PluginTriggerAction& pluginTriggerAction) -> void { - for (auto dataset : Datasets()) { + for (const auto& dataset : Datasets()) { auto pluginInstance = dynamic_cast(plugins().requestPlugin(getKind())); - pluginInstance->setInputDatasets(Datasets()); + pluginInstance->setInputDataset(dataset); pluginInstance->setType(type); pluginInstance->transform(); } diff --git a/src/PointDataConversionPlugin.h b/src/PointDataConversionPlugin.h index 2a39d89..34ee71b 100644 --- a/src/PointDataConversionPlugin.h +++ b/src/PointDataConversionPlugin.h @@ -79,7 +79,7 @@ class PointDataConversionPluginFactory : public TransformationPluginFactory { Q_INTERFACES(mv::plugin::TransformationPluginFactory mv::plugin::PluginFactory) Q_OBJECT - Q_PLUGIN_METADATA(IID "nl.BioVault.PointDataConversionPlugin" + Q_PLUGIN_METADATA(IID "studio.manivault.PointDataConversionPlugin" FILE "PointDataConversionPlugin.json") public: From 8b548854358a2b795b95fd23163a65e6a13400b4 Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Wed, 10 Apr 2024 15:35:16 +0200 Subject: [PATCH 04/17] Update README.md (#7) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 868f12f..93bd74b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Point data conversion plugin ![Build Status](https://github.com/ManiVaultStudio/PointDataConversionPlugin/actions/workflows/build.yml/badge.svg?branch=master) +# Point data conversion plugin ![Build Status](https://github.com/ManiVaultStudio/PointDataConversionPlugin/actions/workflows/build.yml/badge.svg?branch=main) Point data conversion plugin for the [ManiVault](https://github.com/ManiVaultStudio/core) visual analytics framework. From ad5e02afe3ded92a7c8b7d23bcf6934a7448b9b6 Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Thu, 11 Apr 2024 15:02:04 +0200 Subject: [PATCH 05/17] Fix pluginTriggerAction trigger (#8) * Fix missing include * Use datasets --- .gitignore | 1 + src/PointDataConversionPlugin.cpp | 2 +- src/PointDataConversionPlugin.h | 6 ++---- 3 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..378eac2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build diff --git a/src/PointDataConversionPlugin.cpp b/src/PointDataConversionPlugin.cpp index bcf79e8..0316727 100644 --- a/src/PointDataConversionPlugin.cpp +++ b/src/PointDataConversionPlugin.cpp @@ -145,7 +145,7 @@ PluginTriggerActions PointDataConversionPluginFactory::getPluginTriggerActions(c const auto typeName = PointDataConversionPlugin::getTypeName(type); auto pluginTriggerAction = new PluginTriggerAction(const_cast(this), this, QString("Conversion/%1").arg(typeName), QString("Perform %1 data conversion").arg(typeName), getIcon(), [this, type](PluginTriggerAction& pluginTriggerAction) -> void { - for (const auto& dataset : Datasets()) { + for (const auto& dataset : pluginTriggerAction.getDatasets()) { auto pluginInstance = dynamic_cast(plugins().requestPlugin(getKind())); pluginInstance->setInputDataset(dataset); diff --git a/src/PointDataConversionPlugin.h b/src/PointDataConversionPlugin.h index 34ee71b..6ab3ee1 100644 --- a/src/PointDataConversionPlugin.h +++ b/src/PointDataConversionPlugin.h @@ -1,15 +1,13 @@ #pragma once -#include - #include +#include +#include using namespace mv::plugin; using namespace mv::gui; using namespace mv::util; -class QLabel; - /** * Point data conversion plugin class * From 5001ee3f66a118cffe026bc8f75665d88a1f246b Mon Sep 17 00:00:00 2001 From: Baldur van Lew Date: Fri, 24 May 2024 11:04:26 +0200 Subject: [PATCH 06/17] [skip ci] Add XCode 14 to the build matrix --- .github/workflows/build.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 39ce0d5..f1484bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,6 +53,15 @@ jobs: build-xcode-version: 13.4 build-libcxx: libc++ + - name: Macos_xcode14.3 + os: macos-13 + build-compiler: apple-clang + build-cversion: 14 + build-config: Release + build-os: Macos + build-xcode-version: 14.3 + build-libcxx: libc++ + steps: - name: Checkout the source if: github.event_name != 'pull_request' From c21b1f339f9604c81f2b668bd58314ebb0a8e497 Mon Sep 17 00:00:00 2001 From: Baldur van Lew Date: Fri, 24 May 2024 11:05:12 +0200 Subject: [PATCH 07/17] Add zlib 1.3 compatibility for XCode 14 --- conanfile.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 68c03ca..d36d9f2 100644 --- a/conanfile.py +++ b/conanfile.py @@ -6,7 +6,14 @@ import pathlib import subprocess from rules_support import PluginBranchInfo - +import re + +def compatibility(os, compiler, compiler_version): + # On macos fallback to zlib apple-clang 13 + if os == "Macos" and compiler == "apple-clang" and bool(re.match("14.*", compiler_version)): + print("Compatibility match") + return ["zlib/1.3:compiler.version=13"] + return None class PointDataConversionPluginConan(ConanFile): """Class to package the PointDataConversionPlugin using conan From eb466eac5c682054b486db87c614c655890e4ad9 Mon Sep 17 00:00:00 2001 From: Baldur van Lew Date: Tue, 28 May 2024 11:00:41 +0200 Subject: [PATCH 08/17] Use centrally defined build matrix --- .github/workflows/build.yml | 46 +++++++++---------------------------- 1 file changed, 11 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f1484bc..f2b6000 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,8 +17,18 @@ env: # for matrix check https://docs.github.com/en/actions/reference/specifications-for-github-hosted-runners jobs: + prepare_matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.matrix_setup.outputs.matrix }} + steps: + - name: Get matrix from file + id: matrix_setup + uses: ManiVaultStudio/github-actions/matrix_setup@main + cross-platform-build: name: Cross platform build + needs: prepare_matrix # The CMake configure and build commands are platform agnostic and should work equally # well on Windows or Mac. You can convert this to a matrix build if you need # cross-platform coverage. @@ -26,41 +36,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - include: - - name: Windows-msvc2019 - os: windows-2019 - compiler: msvc-2019 - build-cversion: 16 - build-runtime: MD - build-config: Release - - - name: Linux_gcc11 - os: ubuntu-22.04 - build-cc: gcc - build-cxx: g++ - build-compiler: gcc - build-cversion: 11 - build-config: Release - build-os: Linux - build-libcxx: libstdc++ - - - name: Macos_xcode13.4 - os: macos-12 - build-compiler: apple-clang - build-cversion: 13 - build-config: Release - build-os: Macos - build-xcode-version: 13.4 - build-libcxx: libc++ - - - name: Macos_xcode14.3 - os: macos-13 - build-compiler: apple-clang - build-cversion: 14 - build-config: Release - build-os: Macos - build-xcode-version: 14.3 - build-libcxx: libc++ + include: ${{ fromJson(needs.prepare_matrix.outputs.matrix) }} steps: - name: Checkout the source From 4ca4cf2935a785b9623a0e0b091dcbb5cb42b406 Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Fri, 9 Aug 2024 12:49:31 +0200 Subject: [PATCH 09/17] Use find_package for ManiVault (#11) --- CMakeLists.txt | 58 +++++++++++++++++++++++++++++++++----------------- conanfile.py | 6 +++++- 2 files changed, 43 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4f9ac9..38407a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,15 @@ cmake_minimum_required(VERSION 3.17) +# ----------------------------------------------------------------------------- +# PointDataConversion Plugin +# ----------------------------------------------------------------------------- set(PROJECT "PointDataConversionPlugin") PROJECT(${PROJECT}) +# ----------------------------------------------------------------------------- +# CMake Options +# ----------------------------------------------------------------------------- set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -15,8 +21,16 @@ if(MSVC) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD") endif(MSVC) +# ----------------------------------------------------------------------------- +# Dependencies +# ----------------------------------------------------------------------------- find_package(Qt6 COMPONENTS Widgets WebEngineWidgets REQUIRED) +find_package(ManiVault COMPONENTS Core PointData CONFIG) + +# ----------------------------------------------------------------------------- +# Source files +# ----------------------------------------------------------------------------- set(SOURCES src/PointDataConversionPlugin.h src/PointDataConversionPlugin.cpp @@ -25,32 +39,33 @@ set(SOURCES source_group(Plugin FILES ${SOURCES}) -# Check if the directory to the ManiVault installation has been provided -if(NOT DEFINED MV_INSTALL_DIR) - set(MV_INSTALL_DIR "" CACHE PATH "Directory where ManiVault is installed") - message(FATAL_ERROR "Please set MV_INSTALL_DIR to the directory where ManiVault is installed") -endif() -file(TO_CMAKE_PATH ${MV_INSTALL_DIR} MV_INSTALL_DIR) - +# ----------------------------------------------------------------------------- +# CMake Target +# ----------------------------------------------------------------------------- add_library(${PROJECT} SHARED ${SOURCES}) -target_include_directories(${PROJECT} PRIVATE "${MV_INSTALL_DIR}/$/include/") +# ----------------------------------------------------------------------------- +# Target include directories +# ----------------------------------------------------------------------------- +target_include_directories(${PROJECT} PRIVATE "${ManiVault_INCLUDE_DIR}") +# ----------------------------------------------------------------------------- +# Target properties +# ----------------------------------------------------------------------------- target_compile_features(${PROJECT} PRIVATE cxx_std_17) +# ----------------------------------------------------------------------------- +# Target library linking +# ----------------------------------------------------------------------------- target_link_libraries(${PROJECT} PRIVATE Qt6::Widgets) target_link_libraries(${PROJECT} PRIVATE Qt6::WebEngineWidgets) -set(MV_LINK_PATH "${MV_INSTALL_DIR}/$/lib") -set(PLUGIN_LINK_PATH "${MV_INSTALL_DIR}/$/$,lib,Plugins>") -set(MV_LINK_SUFFIX $,${CMAKE_LINK_LIBRARY_SUFFIX},${CMAKE_SHARED_LIBRARY_SUFFIX}>) - -set(MV_LINK_LIBRARY "${MV_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}MV_Public${MV_LINK_SUFFIX}") -set(POINTDATA_LINK_LIBRARY "${PLUGIN_LINK_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}PointData${MV_LINK_SUFFIX}") - -target_link_libraries(${PROJECT} PRIVATE "${MV_LINK_LIBRARY}") -target_link_libraries(${PROJECT} PRIVATE "${POINTDATA_LINK_LIBRARY}") +target_link_libraries(${PROJECT} PRIVATE ManiVault::Core) +target_link_libraries(${PROJECT} PRIVATE ManiVault::PointData) +# ----------------------------------------------------------------------------- +# Target installation +# ----------------------------------------------------------------------------- install(TARGETS ${PROJECT} RUNTIME DESTINATION Plugins COMPONENT PLUGINS # Windows .dll LIBRARY DESTINATION Plugins COMPONENT PLUGINS # Linux/Mac .so @@ -60,12 +75,15 @@ add_custom_command(TARGET ${PROJECT} POST_BUILD COMMAND "${CMAKE_COMMAND}" --install ${CMAKE_CURRENT_BINARY_DIR} --config $ - --prefix ${MV_INSTALL_DIR}/$ + --prefix ${ManiVault_INSTALL_DIR}/$ --verbose ) +# ----------------------------------------------------------------------------- +# Misc +# ----------------------------------------------------------------------------- # Automatically set the debug environment (command + working directory) for MSVC if(MSVC) - set_property(TARGET ${PROJECT} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${MV_INSTALL_DIR}/debug,${MV_INSTALL_DIR}/release>) - set_property(TARGET ${PROJECT} PROPERTY VS_DEBUGGER_COMMAND $,"${MV_INSTALL_DIR}/debug/ManiVault Studio.exe","${MV_INSTALL_DIR}/release/ManiVault Studio.exe">) + set_property(TARGET ${PROJECT} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${ManiVault_INSTALL_DIR}/debug,${ManiVault_INSTALL_DIR}/release>) + set_property(TARGET ${PROJECT} PROPERTY VS_DEBUGGER_COMMAND $,"${ManiVault_INSTALL_DIR}/debug/ManiVault Studio.exe","${ManiVault_INSTALL_DIR}/release/ManiVault Studio.exe">) endif() diff --git a/conanfile.py b/conanfile.py index d36d9f2..9b9795b 100644 --- a/conanfile.py +++ b/conanfile.py @@ -107,7 +107,11 @@ def generate(self): self.install_dir = pathlib.Path(os.environ["MV_INSTALL_DIR"]).as_posix() # Give the installation directory to CMake tc.variables["MV_INSTALL_DIR"] = self.install_dir - + + # Find ManiVault with find_package + self.manivault_dir = self.install_dir + '/cmake/mv/' + tc.variables["ManiVault_DIR"] = self.manivault_dir + tc.generate() def _configure_cmake(self): From 624093518de859279cfb63e092193bde2aaa9dcb Mon Sep 17 00:00:00 2001 From: Thomas Kroes Date: Tue, 19 Nov 2024 11:18:11 +0100 Subject: [PATCH 10/17] Put in AnalysisPlugins project group --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 38407a3..d4148b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,6 +79,11 @@ add_custom_command(TARGET ${PROJECT} POST_BUILD --verbose ) +set_target_properties(${PROJECT} + PROPERTIES + FOLDER AnalysisPlugins +) + # ----------------------------------------------------------------------------- # Misc # ----------------------------------------------------------------------------- From 040208357aeb6099f77dbc037339dc13aa2eb881 Mon Sep 17 00:00:00 2001 From: Thomas Kroes Date: Mon, 25 Nov 2024 11:26:00 +0100 Subject: [PATCH 11/17] Put in TransformationPlugins project group --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4148b6..d59b9ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,7 +81,7 @@ add_custom_command(TARGET ${PROJECT} POST_BUILD set_target_properties(${PROJECT} PROPERTIES - FOLDER AnalysisPlugins + FOLDER TransformationPlugins ) # ----------------------------------------------------------------------------- From 9cec516eb6c5ac8b2526792f70a11d0173808201 Mon Sep 17 00:00:00 2001 From: Thomas Kroes Date: Mon, 25 Nov 2024 11:51:33 +0100 Subject: [PATCH 12/17] Housekeeping --- src/PointDataConversionPlugin.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/PointDataConversionPlugin.cpp b/src/PointDataConversionPlugin.cpp index 0316727..f9a145f 100644 --- a/src/PointDataConversionPlugin.cpp +++ b/src/PointDataConversionPlugin.cpp @@ -12,9 +12,9 @@ Q_PLUGIN_METADATA(IID "studio.manivault.PointDataConversionPlugin") using namespace mv; -const QMap PointDataConversionPlugin::types = QMap({ - { PointDataConversionPlugin::Type::Log2, "Log2" }, - { PointDataConversionPlugin::Type::ArcSin, "Arcsin" } +const QMap PointDataConversionPlugin::types = QMap({ + { Type::Log2, "Log2" }, + { Type::ArcSin, "Arcsin" } }); PointDataConversionPlugin::PointDataConversionPlugin(const PluginFactory* factory) : @@ -38,8 +38,6 @@ void PointDataConversionPlugin::transform() task.setRunning(); task.setProgressDescription(QString("%1 conversion").arg(getTypeName(_type))); - qDebug() << "PointDataConversionPlugin:: Apply " << getTypeName(_type) << " conversion to " << points->getGuiName(); - points->visitData([this, &points, &task](auto pointData) { std::uint32_t noPointsProcessed = 0; @@ -47,15 +45,12 @@ void PointDataConversionPlugin::transform() for (std::int32_t dimensionIndex = 0; dimensionIndex < points->getNumDimensions(); dimensionIndex++) { switch (_type) { - case PointDataConversionPlugin::Type::Log2: - point[dimensionIndex] = std::log2(point[dimensionIndex] + 1); - break; - - case PointDataConversionPlugin::Type::ArcSin: - point[dimensionIndex] = std::asinh(point[dimensionIndex] / 5.0f); + case Type::Log2: + point[dimensionIndex] = std::log2f(point[dimensionIndex] + 1.0f); break; - default: + case Type::ArcSin: + point[dimensionIndex] = std::asinhf(point[dimensionIndex] / 5.0f); break; } } @@ -186,9 +181,6 @@ WidgetAction* PointDataConversionPluginFactory::getConfigurationAction(const Poi case PointDataConversionPlugin::Type::ArcSin: return createGroupAction(_arcSinFactorAction); - - default: - break; } return nullptr; From a55e4b44f59d3147a6c0516e078f232ed105cf46 Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Tue, 4 Feb 2025 15:58:28 +0100 Subject: [PATCH 13/17] Update CI 02/2025 (#12) * Update conanfile.py * Update build.yml --- .github/workflows/build.yml | 23 +++-------- conanfile.py | 77 ++++++++++++++++--------------------- 2 files changed, 38 insertions(+), 62 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f2b6000..802f146 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,16 +4,10 @@ on: push: pull_request: workflow_dispatch: - inputs: - forceMacBuild: - description: 'If set true override the ENABLE_MACOS_BUILD to force a build' - type: boolean - default: false env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Release - MACENABLED: ${{ inputs.forceMacBuild }} # for matrix check https://docs.github.com/en/actions/reference/specifications-for-github-hosted-runners jobs: @@ -41,14 +35,14 @@ jobs: steps: - name: Checkout the source if: github.event_name != 'pull_request' - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - name: Checkout the source - pull request if: github.event_name == 'pull_request' - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 @@ -60,19 +54,12 @@ jobs: sudo xcode-select -switch /Applications/Xcode_${{matrix.build-xcode-version}}.app - name: Setup python version - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: "3.11" - # windows-2016 need the SSHAgentFeature added - name: Start ssh key agent - if: matrix.os == 'windows-2016' - run: | - choco install --no-progress -my openssh --params '"/SSHAgentFeature"' - refreshenv - - - name: Start ssh key agent - uses: webfactory/ssh-agent@v0.5.0 + uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.RULESSUPPORT_DEPLOY_KEY }} @@ -110,7 +97,7 @@ jobs: conan-cxx: g++-${{matrix.build-cversion}} - name: Mac build - if: startsWith(matrix.os, 'macos') && (env.MACENABLED == 'true' || vars.ENABLE_MACOS_BUILD == 'True') + if: startsWith(matrix.os, 'macos') uses: ManiVaultStudio/github-actions/conan_linuxmac_build@main with: conan-compiler: ${{matrix.build-compiler}} diff --git a/conanfile.py b/conanfile.py index 9b9795b..f20b984 100644 --- a/conanfile.py +++ b/conanfile.py @@ -6,28 +6,21 @@ import pathlib import subprocess from rules_support import PluginBranchInfo -import re -def compatibility(os, compiler, compiler_version): - # On macos fallback to zlib apple-clang 13 - if os == "Macos" and compiler == "apple-clang" and bool(re.match("14.*", compiler_version)): - print("Compatibility match") - return ["zlib/1.3:compiler.version=13"] - return None class PointDataConversionPluginConan(ConanFile): """Class to package the PointDataConversionPlugin using conan Packages both RELEASE and DEBUG. - Uses rules_support (github.com/hdps/rulessupport) to derive + Uses rules_support (github.com/ManiVaultStudio/rulessupport) to derive versioninfo based on the branch naming convention - as described in https://github.com/hdps/core/wiki/Branch-naming-rules + as described in https://github.com/ManiVaultStudio/core/wiki/Branch-naming-rules """ name = "PointDataConversionPlugin" description = "Convert point data" topics = ("hdps", "plugin", "data", "point data conversion") - url = "https://github.com/hdps/PointDataConversionPlugin" + url = "https://github.com/ManiVaultStudio/PointDataConversionPlugin" author = "B. van Lew b.van_lew@lumc.nl" # conan recipe author license = "MIT" # conan recipe license @@ -88,30 +81,32 @@ def generate(self): generator = "Xcode" if self.settings.os == "Linux": generator = "Ninja Multi-Config" - # Use the Qt provided .cmake files - qtpath = pathlib.Path(self.deps_cpp_info["qt"].rootpath) - qt_root = str(list(qtpath.glob("**/Qt6Config.cmake"))[0].parents[3].as_posix()) tc = CMakeToolchain(self, generator=generator) - if self.settings.os == "Windows" and self.options.shared: - tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True - if self.settings.os == "Linux" or self.settings.os == "Macos": - tc.variables["CMAKE_CXX_STANDARD_REQUIRED"] = "ON" - tc.variables["CMAKE_PREFIX_PATH"] = qt_root - - # Set the installation directory for ManiVault based on the MV_INSTALL_DIR environment variable - # or if none is specified, set it to the build/install dir. - if not os.environ.get("MV_INSTALL_DIR", None): - os.environ["MV_INSTALL_DIR"] = os.path.join(self.build_folder, "install") - print("MV_INSTALL_DIR: ", os.environ["MV_INSTALL_DIR"]) - self.install_dir = pathlib.Path(os.environ["MV_INSTALL_DIR"]).as_posix() - # Give the installation directory to CMake - tc.variables["MV_INSTALL_DIR"] = self.install_dir - - # Find ManiVault with find_package - self.manivault_dir = self.install_dir + '/cmake/mv/' - tc.variables["ManiVault_DIR"] = self.manivault_dir + tc.variables["CMAKE_CXX_STANDARD_REQUIRED"] = "ON" + + # Use the Qt provided .cmake files + qt_path = pathlib.Path(self.deps_cpp_info["qt"].rootpath) + qt_cfg = list(qt_path.glob("**/Qt6Config.cmake"))[0] + qt_dir = qt_cfg.parents[0].as_posix() + qt_root = qt_cfg.parents[3].as_posix() + + # for Qt >= 6.4.2 + #tc.variables["Qt6_DIR"] = qt_dir + + # for Qt < 6.4.2 + tc.variables["Qt6_ROOT"] = qt_root + + # Use the ManiVault .cmake file to find ManiVault with find_package + mv_core_root = self.deps_cpp_info["hdps-core"].rootpath + manivault_dir = pathlib.Path(mv_core_root, "cmake", "mv").as_posix() + print("ManiVault_DIR: ", manivault_dir) + tc.variables["ManiVault_DIR"] = manivault_dir + + # Set some build options + tc.variables["MV_UNITY_BUILD"] = "ON" + tc.generate() def _configure_cmake(self): @@ -121,22 +116,16 @@ def _configure_cmake(self): return cmake def build(self): - print("Build OS is : ", self.settings.os) - - hdps_pkg_root = self.deps_cpp_info["hdps-core"].rootpath - print("Install dir type: ", self.install_dir) - shutil.copytree(hdps_pkg_root, self.install_dir) + print("Build OS is: ", self.settings.os) cmake = self._configure_cmake() cmake.build(build_type="Debug") - cmake.install(build_type="Debug") - - # cmake_release = self._configure_cmake() cmake.build(build_type="Release") - cmake.install(build_type="Release") def package(self): - package_dir = os.path.join(self.build_folder, "package") + package_dir = pathlib.Path(self.build_folder, "package") + debug_dir = package_dir / "Debug" + release_dir = package_dir / "Release" print("Packaging install dir: ", package_dir) subprocess.run( [ @@ -146,7 +135,7 @@ def package(self): "--config", "Debug", "--prefix", - os.path.join(package_dir, "Debug"), + debug_dir, ] ) subprocess.run( @@ -157,11 +146,11 @@ def package(self): "--config", "Release", "--prefix", - os.path.join(package_dir, "Release"), + release_dir, ] ) self.copy(pattern="*", src=package_dir) - + def package_info(self): self.cpp_info.debug.libdirs = ["Debug/lib"] self.cpp_info.debug.bindirs = ["Debug/Plugins", "Debug"] From 72516b79314b24d7ce00203e6b8c5315e54d2b8e Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Fri, 28 Feb 2025 11:00:33 +0100 Subject: [PATCH 14/17] Update to Qt 6.8 (#14) * Add build arch * Update cmake * Update CI (relwithdebinfo) --- .github/workflows/build.yml | 2 ++ CMakeLists.txt | 16 ++++++++-------- conanfile.py | 27 +++++++++++---------------- 3 files changed, 21 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 802f146..4b51097 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -90,6 +90,7 @@ jobs: conan-libcxx-version: ${{matrix.build-libcxx}} conan-build-type: ${{matrix.build-config}} conan-build-os: ${{matrix.build-os}} + build-arch: ${{matrix.build-arch}} conan-user: ${{secrets.LKEB_UPLOAD_USER}} conan-password: ${{secrets.LKEB_UPLOAD_USER_PASSWORD}} conan-pem: ${{secrets.LKEB_UPLOAD_CERT_CHAIN}} @@ -105,6 +106,7 @@ jobs: conan-libcxx-version: ${{matrix.build-libcxx}} conan-build-type: ${{matrix.build-config}} conan-build-os: ${{matrix.build-os}} + build-arch: ${{matrix.build-arch}} conan-user: ${{secrets.LKEB_UPLOAD_USER}} conan-password: ${{secrets.LKEB_UPLOAD_USER_PASSWORD}} conan-pem: ${{secrets.LKEB_UPLOAD_CERT_CHAIN}} diff --git a/CMakeLists.txt b/CMakeLists.txt index d59b9ee..74c7139 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.17) +cmake_minimum_required(VERSION 3.22) # ----------------------------------------------------------------------------- # PointDataConversion Plugin @@ -16,9 +16,9 @@ set(CMAKE_AUTOMOC ON) if(MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DWIN32 /EHsc /MP /permissive- /Zc:__cplusplus") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD") endif(MSVC) # ----------------------------------------------------------------------------- @@ -26,7 +26,7 @@ endif(MSVC) # ----------------------------------------------------------------------------- find_package(Qt6 COMPONENTS Widgets WebEngineWidgets REQUIRED) -find_package(ManiVault COMPONENTS Core PointData CONFIG) +find_package(ManiVault COMPONENTS Core PointData CONFIG QUIET) # ----------------------------------------------------------------------------- # Source files @@ -52,7 +52,7 @@ target_include_directories(${PROJECT} PRIVATE "${ManiVault_INCLUDE_DIR}") # ----------------------------------------------------------------------------- # Target properties # ----------------------------------------------------------------------------- -target_compile_features(${PROJECT} PRIVATE cxx_std_17) +target_compile_features(${PROJECT} PRIVATE cxx_std_20) # ----------------------------------------------------------------------------- # Target library linking @@ -89,6 +89,6 @@ set_target_properties(${PROJECT} # ----------------------------------------------------------------------------- # Automatically set the debug environment (command + working directory) for MSVC if(MSVC) - set_property(TARGET ${PROJECT} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${ManiVault_INSTALL_DIR}/debug,${ManiVault_INSTALL_DIR}/release>) - set_property(TARGET ${PROJECT} PROPERTY VS_DEBUGGER_COMMAND $,"${ManiVault_INSTALL_DIR}/debug/ManiVault Studio.exe","${ManiVault_INSTALL_DIR}/release/ManiVault Studio.exe">) + set_property(TARGET ${PROJECT} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${ManiVault_INSTALL_DIR}/Debug,$,${ManiVault_INSTALL_DIR}/RelWithDebInfo,${ManiVault_INSTALL_DIR}/Release>>) + set_property(TARGET ${PROJECT} PROPERTY VS_DEBUGGER_COMMAND $,"${ManiVault_INSTALL_DIR}/Debug/ManiVault Studio.exe",$,"${ManiVault_INSTALL_DIR}/RelWithDebInfo/ManiVault Studio.exe","${ManiVault_INSTALL_DIR}/Release/ManiVault Studio.exe">>) endif() diff --git a/conanfile.py b/conanfile.py index f20b984..850b06f 100644 --- a/conanfile.py +++ b/conanfile.py @@ -11,7 +11,7 @@ class PointDataConversionPluginConan(ConanFile): """Class to package the PointDataConversionPlugin using conan - Packages both RELEASE and DEBUG. + Packages both RELEASE and RELWITHDEBINFO. Uses rules_support (github.com/ManiVaultStudio/rulessupport) to derive versioninfo based on the branch naming convention as described in https://github.com/ManiVaultStudio/core/wiki/Branch-naming-rules @@ -90,13 +90,8 @@ def generate(self): qt_path = pathlib.Path(self.deps_cpp_info["qt"].rootpath) qt_cfg = list(qt_path.glob("**/Qt6Config.cmake"))[0] qt_dir = qt_cfg.parents[0].as_posix() - qt_root = qt_cfg.parents[3].as_posix() - # for Qt >= 6.4.2 - #tc.variables["Qt6_DIR"] = qt_dir - - # for Qt < 6.4.2 - tc.variables["Qt6_ROOT"] = qt_root + tc.variables["Qt6_DIR"] = qt_dir # Use the ManiVault .cmake file to find ManiVault with find_package mv_core_root = self.deps_cpp_info["hdps-core"].rootpath @@ -119,12 +114,12 @@ def build(self): print("Build OS is: ", self.settings.os) cmake = self._configure_cmake() - cmake.build(build_type="Debug") + cmake.build(build_type="RelWithDebInfo") cmake.build(build_type="Release") def package(self): package_dir = pathlib.Path(self.build_folder, "package") - debug_dir = package_dir / "Debug" + relWithDebInfo_dir = package_dir / "RelWithDebInfo" release_dir = package_dir / "Release" print("Packaging install dir: ", package_dir) subprocess.run( @@ -133,9 +128,9 @@ def package(self): "--install", self.build_folder, "--config", - "Debug", + "RelWithDebInfo", "--prefix", - debug_dir, + relWithDebInfo_dir, ] ) subprocess.run( @@ -150,11 +145,11 @@ def package(self): ] ) self.copy(pattern="*", src=package_dir) - + def package_info(self): - self.cpp_info.debug.libdirs = ["Debug/lib"] - self.cpp_info.debug.bindirs = ["Debug/Plugins", "Debug"] - self.cpp_info.debug.includedirs = ["Debug/include", "Debug"] + self.cpp_info.relwithdebinfo.libdirs = ["RelWithDebInfo/lib"] + self.cpp_info.relwithdebinfo.bindirs = ["RelWithDebInfo/Plugins", "RelWithDebInfo"] + self.cpp_info.relwithdebinfo.includedirs = ["RelWithDebInfo/include", "RelWithDebInfo"] self.cpp_info.release.libdirs = ["Release/lib"] self.cpp_info.release.bindirs = ["Release/Plugins", "Release"] - self.cpp_info.release.includedirs = ["Release/include", "Release"] + self.cpp_info.release.includedirs = ["Release/include", "Release"] \ No newline at end of file From 7e15a2ced1c880141696fc116c3c824da2c1d3d2 Mon Sep 17 00:00:00 2001 From: Thomas Kroes Date: Thu, 27 Feb 2025 13:45:49 +0100 Subject: [PATCH 15/17] Use correct icon getter --- src/PointDataConversionPlugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PointDataConversionPlugin.cpp b/src/PointDataConversionPlugin.cpp index f9a145f..7578192 100644 --- a/src/PointDataConversionPlugin.cpp +++ b/src/PointDataConversionPlugin.cpp @@ -110,7 +110,7 @@ PluginTriggerActions PointDataConversionPluginFactory::getPluginTriggerActions(c const auto addPluginTriggerAction = [this, &pluginTriggerActions, datasets](const PointDataConversionPlugin::Type& type) -> void { const auto typeName = PointDataConversionPlugin::getTypeName(type); - auto pluginTriggerAction = new PluginTriggerAction(const_cast(this), this, QString("Conversion/%1").arg(typeName), QString("Perform %1 data conversion").arg(typeName), getIcon(), [this, datasets, type](PluginTriggerAction& pluginTriggerAction) -> void { + auto pluginTriggerAction = new PluginTriggerAction(const_cast(this), this, QString("Conversion/%1").arg(typeName), QString("Perform %1 data conversion").arg(typeName), icon(), [this, datasets, type](PluginTriggerAction& pluginTriggerAction) -> void { for (const auto& dataset : datasets) { auto pluginInstance = dynamic_cast(plugins().requestPlugin(getKind())); From 647bd6d971d70869ef080e77df96f845e118c7d1 Mon Sep 17 00:00:00 2001 From: Thomas Kroes Date: Thu, 27 Feb 2025 13:46:31 +0100 Subject: [PATCH 16/17] Use correct icon getter --- src/PointDataConversionPlugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PointDataConversionPlugin.cpp b/src/PointDataConversionPlugin.cpp index 7578192..bfa1dd2 100644 --- a/src/PointDataConversionPlugin.cpp +++ b/src/PointDataConversionPlugin.cpp @@ -139,7 +139,7 @@ PluginTriggerActions PointDataConversionPluginFactory::getPluginTriggerActions(c const auto addPluginTriggerAction = [this, &pluginTriggerActions](const PointDataConversionPlugin::Type& type) -> void { const auto typeName = PointDataConversionPlugin::getTypeName(type); - auto pluginTriggerAction = new PluginTriggerAction(const_cast(this), this, QString("Conversion/%1").arg(typeName), QString("Perform %1 data conversion").arg(typeName), getIcon(), [this, type](PluginTriggerAction& pluginTriggerAction) -> void { + auto pluginTriggerAction = new PluginTriggerAction(const_cast(this), this, QString("Conversion/%1").arg(typeName), QString("Perform %1 data conversion").arg(typeName), icon(), [this, type](PluginTriggerAction& pluginTriggerAction) -> void { for (const auto& dataset : pluginTriggerAction.getDatasets()) { auto pluginInstance = dynamic_cast(plugins().requestPlugin(getKind())); From bfdd14222aae8a919909533fdf72eb2501b0055d Mon Sep 17 00:00:00 2001 From: Alexander Vieth Date: Tue, 3 Feb 2026 15:57:34 +0100 Subject: [PATCH 17/17] Plugin config file (#15) * Use PluginInfo.json * Specify CXX as language in cmake * safer cmake checks --- CMakeLists.txt | 25 ++++++++++++++----------- PluginInfo.json | 9 +++++++++ src/PointDataConversionPlugin.h | 2 +- src/PointDataConversionPlugin.json | 5 ----- 4 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 PluginInfo.json delete mode 100644 src/PointDataConversionPlugin.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 74c7139..37b66ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,10 @@ cmake_minimum_required(VERSION 3.22) # ----------------------------------------------------------------------------- set(PROJECT "PointDataConversionPlugin") -PROJECT(${PROJECT}) +PROJECT(${PROJECT} + DESCRIPTION "point data conversion plugin for ManiVault" + LANGUAGES CXX +) # ----------------------------------------------------------------------------- # CMake Options @@ -14,12 +17,12 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) -if(MSVC) +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DWIN32 /EHsc /MP /permissive- /Zc:__cplusplus") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD") -endif(MSVC) +endif() # ----------------------------------------------------------------------------- # Dependencies @@ -34,15 +37,18 @@ find_package(ManiVault COMPONENTS Core PointData CONFIG QUIET) set(SOURCES src/PointDataConversionPlugin.h src/PointDataConversionPlugin.cpp - src/PointDataConversionPlugin.json ) -source_group(Plugin FILES ${SOURCES}) +set(AUX + PluginInfo.json +) + +source_group(Plugin FILES ${SOURCES} ${AUX}) # ----------------------------------------------------------------------------- # CMake Target # ----------------------------------------------------------------------------- -add_library(${PROJECT} SHARED ${SOURCES}) +add_library(${PROJECT} SHARED ${SOURCES} ${AUX}) # ----------------------------------------------------------------------------- # Target include directories @@ -79,16 +85,13 @@ add_custom_command(TARGET ${PROJECT} POST_BUILD --verbose ) -set_target_properties(${PROJECT} - PROPERTIES - FOLDER TransformationPlugins -) +mv_handle_plugin_config(${PROJECT}) # ----------------------------------------------------------------------------- # Misc # ----------------------------------------------------------------------------- # Automatically set the debug environment (command + working directory) for MSVC -if(MSVC) +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set_property(TARGET ${PROJECT} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY $,${ManiVault_INSTALL_DIR}/Debug,$,${ManiVault_INSTALL_DIR}/RelWithDebInfo,${ManiVault_INSTALL_DIR}/Release>>) set_property(TARGET ${PROJECT} PROPERTY VS_DEBUGGER_COMMAND $,"${ManiVault_INSTALL_DIR}/Debug/ManiVault Studio.exe",$,"${ManiVault_INSTALL_DIR}/RelWithDebInfo/ManiVault Studio.exe","${ManiVault_INSTALL_DIR}/Release/ManiVault Studio.exe">>) endif() diff --git a/PluginInfo.json b/PluginInfo.json new file mode 100644 index 0000000..b498d0a --- /dev/null +++ b/PluginInfo.json @@ -0,0 +1,9 @@ +{ + "name": "PointDataConversion", + "version" : { + "plugin" : "1.0.0", + "core" : ["1.3"] + }, + "type" : "Transformation", + "dependencies": [ "Points" ] +} diff --git a/src/PointDataConversionPlugin.h b/src/PointDataConversionPlugin.h index 6ab3ee1..6745b59 100644 --- a/src/PointDataConversionPlugin.h +++ b/src/PointDataConversionPlugin.h @@ -78,7 +78,7 @@ class PointDataConversionPluginFactory : public TransformationPluginFactory Q_INTERFACES(mv::plugin::TransformationPluginFactory mv::plugin::PluginFactory) Q_OBJECT Q_PLUGIN_METADATA(IID "studio.manivault.PointDataConversionPlugin" - FILE "PointDataConversionPlugin.json") + FILE "PluginInfo.json") public: diff --git a/src/PointDataConversionPlugin.json b/src/PointDataConversionPlugin.json deleted file mode 100644 index c010cb0..0000000 --- a/src/PointDataConversionPlugin.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "PointDataConversion", - "version": "1", - "dependencies": [ "Points" ] -}