diff --git a/Modules/CppRestSdkQt/CMakeLists.txt b/Modules/CppRestSdkQt/CMakeLists.txt deleted file mode 100644 index b5ee7a62b7..0000000000 --- a/Modules/CppRestSdkQt/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -if(MITK_USE_cpprestsdk) - - MITK_CREATE_MODULE( - DEPENDS MitkCore MitkCppRestSdk - PACKAGE_DEPENDS Qt5|Core - AUTOLOAD_WITH MitkQtWidgets - ) - - if(TARGET ${MODULE_TARGET}) - target_link_libraries(${MODULE_TARGET} PUBLIC cpprestsdk::cpprest OpenSSL::SSL) - endif() - -endif() diff --git a/Modules/CppRestSdkQt/files.cmake b/Modules/CppRestSdkQt/files.cmake deleted file mode 100644 index a61e309ead..0000000000 --- a/Modules/CppRestSdkQt/files.cmake +++ /dev/null @@ -1,11 +0,0 @@ -file(GLOB_RECURSE H_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/include/*") - -set(CPP_FILES -mitkRESTManagerQt.cpp -mitkCppRestSdkQtActivator.cpp -mitkRESTServerQt.cpp -) - -set(MOC_H_FILES -include/mitkRESTManagerQt.h -include/mitkRESTServerQt.h) \ No newline at end of file diff --git a/Modules/CppRestSdkQt/include/mitkRESTManagerQt.h b/Modules/CppRestSdkQt/include/mitkRESTManagerQt.h deleted file mode 100644 index 2d18707e64..0000000000 --- a/Modules/CppRestSdkQt/include/mitkRESTManagerQt.h +++ /dev/null @@ -1,69 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#ifndef mitkRESTManagerQt_h -#define mitkRESTManagerQt_h - - -#include -#include - -#include -#include -#include -#include - -#include - -namespace mitk -{ - /** - * @class RESTManagerQt - * @brief this is a microservice for managing REST-requests, used for Qt applications. - * - * This class inherits from the RESTManager in the CppRestSdk Module, which is the equivalent service for - * non-Qt applications. - */ - - class MITKCPPRESTSDKQT_EXPORT RESTManagerQt : public QObject, public RESTManager - { - Q_OBJECT - - public: - RESTManagerQt(); - ~RESTManagerQt() override; - - /** - * @brief starts listening for requests if there isn't another observer listening and the port is free - * - * @param uri defines the URI for which incoming requests should be send to the observer - * @param observer the observer which handles the incoming requests - */ - void ReceiveRequest(const web::uri &uri, IRESTObserver *observer) override; - - /** - * @brief Handles the deletion of an observer for all or a specific uri - * - * @param observer the observer which shouldn't receive requests anymore - * @param uri the uri for which the observer doesn't handle requests anymore (optional) - */ - void HandleDeleteObserver(IRESTObserver *observer, const web::uri &uri = {}) override; - - private: - std::map m_ServerThreadMap; // Map with threads for servers - }; -} // namespace mitk -#endif // !mitkRESTManager_h \ No newline at end of file diff --git a/Modules/CppRestSdkQt/include/mitkRESTServerQt.h b/Modules/CppRestSdkQt/include/mitkRESTServerQt.h deleted file mode 100644 index c1d2061724..0000000000 --- a/Modules/CppRestSdkQt/include/mitkRESTServerQt.h +++ /dev/null @@ -1,51 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#ifndef mitkRESTServerQt_h -#define mitkRESTServerQt_h - -#include -#include - -namespace mitk -{ - class RESTServerQt : public QObject, public RESTServer - { - Q_OBJECT - - - public: - /** - * @brief Creates an server listening to the given URI - * - * @param uri the URI at which the server is listening for requests - */ - RESTServerQt(const web::uri &uri); - ~RESTServerQt(); - - public slots: - /** - * @brief Opens the listener and starts the listening process - */ - void OpenListener(); - - /** - * @brief Closes the listener and stops the listening process - */ - void CloseListener(); - }; -} // namespace mitk -#endif \ No newline at end of file diff --git a/Modules/CppRestSdkQt/src/mitkCppRestSdkQtActivator.cpp b/Modules/CppRestSdkQt/src/mitkCppRestSdkQtActivator.cpp deleted file mode 100644 index 6ce703c567..0000000000 --- a/Modules/CppRestSdkQt/src/mitkCppRestSdkQtActivator.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "mitkCppRestSdkQtActivator.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void MitkCppRestSdkQtActivator::Load(us::ModuleContext *context) -{ - // Registration of the RESTManagerMicroservice - m_RESTManagerQt.reset(new mitk::RESTManagerQt); - - us::ServiceProperties props; - //The standard RESTManager which is used for non-qt applications has a ranking of 5 - if (nullptr != QCoreApplication::instance) - { - props[us::ServiceConstants::SERVICE_RANKING()] = 10; - } - else - { - props[us::ServiceConstants::SERVICE_RANKING()] = 0; - } - context->RegisterService(m_RESTManagerQt.get(),props); -} - -void MitkCppRestSdkQtActivator::Unload(us::ModuleContext *) {} - -US_EXPORT_MODULE_ACTIVATOR(MitkCppRestSdkQtActivator) diff --git a/Modules/CppRestSdkQt/src/mitkCppRestSdkQtActivator.h b/Modules/CppRestSdkQt/src/mitkCppRestSdkQtActivator.h deleted file mode 100644 index 7fcdd9e51e..0000000000 --- a/Modules/CppRestSdkQt/src/mitkCppRestSdkQtActivator.h +++ /dev/null @@ -1,37 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#ifndef MITKCPPRESTSDKQTACTIVATOR_H_ -#define MITKCPPRESTSDKQTACTIVATOR_H_ - -#include - -#include -#include -#include -#include - -class MitkCppRestSdkQtActivator : public us::ModuleActivator -{ - -public: - void Load(us::ModuleContext *context) override; - void Unload(us::ModuleContext *) override; - -private: - std::unique_ptr m_RESTManagerQt; -}; -#endif diff --git a/Modules/CppRestSdkQt/src/mitkRESTManagerQt.cpp b/Modules/CppRestSdkQt/src/mitkRESTManagerQt.cpp deleted file mode 100644 index dbe2c9b5fd..0000000000 --- a/Modules/CppRestSdkQt/src/mitkRESTManagerQt.cpp +++ /dev/null @@ -1,80 +0,0 @@ -#include "mitkRESTManagerQt.h" -#include -#include - -mitk::RESTManagerQt::RESTManagerQt() {} - -mitk::RESTManagerQt::~RESTManagerQt() {} - -void mitk::RESTManagerQt::ReceiveRequest(const web::uri &uri, mitk::IRESTObserver *observer) -{ - // New instance of RESTServer in m_ServerMap, key is port of the request - int port = uri.port(); - - // Checking if port is free to add a new Server - if (0 == GetServerMap().count(port)) - { - mitk::RESTManager::AddObserver(uri, observer); - - // creating server instance - auto server = new RESTServerQt(uri.authority()); - // add reference to server instance to map - mitk::RESTManager::SetServerMap(port, server); - - // Move server to seperate Thread and create connections between threads - m_ServerThreadMap[port] = new QThread; - server->moveToThread(m_ServerThreadMap[port]); - - connect(m_ServerThreadMap[port], &QThread::finished, server, &QObject::deleteLater); - - // starting Server - m_ServerThreadMap[port]->start(); - QMetaObject::invokeMethod(server, "OpenListener"); - - MITK_INFO << "new server " << mitk::RESTUtil::convertToUtf8(uri.authority().to_string()) << " at port " << port; - } - // If there is already a server under this port - else - { - mitk::RESTManager::RequestForATakenPort(uri, observer); - } -} - -void mitk::RESTManagerQt::HandleDeleteObserver(IRESTObserver *observer, const web::uri &uri) -{ - auto &observerMap = mitk::RESTManager::GetObservers(); - for (auto it = observerMap.begin(); it != observerMap.end();) - { - mitk::IRESTObserver *obsMap = it->second; - // Check wether observer is at this place in map - if (observer == obsMap) - { - // Check wether it is the right uri to be deleted - if (uri.is_empty() || uri.path() == it->first.second) - { - int port = it->first.first; - bool noObserverForPort = mitk::RESTManager::DeleteObserver(it); - if (noObserverForPort) - { - // there isn't an observer at this port, delete m_ServerMap entry for this port - // close listener - QMetaObject::invokeMethod(static_cast(mitk::RESTManager::GetServerMap().at(port)), "CloseListener"); - // end thread - m_ServerThreadMap[port]->quit(); - m_ServerThreadMap[port]->wait(); - - // delete server from map - mitk::RESTManager::DeleteFromServerMap(port); - } - } - else - { - ++it; - } - } - else - { - ++it; - } - } -} diff --git a/Modules/CppRestSdkQt/src/mitkRESTServerQt.cpp b/Modules/CppRestSdkQt/src/mitkRESTServerQt.cpp deleted file mode 100644 index ca44ed4256..0000000000 --- a/Modules/CppRestSdkQt/src/mitkRESTServerQt.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "mitkRESTServerQt.h" - -mitk::RESTServerQt::RESTServerQt(const web::uri &uri) : RESTServer(uri) -{ -} - -mitk::RESTServerQt::~RESTServerQt() {} - -void mitk::RESTServerQt::OpenListener() -{ - mitk::RESTServer::OpenListener(); -} - -void mitk::RESTServerQt::CloseListener() -{ - mitk::RESTServer::CloseListener(); -} diff --git a/Modules/ModuleList.cmake b/Modules/ModuleList.cmake index 023e4e2181..b7cda3ba1f 100644 --- a/Modules/ModuleList.cmake +++ b/Modules/ModuleList.cmake @@ -1,88 +1,87 @@ # The entries in the mitk_modules list must be # ordered according to their dependencies. set(MITK_MODULES Core CommandLine AppUtil RDF LegacyIO DataTypesExt Annotation LegacyGL AlgorithmsExt MapperExt DICOMReader DICOMReaderServices DICOMQI DICOMTesting SceneSerializationBase PlanarFigure ImageDenoising ImageExtraction SceneSerialization Gizmo GraphAlgorithms Multilabel Chart ImageStatistics ContourModel SurfaceInterpolation Segmentation PlanarFigureSegmentation QtWidgets QtWidgetsExt ImageStatisticsUI SegmentationUI MatchPointRegistration MatchPointRegistrationUI Classification GPGPU OpenIGTLink IGTBase IGT CameraCalibration OpenCL OpenCVVideoSupport QtOverlays ToFHardware ToFProcessing ToFUI PhotoacousticsHardware PhotoacousticsAlgorithms PhotoacousticsLib US USUI DicomUI Remeshing Python QtPython Persistence OpenIGTLinkUI IGTUI DicomRT RTUI IOExt XNAT TubeGraph BiophotonicsHardware DiffusionImaging TumorInvasionAnalysis BoundingShape RenderWindowManager RenderWindowManagerUI SemanticRelations SemanticRelationsUI CEST BasicImageProcessing ModelFit ModelFitUI Pharmacokinetics PharmacokineticsUI CppRestSdk - CppRestSdkQt ) if(MITK_ENABLE_PIC_READER) list(APPEND MITK_MODULES IpPicSupportIO) endif()