Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkAbstractToFDeviceFactory.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 #ifndef __mitkAbstractToFDeviceFactory_h
17 #define __mitkAbstractToFDeviceFactory_h
18 
19 #include <MitkToFHardwareExports.h>
20 #include "mitkIToFDeviceFactory.h"
21 
22 // Microservices
23 #include <usServiceRegistration.h>
24 #include <usModuleResource.h>
25 
26 namespace mitk
27 {
36 struct MITKTOFHARDWARE_EXPORT AbstractToFDeviceFactory : public IToFDeviceFactory {
37  public:
38 
43  ToFCameraDevice::Pointer ConnectToFDevice();
44 
49  void DisconnectToFDevice(const ToFCameraDevice::Pointer& device);
50 
58  size_t GetNumberOfDevices();
59 
60  std::string GetCurrentDeviceName() override
61  {
62  std::stringstream name;
63  if(this->GetNumberOfDevices()>1)
64  {
65  name << this->GetDeviceNamePrefix()<< " "<< this->GetNumberOfDevices();
66  }
67  else
68  {
69  name << this->GetDeviceNamePrefix();
70  }
71  return name.str();
72  }
73 
74 protected:
75 
82  CameraIntrinsics::Pointer GetCameraIntrinsics();
83 
91  virtual us::ModuleResource GetIntrinsicsResource();
92 
97  std::vector<ToFCameraDevice::Pointer> m_Devices;
102  std::map<ToFCameraDevice*,us::ServiceRegistration<ToFCameraDevice> > m_DeviceRegistrations;
103 };
104 }
105 #endif
itk::SmartPointer< Self > Pointer
std::vector< ToFCameraDevice::Pointer > m_Devices
m_Devices A list (vector) containing all connected devices of the respective factory.
Virtual interface and base class for all Time-of-Flight device factories. The basic interface is in t...
DataCollection - Class to facilitate loading/accessing structured data.
std::string GetCurrentDeviceName() override
GetCurrentDeviceName Get the human readable name of the current device. A factory can produce many de...
This is the base of class for all ToFDeviceFactories.
std::map< ToFCameraDevice *, us::ServiceRegistration< ToFCameraDevice > > m_DeviceRegistrations
m_DeviceRegistrations A map containing all the pairs of device registration numbers and devices...