diff --git a/Modules/ToFHardware/PMD/mitkPMDModuleActivator.cpp b/Modules/ToFHardware/PMD/mitkPMDModuleActivator.cpp index a9bc6f49f4..f7fd33e1a6 100644 --- a/Modules/ToFHardware/PMD/mitkPMDModuleActivator.cpp +++ b/Modules/ToFHardware/PMD/mitkPMDModuleActivator.cpp @@ -1,158 +1,158 @@ /*=================================================================== 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 __mitkToFCameraPMDModuleActivator_h #define __mitkToFCameraPMDModuleActivator_h // Microservices #include #include -#include "mitkModuleContext.h" +#include +#include -#include #include "mitkIToFDeviceFactory.h" #include "mitkToFConfig.h" #include "mitkToFPMDConfig.h" //The follwing heades only get implemented if the respective Devices are activated through Cmake #ifdef MITK_USE_TOF_PMDCAMCUBE #include "mitkToFCameraPMDCamCubeDeviceFactory.h" #include "mitkToFCameraPMDRawDataCamCubeDeviceFactory.h" #endif #ifdef MITK_USE_TOF_PMDO3 #include "mitkToFCameraPMDO3DeviceFactory.h" #endif #ifdef MITK_USE_TOF_PMDCAMBOARD #include "mitkToFCameraPMDCamBoardDeviceFactory.h" #include "mitkToFCameraPMDRawDataCamBoardDeviceFactory.h" #endif #include "mitkToFCameraPMDPlayerDeviceFactory.h" //Implementing a Device on start #include "mitkAbstractToFDeviceFactory.h" /* * This is the module activator for the "mitkPMDModule". It registers services * like the IToFDeviceFactory. */ namespace mitk { -class PMDModuleActivator : public ModuleActivator { +class PMDModuleActivator : public us::ModuleActivator { public: - void Load(mitk::ModuleContext* context) + void Load(us::ModuleContext* context) { //The PMD CamBoard-Factory gets activated as soon as the user toggels one the PMD-parameter in Cmake to on #ifdef MITK_USE_TOF_PMDCAMCUBE //Implementing Cam Cube ToFCameraPMDCamCubeDeviceFactory* toFCameraPMDCamCubeDeviceFactory = new ToFCameraPMDCamCubeDeviceFactory(); - ServiceProperties camCubeFactoryProps; + us::ServiceProperties camCubeFactoryProps; camCubeFactoryProps["ToFFactoryName"] = toFCameraPMDCamCubeDeviceFactory->GetFactoryName(); context->RegisterService(toFCameraPMDCamCubeDeviceFactory,camCubeFactoryProps); toFCameraPMDCamCubeDeviceFactory->ConnectToFDevice(); //Implementing PMD Raw Data Cam Cube DeviceFactory ToFCameraPMDRawDataCamCubeDeviceFactory* toFCameraPMDRawDataCamCubeDeviceFactory = new ToFCameraPMDRawDataCamCubeDeviceFactory(); - ServiceProperties rawCamCubeFactoryProps; + us::ServiceProperties rawCamCubeFactoryProps; rawCamCubeFactoryProps["ToFFactoryName"] = toFCameraPMDRawDataCamCubeDeviceFactory->GetFactoryName(); context->RegisterService(toFCameraPMDRawDataCamCubeDeviceFactory,rawCamCubeFactoryProps); toFCameraPMDRawDataCamCubeDeviceFactory->ConnectToFDevice(); m_Factories.push_back(toFCameraPMDCamCubeDeviceFactory); m_Factories.push_back(toFCameraPMDRawDataCamCubeDeviceFactory); #endif //The PMD O3-Factory gets activated as soon as the user toggels one the PMD-parameter in Cmake to on #ifdef MITK_USE_TOF_PMDO3 //Implementing PMD O3D DeviceFactory ToFCameraPMDO3DeviceFactory* toFCameraPMDO3DeviceFactory = new ToFCameraPMDO3DeviceFactory(); - ServiceProperties o3FactoryProps; + us::ServiceProperties o3FactoryProps; o3FactoryProps["ToFFactoryName"] = toFCameraPMDO3DeviceFactory->GetFactoryName(); context->RegisterService(toFCameraPMDO3DeviceFactory,o3FactoryProps); toFCameraPMDO3DeviceFactory->ConnectToFDevice(); m_Factories.push_back(toFCameraPMDO3DeviceFactory); #endif //The PMD CamBoard-Factory gets activated as soon as the user toggels one the PMD-parameter in Cmake to on #ifdef MITK_USE_TOF_PMDCAMBOARD //Implementing CamBoardDeviceFactory ToFCameraPMDCamBoardDeviceFactory* toFCameraPMDCamBoardDeviceFactory = new ToFCameraPMDCamBoardDeviceFactory(); - ServiceProperties camBoardFactoryProps; + us::ServiceProperties camBoardFactoryProps; camBoardFactoryProps["ToFFactoryName"] = toFCameraPMDCamBoardDeviceFactory->GetFactoryName(); context->RegisterService(toFCameraPMDCamBoardDeviceFactory, camBoardFactoryProps); toFCameraPMDCamBoardDeviceFactory->ConnectToFDevice(); //Implementing PMD Raw Data Cam Board DeviceFactory ToFCameraPMDRawDataCamBoardDeviceFactory* toFCameraPMDRawDataCamBoardDeviceFactory = new ToFCameraPMDRawDataCamBoardDeviceFactory(); - ServiceProperties rawCamBoardFactoryProps; + us::ServiceProperties rawCamBoardFactoryProps; rawCamBoardFactoryProps["ToFFactoryName"] = toFCameraPMDRawDataCamBoardDeviceFactory->GetFactoryName(); context->RegisterService(toFCameraPMDRawDataCamBoardDeviceFactory,rawCamBoardFactoryProps); toFCameraPMDRawDataCamBoardDeviceFactory->ConnectToFDevice(); m_Factories.push_back(toFCameraPMDCamBoardDeviceFactory); m_Factories.push_back(toFCameraPMDRawDataCamBoardDeviceFactory); #endif //The PMD Player Device Factory gets activated as soon as the user toggels one of the PMD-parameters in Cmake to on //Registrating the PMD Player DeviceFactory ToFCameraPMDPlayerDeviceFactory* toFCameraPMDPlayerDeviceFactory = new ToFCameraPMDPlayerDeviceFactory(); - ServiceProperties pMDPlayerFactoryProps; + us::ServiceProperties pMDPlayerFactoryProps; pMDPlayerFactoryProps["ToFFactoryName"] = toFCameraPMDPlayerDeviceFactory->GetFactoryName(); context->RegisterService(toFCameraPMDPlayerDeviceFactory,pMDPlayerFactoryProps); toFCameraPMDPlayerDeviceFactory->ConnectToFDevice(); m_Factories.push_back(toFCameraPMDPlayerDeviceFactory); } - void Unload(mitk::ModuleContext* ) + void Unload(us::ModuleContext* ) { } ~PMDModuleActivator() { if(m_Factories.size() > 0) { for(std::list< IToFDeviceFactory* >::iterator it = m_Factories.begin(); it != m_Factories.end(); ++it) { delete (*it); } } } private: std::list< IToFDeviceFactory* > m_Factories; }; } US_EXPORT_MODULE_ACTIVATOR(mitkPMDModule, mitk::PMDModuleActivator) #endif diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeDeviceFactory.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeDeviceFactory.h index 29bb78e7c6..f3237c8f1d 100644 --- a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeDeviceFactory.h +++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeDeviceFactory.h @@ -1,97 +1,97 @@ /*=================================================================== 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 __mitkToFCameraPMDCamCubeDeviceFactory_h #define __mitkToFCameraPMDCamCubeDeviceFactory_h #include "mitkPMDModuleExports.h" #include "mitkToFCameraPMDCamCubeDevice.h" #include "mitkAbstractToFDeviceFactory.h" #include #include #include // Microservices #include -#include +#include #include -#include -#include -#include +#include +#include +#include namespace mitk { /** * \brief ToFPMDCamBoardDeviceFactory is an implementation of the factory pattern to generate Cam Cube Devices. * ToFPMDCamCubeDeviceFactory inherits from AbstractToFDeviceFactory which is a MicroService interface. * This offers users the oppertunity to generate new Cam Cube Devices via a global instance of this factory. * @ingroup ToFHardware */ class MITK_PMDMODULE_EXPORT ToFCameraPMDCamCubeDeviceFactory : public itk::LightObject, public AbstractToFDeviceFactory { public: ToFCameraPMDCamCubeDeviceFactory() { this->m_DeviceNumber=1; } /*! - \brief Defining the Factorie´s Name, here for the ToFPMDCamCube. + \brief Defining the Factorie´s Name, here for the ToFPMDCamCube. */ std::string GetFactoryName() { return std::string("PMD Camcube 2.0/3.0 Factory "); } std::string GetCurrentDeviceName() { std::stringstream name; if(m_DeviceNumber>1) { name << "PMD CamCube 2.0/3.0 "<< m_DeviceNumber; } else { name << "PMD CamCube 2.0/3.0 "; } m_DeviceNumber++; return name.str(); } private: /*! \brief Create an instance of a ToFPMDCamCubeDevice. */ ToFCameraDevice::Pointer CreateToFCameraDevice() { ToFCameraPMDCamCubeDevice::Pointer device = ToFCameraPMDCamCubeDevice::New(); device->SetBoolProperty("HasRGBImage", false); device->SetBoolProperty("HasAmplitudeImage", true); device->SetBoolProperty("HasIntensityImage", true); return device.GetPointer(); } - ModuleResource GetIntrinsicsResource() + us::ModuleResource GetIntrinsicsResource() { - Module* module = GetModuleContext()->GetModule(); + us::Module* module = us::GetModuleContext()->GetModule(); return module->GetResource("CalibrationFiles/PMDCamCube3_camera.xml"); } int m_DeviceNumber; }; } #endif diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamCubeDeviceFactory.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamCubeDeviceFactory.h index c5e578530c..a3e18d5104 100644 --- a/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamCubeDeviceFactory.h +++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamCubeDeviceFactory.h @@ -1,97 +1,97 @@ /*=================================================================== 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 __mitkToFCameraPMDRawDataCamCubeDeviceFactory_h #define __mitkToFCameraPMDRawDataCamCubeDeviceFactory_h #include "mitkPMDModuleExports.h" #include "mitkToFCameraPMDRawDataCamCubeDevice.h" #include "mitkAbstractToFDeviceFactory.h" #include #include #include // Microservices #include -#include +#include #include -#include -#include -#include +#include +#include +#include namespace mitk { /** * \brief ToFPMDRawPlayerDeviceFactory is an implementation of the factory pattern to generate Raw Player Devices. * ToFPMDRawPlayerDeviceFactory inherits from AbstractToFDeviceFactory which is a MicroService interface. * This offers users the oppertunity to generate new Raw Player Devices via a global instance of this factory. * @ingroup ToFHardware */ class MITK_PMDMODULE_EXPORT ToFCameraPMDRawDataCamCubeDeviceFactory : public itk::LightObject, public AbstractToFDeviceFactory { public: ToFCameraPMDRawDataCamCubeDeviceFactory() { this->m_DeviceNumber = 1; } /*! - \brief Defining the Factorie´s Name, here for the RawDataDeviceFactory. + \brief Defining the Factorie´s Name, here for the RawDataDeviceFactory. */ std::string GetFactoryName() { return std::string("PMD RAW Data Camcube Factory "); } std::string GetCurrentDeviceName() { std::stringstream name; if(m_DeviceNumber>1) { name << "PMD Raw Data CamCube 2.0/3.0 "<< m_DeviceNumber; } else { name << "PMD Raw Data CamCube 2.0/3.0"; } m_DeviceNumber++; return name.str(); } private: /*! \brief Create an instance of a ToFPMDRawDataDevice. */ ToFCameraDevice::Pointer CreateToFCameraDevice() { ToFCameraPMDRawDataCamCubeDevice::Pointer device = ToFCameraPMDRawDataCamCubeDevice::New(); device->SetBoolProperty("HasRGBImage", false); device->SetBoolProperty("HasAmplitudeImage", true); device->SetBoolProperty("HasIntensityImage", true); return device.GetPointer(); } - ModuleResource GetIntrinsicsResource() + us::ModuleResource GetIntrinsicsResource() { - Module* module = GetModuleContext()->GetModule(); + us::Module* module = us::GetModuleContext()->GetModule(); return module->GetResource("CalibrationFiles/PMDCamCube3_camera.xml"); } int m_DeviceNumber; }; } #endif