Medical Imaging Interaction Toolkit  2018.4.99-87d68d9f
Medical Imaging Interaction Toolkit
mitk::AbstractToFDeviceFactory Struct Reference

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>

Inheritance diagram for mitk::AbstractToFDeviceFactory:
Collaboration diagram for mitk::AbstractToFDeviceFactory:

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...
 
- Public Member Functions inherited from mitk::IToFDeviceFactory
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...
 

Detailed Description

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.

Member Function Documentation

◆ ConnectToFDevice()

mitk::ToFCameraDevice::Pointer mitk::AbstractToFDeviceFactory::ConnectToFDevice ( )

◆ DisconnectToFDevice()

void mitk::AbstractToFDeviceFactory::DisconnectToFDevice ( const ToFCameraDevice::Pointer &  device)

DisconnectToFDevice Use this method to disconnect a device.

Parameters
deviceThe device you want to disconnect.

Definition at line 38 of file mitkAbstractToFDeviceFactory.cpp.

References m_DeviceRegistrations, and m_Devices.

◆ GetCameraIntrinsics()

mitk::CameraIntrinsics::Pointer mitk::AbstractToFDeviceFactory::GetCameraIntrinsics ( )
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().

◆ GetCurrentDeviceName()

std::string mitk::AbstractToFDeviceFactory::GetCurrentDeviceName ( )
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.).

Returns
The human readable name of the current device as string.

Implements mitk::IToFDeviceFactory.

Definition at line 56 of file mitkAbstractToFDeviceFactory.h.

Referenced by ConnectToFDevice().

◆ GetIntrinsicsResource()

us::ModuleResource mitk::AbstractToFDeviceFactory::GetIntrinsicsResource ( )
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().

◆ GetNumberOfDevices()

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.

Returns
Number of registered devices.

Definition at line 49 of file mitkAbstractToFDeviceFactory.cpp.

References m_Devices.

Member Data Documentation

◆ m_DeviceRegistrations

std::map<ToFCameraDevice*,us::ServiceRegistration<ToFCameraDevice> > mitk::AbstractToFDeviceFactory::m_DeviceRegistrations
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().

◆ m_Devices

std::vector<ToFCameraDevice::Pointer> mitk::AbstractToFDeviceFactory::m_Devices
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().


The documentation for this struct was generated from the following files: