19 #include "mitkIGTHardwareException.h"
22 #include <itksys/SystemTools.hxx>
23 #include <itkMutexLockHolder.h>
33 const unsigned char CR = 0xD;
34 const unsigned char LF = 0xA;
41 m_IlluminationActivationRate(
Hz20), m_DataTransferMode(
TX), m_6DTools(), m_ToolsMutex(nullptr),
42 m_SerialCommunication(nullptr), m_SerialCommunicationMutex(nullptr), m_DeviceProtocol(nullptr),
43 m_MultiThreader(nullptr), m_ThreadID(0), m_OperationMode(
ToolTracking6D), m_MarkerPointsMutex(nullptr), m_MarkerPoints()
60 if (this->GetState() !=
Setup)
63 if (ndiTool ==
nullptr)
76 returnvalue = m_DeviceProtocol->PINIT(&portHandle);
99 if (GetState() == Tracking)
101 this->StopTracking();
103 if (GetState() == Ready)
105 this->CloseConnection();
108 if ((m_ThreadID != 0) && (m_MultiThreader.IsNotNull()))
110 m_MultiThreader->TerminateThread(m_ThreadID);
112 m_MultiThreader =
nullptr;
114 if (m_SerialCommunication.IsNotNull())
116 m_SerialCommunication->ClearReceiveBuffer();
117 m_SerialCommunication->ClearSendBuffer();
118 m_SerialCommunication->CloseConnection();
119 m_SerialCommunication =
nullptr;
126 if (this->GetState() !=
Setup)
128 itkDebugMacro(
"setting PortNumber to " << _arg);
129 if (this->m_PortNumber != _arg)
131 this->m_PortNumber = _arg;
139 if (this->GetState() !=
Setup)
141 itkDebugMacro(
"setting eviceName to " << _arg);
142 if (this->m_DeviceName != _arg)
144 this->m_DeviceName = _arg;
152 if (this->GetState() !=
Setup)
154 itkDebugMacro(
"setting BaudRate to " << _arg);
155 if (this->m_BaudRate != _arg)
157 this->m_BaudRate = _arg;
165 if (this->GetState() !=
Setup)
167 itkDebugMacro(
"setting DataBits to " << _arg);
168 if (this->m_DataBits != _arg)
170 this->m_DataBits = _arg;
178 if (this->GetState() !=
Setup)
180 itkDebugMacro(
"setting Parity to " << _arg);
181 if (this->m_Parity != _arg)
183 this->m_Parity = _arg;
191 if (this->GetState() !=
Setup)
193 itkDebugMacro(
"setting StopBits to " << _arg);
194 if (this->m_StopBits != _arg)
196 this->m_StopBits = _arg;
204 if (this->GetState() !=
Setup)
206 itkDebugMacro(
"setting HardwareHandshake to " << _arg);
207 if (this->m_HardwareHandshake != _arg)
209 this->m_HardwareHandshake = _arg;
217 if (this->GetState() == Tracking)
219 itkDebugMacro(
"setting IlluminationActivationRate to " << _arg);
220 if (this->m_IlluminationActivationRate != _arg)
222 this->m_IlluminationActivationRate = _arg;
224 if (this->GetState() == Ready)
225 m_DeviceProtocol->IRATE(this->m_IlluminationActivationRate);
232 itkDebugMacro(
"setting DataTransferMode to " << _arg);
233 if (this->m_DataTransferMode != _arg)
235 this->m_DataTransferMode = _arg;
243 if (input ==
nullptr)
249 message = *input + CalcCRC(input) + std::string(1,
CR);
251 message = *input + std::string(1,
CR);
256 this->ClearSendBuffer();
259 long returnvalue = m_SerialCommunication->Send(message);
261 if (returnvalue == 0)
270 if (answer ==
nullptr)
274 long returnvalue = m_SerialCommunication->Receive(*answer, numberOfBytes);
276 if (returnvalue == 0)
285 if (answer ==
nullptr)
292 long returnvalue = m_SerialCommunication->Receive(m, 1);
294 if ((returnvalue == 0) ||(m.size() != 1))
304 if (answer ==
nullptr)
313 long returnvalue = m_SerialCommunication->Receive(m, 1);
314 if ((returnvalue == 0) ||(m.size() != 1))
317 }
while (m.at(0) !=
LF);
325 m_SerialCommunication->ClearSendBuffer();
332 m_SerialCommunication->ClearReceiveBuffer();
339 if (input ==
nullptr)
342 static int oddparity[16] = {0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0};
344 unsigned int crcValue = 0;
345 unsigned int* puCRC16 = &crcValue;
346 for (
unsigned int i = 0; i < input->length(); i++)
349 data = (data ^ (*(puCRC16) & 0xff)) & 0xff;
351 if (oddparity[data & 0x0f] ^ oddparity[data >> 4])
353 *(puCRC16) ^= 0xc001;
361 char returnvalue[13];
362 sprintf(returnvalue,
"%04X", crcValue);
363 return std::string(returnvalue);
370 if (this->GetState() !=
Setup)
377 if (m_DeviceName.empty())
378 m_SerialCommunication->SetPortNumber(m_PortNumber);
380 m_SerialCommunication->SetDeviceName(m_DeviceName);
385 m_SerialCommunication->SetSendTimeout(5000);
386 m_SerialCommunication->SetReceiveTimeout(5000);
387 if (m_SerialCommunication->OpenConnection() == 0)
389 m_SerialCommunication->CloseConnection();
390 m_SerialCommunication =
nullptr;
395 m_SerialCommunication->SendBreak(400);
398 static const std::string reset(
"RESETBE6F\r");
399 std::string answer =
"";
400 this->Receive(&answer, reset.length());
401 this->ClearReceiveBuffer();
402 if (reset.compare(answer) != 0)
404 if (m_SerialCommunication.IsNotNull())
406 m_SerialCommunication->CloseConnection();
407 m_SerialCommunication =
nullptr;
416 returnvalue = m_DeviceProtocol->COMM(m_BaudRate, m_DataBits, m_Parity, m_StopBits, m_HardwareHandshake);
422 itksys::SystemTools::Delay(500);
425 m_SerialCommunication->CloseConnection();
426 m_SerialCommunication->SetBaudRate(m_BaudRate);
427 m_SerialCommunication->SetDataBits(m_DataBits);
428 m_SerialCommunication->SetParity(m_Parity);
429 m_SerialCommunication->SetStopBits(m_StopBits);
430 m_SerialCommunication->SetHardwareHandshake(m_HardwareHandshake);
431 m_SerialCommunication->SetSendTimeout(5000);
432 m_SerialCommunication->SetReceiveTimeout(5000);
433 m_SerialCommunication->OpenConnection();
437 returnvalue = m_DeviceProtocol->INIT();
444 returnvalue = m_DeviceProtocol->VER(deviceType);
447 this->SetType(deviceType);
493 returnvalue = FreePortHandles();
502 std::string portHandle;
503 auto endIt = m_6DTools.end();
504 for(
auto it = m_6DTools.begin(); it != endIt; ++it)
507 returnvalue = m_DeviceProtocol->PHRQ(&portHandle);
510 (*it)->SetPortHandle(portHandle.c_str());
514 returnvalue = m_DeviceProtocol->PVWR(&portHandle, (*it)->GetSROMData(), (*it)->GetSROMDataLength());
518 returnvalue = m_DeviceProtocol->PINIT(&portHandle);
522 if ((*it)->IsEnabled() ==
true)
524 returnvalue = m_DeviceProtocol->PENA(&portHandle, (*it)->GetTrackingPriority());
528 std::string(
"' for tool '")+ (*it)->GetToolName() + std::string(
"'")).c_str();
537 if (this->DiscoverWiredTools() ==
false)
544 returnvalue = m_DeviceProtocol->IRATE(this->m_IlluminationActivationRate);
549 this->SetState(Ready);
552 SetVolume(this->m_Data);
565 std::string portHandle;
566 returnvalue = m_DeviceProtocol->PHSR(
OCCUPIED, &portHandle);
574 for (
unsigned int i = 0; i < portHandle.size(); i += 2)
576 ph = portHandle.substr(i, 2);
588 returnvalue = m_DeviceProtocol->PINIT(&ph);
598 std::string(
"' for tool '")+ pt->
GetToolName() + std::string(
"'")).c_str();
608 if (this->GetState() !=
Setup)
620 if (m_DeviceName.empty())
621 m_SerialCommunication->SetPortNumber(m_PortNumber);
623 m_SerialCommunication->SetDeviceName(m_DeviceName);
629 m_SerialCommunication->SetSendTimeout(5000);
630 m_SerialCommunication->SetReceiveTimeout(5000);
631 if (m_SerialCommunication->OpenConnection() == 0)
633 m_SerialCommunication =
nullptr;
638 m_SerialCommunication->SendBreak(400);
641 static const std::string reset(
"RESETBE6F\r");
642 std::string answer =
"";
643 this->Receive(&answer, reset.length());
644 this->ClearReceiveBuffer();
645 if (reset.compare(answer) != 0)
647 m_SerialCommunication->CloseConnection();
648 m_SerialCommunication =
nullptr;
665 returnvalue = m_DeviceProtocol->VER(deviceType);
668 m_SerialCommunication =
nullptr;
671 m_SerialCommunication =
nullptr;
678 if (this->GetState() !=
Setup)
681 m_DeviceProtocol->INIT();
683 m_SerialCommunication->CloseConnection();
685 this->InvalidateAll();
687 this->SetState(
Setup);
688 m_SerialCommunication =
nullptr;
697 struct itk::MultiThreader::ThreadInfoStruct * pInfo = (
struct itk::MultiThreader::ThreadInfoStruct*)pInfoStruct;
698 if (pInfo ==
nullptr)
700 return ITK_THREAD_RETURN_VALUE;
702 if (pInfo->UserData ==
nullptr)
704 return ITK_THREAD_RETURN_VALUE;
707 if (trackingDevice !=
nullptr)
721 return ITK_THREAD_RETURN_VALUE;
727 if (this->GetState() != Ready)
730 this->SetState(Tracking);
731 this->m_StopTrackingMutex->Lock();
732 this->m_StopTracking =
false;
733 this->m_StopTrackingMutex->Unlock();
735 m_ThreadID = m_MultiThreader->SpawnThread(this->ThreadStartTracking,
this);
746 if (this->GetState() != Tracking)
750 returnvalue = m_DeviceProtocol->TSTART();
756 bool localStopTracking;
757 this->m_StopTrackingMutex->Lock();
758 localStopTracking = this->m_StopTracking;
759 this->m_StopTrackingMutex->Unlock();
760 while ((this->GetState() == Tracking) && (localStopTracking ==
false))
762 if (this->m_DataTransferMode ==
TX)
764 returnvalue = this->m_DeviceProtocol->TX();
770 returnvalue = this->m_DeviceProtocol->BX();
775 this->m_StopTrackingMutex->Lock();
776 localStopTracking = m_StopTracking;
777 this->m_StopTrackingMutex->Unlock();
781 returnvalue = m_DeviceProtocol->TSTOP();
796 if (this->GetState() != Tracking)
801 returnvalue = m_DeviceProtocol->DSTART();
805 bool localStopTracking;
806 this->m_StopTrackingMutex->Lock();
807 localStopTracking = this->m_StopTracking;
808 this->m_StopTrackingMutex->Unlock();
809 while ((this->GetState() == Tracking) && (localStopTracking ==
false))
811 m_MarkerPointsMutex->Lock();
812 returnvalue = this->m_DeviceProtocol->POS3D(&m_MarkerPoints);
813 m_MarkerPointsMutex->Unlock();
816 std::cout <<
"Error in POS3D: could not read data. Possibly no markers present." << std::endl;
819 this->m_StopTrackingMutex->Lock();
820 localStopTracking = m_StopTracking;
821 this->m_StopTrackingMutex->Unlock();
823 itksys::SystemTools::Delay(1);
826 returnvalue = m_DeviceProtocol->DSTOP();
830 this->SetState(Ready);
844 returnvalue = m_DeviceProtocol->TSTART();
848 bool localStopTracking;
849 this->m_StopTrackingMutex->Lock();
850 localStopTracking = this->m_StopTracking;
851 this->m_StopTrackingMutex->Unlock();
852 while ((this->GetState() == Tracking) && (localStopTracking ==
false))
854 m_MarkerPointsMutex->Lock();
855 returnvalue = this->m_DeviceProtocol->TX(
true, &m_MarkerPoints);
856 m_MarkerPointsMutex->Unlock();
859 std::cout <<
"Error in TX: could not read data. Possibly no markers present." << std::endl;
862 this->m_StopTrackingMutex->Lock();
863 localStopTracking = m_StopTracking;
864 this->m_StopTrackingMutex->Unlock();
868 returnvalue = m_DeviceProtocol->TSTOP();
872 this->SetState(Ready);
880 if (toolNumber < m_6DTools.size())
881 return m_6DTools.at(toolNumber);
889 auto end = m_6DTools.end();
890 for (
auto iterator = m_6DTools.begin(); iterator != end; ++iterator)
891 if (name.compare((*iterator)->GetToolName()) == 0)
900 auto end = m_6DTools.end();
901 for (
auto iterator = m_6DTools.begin(); iterator != end; ++iterator)
902 if (portHandle.compare((*iterator)->GetPortHandle()) == 0)
911 return m_6DTools.size();
917 if (this->GetState() !=
Setup)
919 return (m_DeviceProtocol->BEEP(count) ==
NDIOKAY);
930 if (t->LoadSROMFile(fileName) ==
false)
932 t->SetToolName(toolName);
933 t->SetTrackingPriority(p);
934 if (this->InternalAddTool(t) ==
false)
936 return t.GetPointer();
946 if (this->GetState() == Ready)
949 std::string newPortHandle;
951 returnvalue = m_DeviceProtocol->PHRQ(&newPortHandle);
956 returnvalue = m_DeviceProtocol->PVWR(&newPortHandle, p->GetSROMData(), p->GetSROMDataLength());
960 returnvalue = m_DeviceProtocol->PINIT(&newPortHandle);
964 std::string(
"' for tool '")+ p->GetToolName() + std::string(
"'")).c_str();
967 if (p->IsEnabled() ==
true)
969 returnvalue = m_DeviceProtocol->PENA(&newPortHandle, p->GetTrackingPriority());
973 std::string(
"' for tool '")+ p->GetToolName() + std::string(
"'")).c_str();
978 m_ToolsMutex->Lock();
979 this->m_6DTools.push_back(p);
980 m_ToolsMutex->Unlock();
984 else if (this->GetState() ==
Setup)
987 m_ToolsMutex->Lock();
988 this->m_6DTools.push_back(p);
989 m_ToolsMutex->Unlock();
1001 if (ndiTool ==
nullptr)
1008 if ((portHandle.length() == 2) && (this->GetState() == Ready))
1011 returnvalue = m_DeviceProtocol->PHF(&portHandle);
1016 auto end = m_6DTools.end();
1017 for (
auto iterator = m_6DTools.begin(); iterator != end; ++iterator)
1019 if (iterator->GetPointer() == ndiTool)
1021 m_6DTools.erase(iterator);
1028 else if (this->GetState() ==
Setup)
1031 auto end = m_6DTools.end();
1032 for (
auto iterator = m_6DTools.begin(); iterator != end; ++iterator)
1034 if ((*iterator).GetPointer() == ndiTool)
1036 m_6DTools.erase(iterator);
1050 auto end = m_6DTools.end();
1051 for (
auto iterator = m_6DTools.begin(); iterator != end; ++iterator)
1052 (*iterator)->SetDataValid(
false);
1058 if (GetState() == Tracking)
1061 m_OperationMode = mode;
1068 return m_OperationMode;
1074 m_MarkerPointsMutex->Lock();
1075 *markerpositions = m_MarkerPoints;
1076 m_MarkerPointsMutex->Unlock();
1077 return (markerpositions->size() != 0) ;
1084 this->FreePortHandles();
1088 std::string portHandle;
1089 returnvalue = m_DeviceProtocol->PHSR(
OCCUPIED, &portHandle);
1098 std::vector<int> occupiedPorts = std::vector<int>();
1099 int numberOfToolsAtStart = this->GetToolCount();
1101 for (
unsigned int i = 0; i < portHandle.size(); i += 2)
1103 ph = portHandle.substr(i, 2);
1104 if (this->GetInternalTool(ph) !=
nullptr)
1109 newTool->SetPortHandle(ph.c_str());
1113 newTool->SetToolName((std::string(
"Port ") + ph).c_str());
1115 returnvalue = m_DeviceProtocol->PINIT(&ph);
1121 std::string(
"' for tool '")+ newTool->GetToolName() + std::string(
"'")).c_str();
1124 returnvalue = m_DeviceProtocol->PENA(&ph, newTool->GetTrackingPriority());
1128 std::string(
"' for tool '")+ newTool->GetToolName() + std::string(
"'")).c_str();
1132 if (this->InternalAddTool(newTool) ==
false)
1134 else occupiedPorts.push_back(i);
1139 for (
unsigned int i = 0; i < occupiedPorts.size(); i++)
1141 ph = portHandle.substr(occupiedPorts.at(i), 2);
1142 std::string portInfo;
1143 NDIErrorCode returnvaluePort = m_DeviceProtocol->PHINF(ph, &portInfo);
1144 if ((returnvaluePort==
NDIOKAY) && (portInfo.size()>31))
dynamic_cast<mitk::NDIPassiveTool*
>(this->GetTool(i+numberOfToolsAtStart))->SetSerialNumber(portInfo.substr(23,8));
1145 itksys::SystemTools::Delay(10);
1156 std::string portHandle;
1157 returnvalue = m_DeviceProtocol->PHSR(
FREED, &portHandle);
1162 if (portHandle.empty() ==
true)
1166 for (
unsigned int i = 0; i < portHandle.size(); i += 2)
1168 ph = portHandle.substr(i, 2);
1173 if (this->RemoveTool(t) ==
false)
1178 returnvalue = m_DeviceProtocol->PHF(&ph);
1190 std::string revision;
1191 if (m_DeviceProtocol->APIREV(&revision) !=
mitk::NDIOKAY || revision.empty() || (revision.size() != 9) )
1193 MITK_ERROR <<
"Could not receive firmware revision number!";
1197 const std::string majrevno = revision.substr(2,3);
1199 return std::atoi(majrevno.c_str());
1204 static std::string revision;
1205 if (m_DeviceProtocol->APIREV(&revision) !=
mitk::NDIOKAY || revision.empty() || (revision.size() != 9) )
1207 MITK_ERROR <<
"Could not receive firmware revision number!";
1209 return revision.c_str();
1211 return revision.c_str();
1216 if (numberOfVolumes ==
nullptr || volumes ==
nullptr || volumesDimensions ==
nullptr)
1219 static std::string
info;
1220 if (m_DeviceProtocol->SFLIST(&info) !=
mitk::NDIOKAY || info.empty())
1222 MITK_ERROR <<
"Could not receive tracking volume information of tracking system!";
1229 (*numberOfVolumes) = (
unsigned int) std::atoi(info.substr(0,1).c_str());
1231 for (
unsigned int i=0; i<(*numberOfVolumes); i++)
1236 std::string::size_type
offset, end;
1239 std::string currentVolume = info.substr(offset, end);
1242 currentVolume = currentVolume.substr(1, currentVolume.size());
1249 currentVolume = currentVolume.substr(1,currentVolume.size());
1260 for (
unsigned int index = 0; index < 10; index++)
1262 std::string::size_type offD, endD;
1265 int dimension = std::atoi(currentVolume.substr(offD, endD).c_str());
1267 volumesDimensions->push_back(dimension);
NDIProtocol::Pointer m_DeviceProtocol
create and parse NDI protocol strings
NDIErrorCode ReceiveByte(char *answer)
lightweight receive function, that reads just one byte
An object of this class represents an exception of the MITK-IGT module which are releated to the hard...
itk::MutexLockHolder< itk::FastMutexLock > MutexLockHolder
virtual bool GetMarkerPositions(MarkerPointContainerType *markerpositions)
Get 3D marker positions (operation mode must be set to MarkerTracking3D or HybridTracking) ...
NDIPassiveTool * GetInternalTool(std::string portHandle)
returns the tool object that has been assigned the port handle or NULL if no tool can be found ...
NDIErrorCode FreePortHandles()
free all port handles that need to be freed
itk::SmartPointer< Self > Pointer
std::vector< std::string > NDITrackingVolumeContainerType
vector of tracking volumes
virtual bool InternalAddTool(NDIPassiveTool *tool)
Add a passive 6D tool to the list of tracked tools. This method is used by AddTool.
virtual bool UpdateTool(mitk::TrackingTool *tool)
reloads the srom file and reinitializes the tool
virtual bool OpenConnection() override
Set the type of the NDI Tracking Device because it can not jet handle this itself.
OperationMode
Error codes of NDI tracking devices.
virtual int GetMajorFirmwareRevisionNumber()
Get major revision number from tracking device should not be called directly after starting to track...
virtual void SetBaudRate(const BaudRate _arg)
returns the device name for serial communication
NDIErrorCode Send(const std::string *message, bool addCRC=true)
Send message to tracking device.
int m_ThreadID
ID of tracking thread.
IlluminationActivationRate
activation rate of IR illuminator for NDI Polaris tracking device
NDIErrorCode Receive(std::string *answer, unsigned int numberOfBytes)
receive numberOfBytes bytes from tracking device
An object of this class represents an exception of the MITK-IGT module.
virtual bool RemoveTool(TrackingTool *tool)
Remove a passive 6D tool from the list of tracked tools.
virtual void TrackTools()
TrackTools() continuously polls serial interface for new 6d tool positions until StopTracking is call...
DataCollection - Class to facilitate loading/accessing structured data.
virtual void SetDataBits(const DataBits _arg)
returns the baud rate for serial communication
virtual void SetDataTransferMode(const DataTransferMode _arg)
returns the activation rate of IR illumator for polaris
Tool6DContainerType m_6DTools
list of 6D tools
virtual void TrackToolsAndMarkers()
continuously polls serial interface for new 3D marker positions and 6D tool positions until StopTrack...
virtual bool GetSupportedVolumes(unsigned int *numberOfVolumes, NDITrackingVolumeContainerType *volumes, TrackingVolumeDimensionType *volumesDimensions)
Get number of supported tracking volumes, a vector containing the supported volumes and a vector cont...
static ITK_THREAD_RETURN_TYPE ThreadStartTracking(void *data)
static start method for the tracking thread.
virtual void InvalidateAll()
invalidate all tools
virtual void SetIlluminationActivationRate(const IlluminationActivationRate _arg)
returns the hardware handshake setting
static void info(const char *fmt,...)
virtual OperationMode GetOperationMode()
get current operation mode
itk::MultiThreader::Pointer m_MultiThreader
creates tracking thread that continuously polls serial interface for new tracking data ...
NDIErrorCode ReceiveLine(std::string *answer)
receive characters until the first LF (The LF is included in the answer string)
virtual bool SetVolume(mitk::TrackingDeviceData volume)
Sets the desired tracking volume. Returns true if the volume type could be set. It is set in the Open...
virtual void SetStopBits(const StopBits _arg)
returns the parity mode
bool DiscoverWiredTools()
retrieves all wired tools from the tracking device
const std::string CalcCRC(const std::string *input)
returns the CRC16 for input as a std::string
virtual void SetParity(const Parity _arg)
returns the data bits for serial communication
std::vector< int > TrackingVolumeDimensionType
List of the supported tracking volume dimensions.
void ClearReceiveBuffer()
empty receive buffer of serial communication interface
Interface for all Tracking Devices.
virtual mitk::TrackingDeviceType TestConnection()
TestConnection() tries to connect to a NDI tracking device on the current port/device and returns whi...
NDITrackingDevice()
Constructor.
static IGTTimeStamp * GetInstance()
returns a pointer to the current instance of mitkTimeStamp
std::vector< MarkerPointType > MarkerPointContainerType
virtual void TrackMarkerPositions()
continuously polls serial interface for new 3D marker positions until StopTracking is called...
itk::FastMutexLock::Pointer m_MarkerPointsMutex
mutex for marker point data container
void Start(itk::Object::Pointer device)
starts the time-acquisition
virtual void SetHardwareHandshake(const HardwareHandshake _arg)
returns the number of stop bits
virtual TrackingTool * GetTool(unsigned int toolNumber) const override
return the tool with index toolNumber
virtual const char * GetFirmwareRevisionNumber()
Get revision number from tracking device as string should not be called directly after starting to tr...
serial communication interface
void ClearSendBuffer()
empty send buffer of serial communication interface
virtual void SetPortNumber(const PortNumber _arg)
set port number for serial communication
TrackingDeviceData m_Data
current device Data
#define mitkThrowException(classname)
std::string TrackingDeviceType
virtual unsigned int GetToolCount() const override
return current number of tools
mitk::TrackingTool * AddTool(const char *toolName, const char *fileName, TrackingPriority p=NDIPassiveTool::Dynamic)
Create a passive 6D tool with toolName and fileName and add it to the list of tools.
virtual void SetRotationMode(RotationMode r) override
superclass for specific NDI tracking Devices that use serial communication.
virtual bool Beep(unsigned char count)
returns the data transfer mode
NDIErrorCode
Error codes of NDI tracking devices.
MarkerPointContainerType m_MarkerPoints
container for markers (3D point tracking mode)
DataTransferMode
Data transfer mode for NDI tracking devices.
virtual void SetDeviceName(std::string _arg)
returns the port number for serial communication
virtual bool CloseConnection() override
Closes the connection.
virtual bool SetOperationMode(OperationMode mode)
set operation mode to 6D tool tracking, 3D marker tracking or 6D&3D hybrid tracking (see OperationMod...
virtual ~NDITrackingDevice()
Destructor.
bool InitializeWiredTools()
itk::FastMutexLock::Pointer m_SerialCommunicationMutex
mutex for coordinated access of serial communication interface
virtual bool StartTracking() override
Start the tracking.
itk::FastMutexLock::Pointer m_ToolsMutex
mutex for coordinated access of tool container
virtual mitk::TrackingTool * GetToolByName(std::string name) const override
Returns the tool with the given tool name.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.