Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flex Framework upgrade #1255

Draft
wants to merge 46 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
7d8dda7
Import an old development never on metaDataKey system.
Florent2305 Mar 13, 2024
f4ddc48
Begin to solve multiple volume
Florent2305 Apr 3, 2024
f173947
fix some issues about references with gcc on medMetaDataKeys
LilianRP33 Mar 15, 2024
ade032b
[FIX] For gcc 11.3.0
Mar 15, 2024
bcab2b8
Fix problems into:
Florent2305 Apr 11, 2024
4a92f01
Improve medMetaDataKeys 1stp PART
Florent2305 Apr 23, 2024
191569f
Work on :
Florent2305 May 22, 2024
ea988c1
Work on :
Florent2305 May 22, 2024
7081bf7
reorganize,clean and doxyen medVirtualRepresentation
Florent2305 May 24, 2024
c476106
modified files for data loading
LilianRP33 May 28, 2024
1f7d9e4
medinria 4.0rc
Florent2305 Sep 10, 2024
3325c2a
Forgotten files
Florent2305 Sep 10, 2024
2605ce1
Import an old development never on metaDataKey system.
Florent2305 Mar 13, 2024
ac2788e
Begin to solve multiple volume
Florent2305 Apr 3, 2024
419fd37
fix some issues about references with gcc on medMetaDataKeys
LilianRP33 Mar 15, 2024
ba4301f
[FIX] For gcc 11.3.0
Mar 15, 2024
31af1a2
Fix problems into:
Florent2305 Apr 11, 2024
1cbae23
Improve medMetaDataKeys 1stp PART
Florent2305 Apr 23, 2024
7609c0d
Work on :
Florent2305 May 22, 2024
ebda6b9
Work on :
Florent2305 May 22, 2024
7ba0859
reorganize,clean and doxyen medVirtualRepresentation
Florent2305 May 24, 2024
bd4a1e7
modified files for data loading
LilianRP33 May 28, 2024
2e29a73
medinria 4.0rc
Florent2305 Sep 10, 2024
f01d699
Forgotten files
Florent2305 Sep 10, 2024
f3e08fa
Merge branch 'PourFlo' of github.com:Florent2305/medInria-public into…
Florent2305 Sep 11, 2024
74e0943
Import an old development never on metaDataKey system.
Florent2305 Mar 13, 2024
b88630f
Begin to solve multiple volume
Florent2305 Apr 3, 2024
54710f5
fix some issues about references with gcc on medMetaDataKeys
LilianRP33 Mar 15, 2024
4434fe3
[FIX] For gcc 11.3.0
Mar 15, 2024
bcbba35
Fix problems into:
Florent2305 Apr 11, 2024
cb86256
Improve medMetaDataKeys 1stp PART
Florent2305 Apr 23, 2024
aea09e3
Work on :
Florent2305 May 22, 2024
4c1f3cb
Work on :
Florent2305 May 22, 2024
4b9ecf9
reorganize,clean and doxyen medVirtualRepresentation
Florent2305 May 24, 2024
99efc99
modified files for data loading
LilianRP33 May 28, 2024
216f372
1st step for compatibility to Qt 5 and 6
Oct 16, 2024
3262216
This commit is made to facilitate the future upgrade of Qt(5->6), ITK…
Florent2305 Oct 28, 2024
0f5baf2
Remove a cmake debug helper
Florent2305 Oct 29, 2024
e86c6c9
Add default data source config file
Florent2305 Oct 29, 2024
5962225
Fix medFirstStart
Florent2305 Oct 31, 2024
413b39a
Fix image load bug
Florent2305 Oct 31, 2024
bce83df
Fix SDK generation bug
Florent2305 Oct 31, 2024
96d3a50
Merge branch 'PourFlo' of github.com:Florent2305/medInria-public into…
Florent2305 Oct 31, 2024
c891ef7
Merge branch 'flex_framworkUpgrade' into PourFlo
Florent2305 Oct 31, 2024
86ead40
Remove old test to implement a downloader
Florent2305 Oct 31, 2024
f6108fc
Merge pull request #18 from Florent2305/PourFlo
Florent2305 Oct 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

cmake_minimum_required(VERSION 3.19)

set(QT_VERSION_MAJOR 5)

if(POLICY CMP0020)
cmake_policy(SET CMP0020 NEW)
endif()
Expand Down
22 changes: 19 additions & 3 deletions packaging/windows/WindowsPackaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,11 @@ set(CONFIG_MODE $<$<CONFIG:debug>:Debug>$<$<CONFIG:release>:Release>$<$<CONFIG:M


set(APP "\${CMAKE_INSTALL_PREFIX}/bin/medInria.exe")
set(QT_BINARY_DIR "${Qt5_DIR}/../../../bin")
set(QT_PLUGINS_DIR "${Qt5_DIR}/../../../plugins")

set(QT_BINARY_DIR "${Qt${QT_VERSION_MAJOR}_DIR}/../../../bin")
set(QT_PLUGINS_DIR "${Qt${QT_VERSION_MAJOR}_DIR}/../../../plugins")
set(QT_TOOLS_DIR "${Qt${QT_VERSION_MAJOR}_DIR}/../../../../../Tools")

set(MEDINRIA_FILES "${medInria_DIR}/bin")

list(APPEND
Expand Down Expand Up @@ -151,6 +154,13 @@ file(INSTALL ${QT_PLUGINS_DIR}/platforms/qoffscreen.dll DESTINATION \${CMAKE_INS
file(INSTALL ${QT_PLUGINS_DIR}/platforms/qwindows.dll DESTINATION \${CMAKE_INSTALL_PREFIX}/bin/platforms/ FILES_MATCHING PATTERN \"*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
file(INSTALL ${QT_PLUGINS_DIR}/sqldrivers/qsqlite.dll DESTINATION \${CMAKE_INSTALL_PREFIX}/bin/sqldrivers/ FILES_MATCHING PATTERN \"*${CMAKE_SHARED_LIBRARY_SUFFIX}\")

file(INSTALL ${QT_TOOLS_DIR}/OpenSSL/Win_x64/bin/libcrypto-1_1-x64.dll DESTINATION \${CMAKE_INSTALL_PREFIX}/bin FILES_MATCHING PATTERN \"*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
file(INSTALL ${QT_TOOLS_DIR}/OpenSSL/Win_x64/bin/libssl-1_1-x64.dll DESTINATION \${CMAKE_INSTALL_PREFIX}/bin FILES_MATCHING PATTERN \"*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
file(INSTALL ${QT_TOOLS_DIR}/OpenSSLv3/Win_x64/bin/libcrypto-3-x64.dll DESTINATION \${CMAKE_INSTALL_PREFIX}/bin FILES_MATCHING PATTERN \"*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
file(INSTALL ${QT_TOOLS_DIR}/OpenSSLv3/Win_x64/bin/libssl-3-x64.dll DESTINATION \${CMAKE_INSTALL_PREFIX}/bin FILES_MATCHING PATTERN \"*${CMAKE_SHARED_LIBRARY_SUFFIX}\")



file(GLOB_RECURSE MED_LIBRARIES
\${CMAKE_INSTALL_PREFIX}/bin/*${CMAKE_SHARED_LIBRARY_SUFFIX}
\${CMAKE_INSTALL_PREFIX}/plugins/*${CMAKE_SHARED_LIBRARY_SUFFIX}
Expand Down Expand Up @@ -181,7 +191,13 @@ if(${SDK_PACKAGING} )
INSTALL(FILES ${QT_PLUGINS_DIR}/platforms/qminimal.dll DESTINATION ./sdk/bin/platforms/ COMPONENT Dev)
INSTALL(FILES ${QT_PLUGINS_DIR}/platforms/qoffscreen.dll DESTINATION ./sdk/bin/platforms/ COMPONENT Dev) #is it really used
INSTALL(FILES ${QT_PLUGINS_DIR}/platforms/qwindows.dll DESTINATION ./sdk/bin/platforms/ COMPONENT Dev)
INSTALL(FILES ${QT_PLUGINS_DIR}/sqldrivers/qsqlite.dll DESTINATION ./sdk/bin/sqldrivers/ COMPONENT Dev)
INSTALL(FILES ${QT_PLUGINS_DIR}/sqldrivers/qsqlite.dll DESTINATION ./sdk/bin/sqldrivers/ COMPONENT Dev)

INSTALL(FILES ${QT_TOOLS_DIR}/OpenSSL/Win_x64/bin/libcrypto-1_1-x64.dll DESTINATION ./sdk/bin/ COMPONENT Dev)
INSTALL(FILES ${QT_TOOLS_DIR}/OpenSSL/Win_x64/bin/libssl-1_1-x64.dll DESTINATION ./sdk/bin/ COMPONENT Dev)
INSTALL(FILES ${QT_TOOLS_DIR}/OpenSSLv3/Win_x64/bin/libcrypto-3-x64.dll DESTINATION ./sdk/bin/ COMPONENT Dev)
INSTALL(FILES ${QT_TOOLS_DIR}/OpenSSLv3/Win_x64/bin/libssl-3-x64.dll DESTINATION ./sdk/bin/ COMPONENT Dev)


LIST(APPEND CPACK_NSIS_CREATE_ICONS_EXTRA " CreateShortCut '$SMPROGRAMS\\\\medInria\\\\medDevEnv.lnk' '$APPDATA\\\\Local\\\\inria\\\\${CPACK_PACKAGE_INSTALL_DIRECTORY}\\\\sdk\\\\med_Dev.bat'")
LIST(APPEND CPACK_NSIS_DELETE_ICONS_EXTRA " Delete '$SMPROGRAMS\\\\medInria\\\\medDevEnv.lnk'")
Expand Down
14 changes: 5 additions & 9 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

cmake_minimum_required(VERSION 3.19)

set(QT_VERSION_MAJOR 5)

if(NOT DEFINED ${medInria_VERSION})
set(medInria_VERSION 5.0.0)
endif()
Expand All @@ -26,6 +28,8 @@ project(medInria VERSION ${medInria_VERSION})
cmake_policy(SET CMP0074 NEW)
cmake_policy(SET CMP0076 NEW)

SET(CMAKE_BUILD_PARALLEL_LEVEL 8 CACHE INTERNAL "" FORCE)

string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UP)

set(${PROJECT_NAME}_IDENTIFIER fr.inria.${PROJECT_NAME})
Expand Down Expand Up @@ -83,7 +87,7 @@ endif()
## Find package
## #############################################################################

find_package(Qt5 REQUIRED COMPONENTS
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS
Concurrent
Core
Gui
Expand Down Expand Up @@ -136,14 +140,6 @@ endif()



# ## #############################################################################
# ## SDK Options
# ## #############################################################################
# option(SDK_GENERATION "Generate the SDK directory" OFF )
# option(SDK_PACKAGING "Include the SDK into the packaging" OFF )
# set(SDK_DIR ${CMAKE_BINARY_DIR}/../sdk CACHE FILEPATH "Path of the SDK directory")
# mark_as_advanced(SDK_DIR)

## #############################################################################
## Qt Auto tools
## #############################################################################
Expand Down
15 changes: 7 additions & 8 deletions src/app/medInria/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ add_subdirectory(resources)
find_package(dtk REQUIRED)
include_directories(${dtk_INCLUDE_DIRS})

find_package(Boost REQUIRED)

list_source_files(${TARGET_NAME}
${CMAKE_CURRENT_SOURCE_DIR}
areas/browser
Expand All @@ -38,6 +36,7 @@ list_source_files(${TARGET_NAME}
areas/workspaces/registration
areas/workspaces/segmentation
areas/workspaces/visualization
FirstStart
)

## see cmake/module/list_header_directories_to_include.cmake
Expand Down Expand Up @@ -122,7 +121,6 @@ endif()

target_include_directories(${TARGET_NAME}
PRIVATE ${${TARGET_NAME}_INCLUDE_DIRS}
${Boost_INCLUDE_DIR}
)
# PRIVATE beacause application is not supposed to be used somewhere else

Expand All @@ -131,11 +129,11 @@ target_include_directories(${TARGET_NAME}
## #############################################################################

target_link_libraries(${TARGET_NAME} PRIVATE
Qt5::Core
Qt5::Widgets
Qt5::Gui
Qt5::OpenGL
Qt5::Svg
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::OpenGL
Qt${QT_VERSION_MAJOR}::Svg
dtkCoreSupport
dtkGuiSupport
dtkVrSupport
Expand All @@ -150,3 +148,4 @@ target_link_libraries(${TARGET_NAME} PRIVATE

## see cmake/module/set_lib_install_rules.Cmake
set_exe_install_rules(${TARGET_NAME})

119 changes: 119 additions & 0 deletions src/app/medInria/FirstStart/medFirstStart.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/*=========================================================================

medInria

Copyright (c) INRIA 2013 - 2020. All rights reserved.
See LICENSE.txt for details.

This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

=========================================================================*/

/**
* @file medFirstStart.cpp
* @brief Implementation file for the medFirstStart class.
* @copyright Copyright (c) INRIA 2013 - 2020. All rights reserved.
* @see LICENSE.txt for details.
*
* This software is distributed WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE.
*/
#include "medFirstStart.h"

#include "medFirstStartUpdateFile.h"
#include "medFirstStartClient.h"

#include <QFileInfo>
#include <QVector>
#include <QRunnable>
#include <QThreadPool>

class medFirstStartPrivate
{
public:
medFirstStartPrivate() = default;
~medFirstStartPrivate() = default;

/**
* @struct st_fileInfoUpdate
* @brief Internal structure to store information about a file to check and update.
*/
struct st_fileInfoUpdate
{
QString pathToCheck;
QString pathRessourceBase;
QString featureName;
QString fileName;
QString urlDL;
std::function<bool(QString, QString)> init;
std::function<bool(QString, QString)> update;
};

/**
* @brief List of files to check install or update.
*/
QVector<struct st_fileInfoUpdate> listFilesToCheckAndUpdate;
QNetworkAccessManager *qnam;

};

class medUpdateReferencesFilesThread : public QRunnable
{
public:
medUpdateReferencesFilesThread(medFirstStart * parent) : m_parent(parent) {};
virtual ~medUpdateReferencesFilesThread() = default;

void run() override
{
m_parent->updates();
}

medFirstStart * m_parent;
};

medFirstStart::medFirstStart(QNetworkAccessManager *qnam)
{
d = new medFirstStartPrivate();
d->qnam = qnam;
}

medFirstStart::~medFirstStart()
{
delete d;
}




void medFirstStart::pushPathToCheck(QString pathToCheck, QString pathRessourceBase, QString featureName, QString url, std::function<bool(QString, QString)> init, std::function<bool(QString, QString)> update)
{
d->listFilesToCheckAndUpdate.push_back({ pathToCheck, pathRessourceBase, featureName, QFileInfo(pathToCheck).fileName(), url, init, update });
}

void medFirstStart::checkAndUpdate()
{
checks();
medUpdateReferencesFilesThread * updateThread = new medUpdateReferencesFilesThread(this);
QThreadPool::globalInstance()->start(updateThread);
}

void medFirstStart::checks()
{
for (auto & fileToCheckAndUpdate : d->listFilesToCheckAndUpdate)
{
medFirstStartUpdateFile fileUpdater(fileToCheckAndUpdate.pathToCheck, fileToCheckAndUpdate.featureName, fileToCheckAndUpdate.pathRessourceBase, fileToCheckAndUpdate.update, fileToCheckAndUpdate.init);
fileUpdater.installFile();
}
}

void medFirstStart::updates()
{
for (auto & fileToCheckAndUpdate : d->listFilesToCheckAndUpdate)
{
medFirstStartClient fileClientDL(fileToCheckAndUpdate.featureName, fileToCheckAndUpdate.fileName, fileToCheckAndUpdate.urlDL, d->qnam);
fileClientDL.updateReferenceFile();
}
}
85 changes: 85 additions & 0 deletions src/app/medInria/FirstStart/medFirstStart.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#pragma once
/*=========================================================================

medInria

Copyright (c) INRIA 2013 - 2020. All rights reserved.
See LICENSE.txt for details.

This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

=========================================================================*/

/**
* @file medFirstStart.h
* @brief Header file for the medFirstStart class.
* @copyright Copyright (c) INRIA 2013 - 2020. All rights reserved.
* @see LICENSE.txt for details.
*
* This software is distributed WITHOUT ANY WARRANTY; without even
* the �
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE.
*/
#include <QObject>
#include <QString>
#include <QUrl>

#include <functional>

/**
* @brief Private class for medFirstStart.
*/
class medFirstStartPrivate;

class QNetworkAccessManager;

/**
* @class medFirstStart
* @brief This class provides functionalities to setup or update configuration files for another application.
*/
class medFirstStart : public QObject
{
Q_OBJECT
public:
/**
* @brief Default constructor.
*/
medFirstStart(QNetworkAccessManager *qnam);

/**
* @brief Destructor.
*/
~medFirstStart();

/**
* @brief Pushes a path to check for updates to the internal list.
*
* @param pathToCheck Path to the file to check for updates.
* @param pathRessourceBase Base path for the resource.
* @param featureName Name of the feature associated with the file.
* @param fileName Name of the file.
* @param url Optional URL for downloading new version for the reference file.
* @param init Optional callback function to initialize the file.
* @param update Optional callback function to update the file.
*/
void pushPathToCheck(QString pathToCheck, QString pathRessourceBase,
QString featureName, //QString fileName,
QString url = "",
std::function<bool(QString, QString)> init = nullptr,
std::function<bool(QString, QString)> update = nullptr);

/**
* @brief Checks and updates all files added with pushPathToCheck.
*/
void checkAndUpdate();

void checks();
void updates();

private:
medFirstStartPrivate *d;
};

Loading