38 m_DeviceRegistrations.insert(std::make_pair(device.GetPointer(), context->RegisterService(device.GetPointer(),deviceProps)));
44 std::map<ToFCameraDevice*,us::ServiceRegistration<ToFCameraDevice> >::iterator i = m_DeviceRegistrations.find(device.GetPointer());
45 if (i == m_DeviceRegistrations.end())
return;
47 i->second.Unregister();
48 m_DeviceRegistrations.erase(i);
50 m_Devices.erase(std::remove(m_Devices.begin(), m_Devices.end(), device), m_Devices.end());
55 return m_Devices.size();
63 MITK_WARN <<
"Could not load resource '" << resource.
GetName() <<
"'. CameraIntrinsics are invalid!";
70 TiXmlDocument xmlDocument;
71 resStream >> xmlDocument;
74 TiXmlElement* element = xmlDocument.FirstChildElement();
76 intrinsics->FromXML(element);
84 return module->
GetResource(
"CalibrationFiles/Default_Parameters.xml");
85 MITK_WARN <<
"Loaded Default CameraIntrinsics. Overwrite AbstractToFDeviceFactory::GetIntrinsicsResource() if you want to define your own.";
itk::SmartPointer< Self > Pointer
std::vector< ToFCameraDevice::Pointer > m_Devices
m_Devices A list (vector) containing all connected devices of the respective factory.
std::string GetName() const
std::string GetCurrentDeviceName() override
GetCurrentDeviceName Get the human readable name of the current device. A factory can produce many de...
virtual ToFCameraDevice::Pointer CreateToFCameraDevice()=0
CreateToFCameraDevice Create a new device of the respective factory. E.g. a "KinectFactory" creates a...
CameraIntrinsics::Pointer GetCameraIntrinsics()
Returns the CameraIntrinsics for the cameras created by this factory.
vcl_size_t GetNumberOfDevices()
GetNumberOfDevices Get the number of devices produced by this factory. This function will return the ...
void DisconnectToFDevice(const ToFCameraDevice::Pointer &device)
DisconnectToFDevice Use this method to disconnect a device.
Module * GetModule() const
US_UNORDERED_MAP_TYPE< std::string, Any > ServiceProperties
ModuleResource GetResource(const std::string &path) const
virtual us::ModuleResource GetIntrinsicsResource()
Returns the ModuleResource that contains a xml definition of the CameraIntrinsics.
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.
ToFCameraDevice::Pointer ConnectToFDevice()
ConnectToFDevice Use this method to connect a device.
std::map< ToFCameraDevice *, us::ServiceRegistration< ToFCameraDevice > > m_DeviceRegistrations
m_DeviceRegistrations A map containing all the pairs of device registration numbers and devices...