15#ifndef __igtlQuaternionTrackingDataMessage_h
16#define __igtlQuaternionTrackingDataMessage_h
61 const char*
GetName() {
return this->m_Name.c_str(); };
67 igtlUint8
GetType() {
return this->m_Type; };
106 igtlFloat32 m_position[3];
109 igtlFloat32 m_quaternion[4];
177 virtual int PackBody() { AllocatePack();
return 1; };
202 void SetStatus(igtlUint8 status){ this->m_Status = status; }
Base class for most igtl classes.
igtlTypeMacro(igtl::QuaternionTrackingDataElement, igtl::Object)
int SetName(const char *name)
Sets the name of the instrument/tracker.
QuaternionTrackingDataElement()
void GetQuaternion(float q[4])
Gets the quaternion. The function substitutes the array of elements of the quaternion in 'q'.
SmartPointer< const Self > ConstPointer
const char * GetName()
Gets the name of the instrument/tracker.
int SetType(igtlUint8 type)
Sets the type of the instrument/tracker.
igtlUint8 m_Type
Tracking data type (TYPE_TRACKER, TYPE_6D, TYPE_3D, TYPE_5D)
igtlNewMacro(igtl::QuaternionTrackingDataElement)
void SetQuaternion(float qx, float qy, float qz, float w)
Sets the quaternion by elements of the quaternion (x, y, z and w).
QuaternionTrackingDataElement Self
igtlUint8 GetType()
Gets the type of the instrument/tracker.
void GetQuaternion(float *qx, float *qy, float *qz, float *w)
Gets the quaternion. The function substitutes the elements of the quaternion in 'qx',...
void SetPosition(float px, float py, float pz)
Sets the position by x, y, and z coordinates.
void GetPosition(float *px, float *py, float *pz)
Gets the position. The function substitutes the xyz coordinates in 'px', 'py', and 'pz'.
SmartPointer< Self > Pointer
void GetPosition(float p[3])
Gets the position. The function substitutes 3-element array of x, y and z coordinates in 'p'.
~QuaternionTrackingDataElement()
std::string m_Name
Name / description (< 20 bytes)
void SetQuaternion(float q[4])
Sets the quaternion by 4-element array.
void SetPosition(float p[3])
Sets the position by 3-element array of x, y, and z coordinates.
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
QuaternionTrackingDataMessage Self
int AddQuaternionTrackingDataElement(QuaternionTrackingDataElement::Pointer &elem)
Adds tracking data element.
void GetQuaternionTrackingDataElement(int index, QuaternionTrackingDataElement::Pointer &elem)
Gets the tracking data element specified by 'index'.
int GetNumberOfQuaternionTrackingDataElements()
Gets the number of tracking data elements in the list.
std::vector< QuaternionTrackingDataElement::Pointer > m_QuaternionTrackingDataList
The list of trakcing data elements.
~QuaternionTrackingDataMessage()
virtual int GetBodyPackSize()
Gets the size of the serialized body.
igtlTypeMacro(igtl::QuaternionTrackingDataMessage, igtl::MessageBase)
QuaternionTrackingDataMessage()
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
SmartPointer< Self > Pointer
igtlNewMacro(igtl::QuaternionTrackingDataMessage)
void ClearQuaternionTrackingDataElements()
Clears the all tracking data element in the list.
SmartPointer< const Self > ConstPointer
A class for the RTS_QTDATA message type.
void SetStatus(igtlUint8 status)
Sets the status. 'status' must be either STATUS_SUCCESS or STATUS_ERROR.
SmartPointer< const Self > ConstPointer
igtlUint8 m_Status
A variable to store the status.
SmartPointer< Self > Pointer
igtlNewMacro(igtl::RTSQuaternionTrackingDataMessage)
RTSQuaternionTrackingDataMessage Self
~RTSQuaternionTrackingDataMessage()
virtual int GetBodyPackSize()
Gets the size of the serialized body.
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
igtlTypeMacro(igtl::RTSQuaternionTrackingDataMessage, igtl::MessageBase)
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
RTSQuaternionTrackingDataMessage()
igtlUint8 GetStatus()
Gets the status. The function returns either STATUS_SUCCESS or STATUS_ERROR.
Implements transparent reference counting.
A class for the STT_QTDATA message type.
igtlNewMacro(igtl::StartQuaternionTrackingDataMessage)
StartQuaternionTrackingDataMessage Self
SmartPointer< Self > Pointer
const char * GetCoordinateName()
Gets the name of the coordinate system.
StartQuaternionTrackingDataMessage()
SmartPointer< const Self > ConstPointer
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
void SetResolution(igtlInt32 res)
Sets the time resolution for streaming of QTDATA messages.
igtlTypeMacro(igtl::StartQuaternionTrackingDataMessage, igtl::MessageBase)
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
int SetCoordinateName(const char *name)
Sets the name of the coordinate system. The name must be defined by the user.
~StartQuaternionTrackingDataMessage()
std::string m_CoordinateName
Name of the coordinate system.
virtual int GetBodyPackSize()
Gets the size of the serialized body.
igtlInt32 m_Resolution
Minimum time between two frames (ms). Use 0 for as fast as possible.
igtlInt32 GetResolution()
Gets the time resolution for streaming of QTDATA messages.
SmartPointer< Self > Pointer
~StopQuaternionTrackingDataMessage()
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
StopQuaternionTrackingDataMessage Self
igtlTypeMacro(igtl::StopQuaternionTrackingDataMessage, igtl::MessageBase)
SmartPointer< const Self > ConstPointer
virtual int GetBodyPackSize()
Gets the size of the serialized body.
igtlNewMacro(igtl::StopQuaternionTrackingDataMessage)
StopQuaternionTrackingDataMessage()
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...