Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
Virtual interface and base class for all Time-of-Flight device factories. The basic interface is in the base class: IToFDeviceFactory. This AbstractToFDeviceFactory implements some generic function which are useful for every device and not specific. More...
#include <mitkAbstractToFDeviceFactory.h>
Public Member Functions | |
ToFCameraDevice::Pointer | ConnectToFDevice () |
ConnectToFDevice Use this method to connect a device. More... | |
void | DisconnectToFDevice (const ToFCameraDevice::Pointer &device) |
DisconnectToFDevice Use this method to disconnect a device. More... | |
vcl_size_t | GetNumberOfDevices () |
GetNumberOfDevices Get the number of devices produced by this factory. This function will return the number of registered devices to account for created and disconnected devices. More... | |
std::string | GetCurrentDeviceName () override |
GetCurrentDeviceName Get the human readable name of the current device. A factory can produce many device and give ordered names for each device (e.g. number them like Device_1, Device_2, etc.). More... | |
![]() | |
virtual | ~IToFDeviceFactory () |
virtual std::string | GetFactoryName ()=0 |
GetFactoryName Get the human readable name of the factory. More... | |
virtual std::string | GetDeviceNamePrefix ()=0 |
virtual ToFCameraDevice::Pointer | CreateToFCameraDevice ()=0 |
CreateToFCameraDevice Create a new device of the respective factory. E.g. a "KinectFactory" creates a KinectDevice. More... | |
Protected Member Functions | |
CameraIntrinsics::Pointer | GetCameraIntrinsics () |
Returns the CameraIntrinsics for the cameras created by this factory. More... | |
virtual us::ModuleResource | GetIntrinsicsResource () |
Returns the ModuleResource that contains a xml definition of the CameraIntrinsics. More... | |
Protected Attributes | |
std::vector< ToFCameraDevice::Pointer > | m_Devices |
m_Devices A list (vector) containing all connected devices of the respective factory. More... | |
std::map< ToFCameraDevice *, us::ServiceRegistration< ToFCameraDevice > > | m_DeviceRegistrations |
m_DeviceRegistrations A map containing all the pairs of device registration numbers and devices. More... | |
Virtual interface and base class for all Time-of-Flight device factories. The basic interface is in the base class: IToFDeviceFactory. This AbstractToFDeviceFactory implements some generic function which are useful for every device and not specific.
Definition at line 32 of file mitkAbstractToFDeviceFactory.h.
mitk::ToFCameraDevice::Pointer mitk::AbstractToFDeviceFactory::ConnectToFDevice | ( | ) |
ConnectToFDevice Use this method to connect a device.
Definition at line 24 of file mitkAbstractToFDeviceFactory.cpp.
References mitk::IToFDeviceFactory::CreateToFCameraDevice(), GetCameraIntrinsics(), GetCurrentDeviceName(), us::GetModuleContext(), m_DeviceRegistrations, m_Devices, and mitk::CameraIntrinsicsProperty::New().
void mitk::AbstractToFDeviceFactory::DisconnectToFDevice | ( | const ToFCameraDevice::Pointer & | device | ) |
DisconnectToFDevice Use this method to disconnect a device.
device | The device you want to disconnect. |
Definition at line 38 of file mitkAbstractToFDeviceFactory.cpp.
References m_DeviceRegistrations, and m_Devices.
|
protected |
Returns the CameraIntrinsics for the cameras created by this factory.
This Method calls the virtual method GetIntrinsicsResource() to retrieve the necessary data. Override getIntrinsicsResource in your subclasses, also see the documentation of GetIntrinsicsResource
Definition at line 54 of file mitkAbstractToFDeviceFactory.cpp.
References GetIntrinsicsResource(), us::ModuleResource::GetName(), us::ModuleResource::IsValid(), MITK_WARN, and mitk::CameraIntrinsics::New().
Referenced by ConnectToFDevice().
|
inlineoverridevirtual |
GetCurrentDeviceName Get the human readable name of the current device. A factory can produce many device and give ordered names for each device (e.g. number them like Device_1, Device_2, etc.).
Implements mitk::IToFDeviceFactory.
Definition at line 56 of file mitkAbstractToFDeviceFactory.h.
Referenced by ConnectToFDevice().
|
protectedvirtual |
Returns the ModuleResource that contains a xml definition of the CameraIntrinsics.
The default implementation returns a default calibration. In subclasses, you can override this method to return a different xml resource. See this implementation for an example.
Definition at line 77 of file mitkAbstractToFDeviceFactory.cpp.
References ModuleContext::GetModule(), us::GetModuleContext(), us::Module::GetResource(), and MITK_WARN.
Referenced by GetCameraIntrinsics().
vcl_size_t mitk::AbstractToFDeviceFactory::GetNumberOfDevices | ( | ) |
GetNumberOfDevices Get the number of devices produced by this factory. This function will return the number of registered devices to account for created and disconnected devices.
Definition at line 49 of file mitkAbstractToFDeviceFactory.cpp.
References m_Devices.
|
protected |
m_DeviceRegistrations A map containing all the pairs of device registration numbers and devices.
Definition at line 98 of file mitkAbstractToFDeviceFactory.h.
Referenced by ConnectToFDevice(), and DisconnectToFDevice().
|
protected |
m_Devices A list (vector) containing all connected devices of the respective factory.
Definition at line 93 of file mitkAbstractToFDeviceFactory.h.
Referenced by ConnectToFDevice(), DisconnectToFDevice(), and GetNumberOfDevices().