Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
igtl::TrackingDataMessage Class Reference

#include <igtlTrackingDataMessage.h>

Inheritance diagram for igtl::TrackingDataMessage:
Inheritance graph
[legend]
Collaboration diagram for igtl::TrackingDataMessage:
Collaboration graph
[legend]

Public Types

enum  {
  UNPACK_UNDEF = 0x0000 ,
  UNPACK_HEADER = 0x0001 ,
  UNPACK_BODY = 0x0002
}
 
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef TrackingDataMessage Self
 
typedef MessageBase Superclass
 

Public Member Functions

int AddTrackingDataElement (TrackingDataElement::Pointer &elem)
 
void AllocateBuffer ()
 
void AllocatePack ()
 
int CalculateReceiveContentSize ()
 
void ClearTrackingDataElements ()
 
virtual igtl::MessageBase::Pointer Clone ()
 
int Copy (const MessageBase *mb)
 
virtual LightObject::Pointer CreateAnother () const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
virtual void Delete ()
 
int GetBodySizeToRead ()
 
const charGetBodyType ()
 
voidGetBufferBodyPointer ()
 
int GetBufferBodySize ()
 
voidGetBufferPointer ()
 
int GetBufferSize ()
 
bool GetDebug () const
 
const charGetDeviceName ()
 
std::string GetDeviceName () const
 
const charGetDeviceType ()
 
unsigned short GetHeaderVersion () const
 
std::string GetMessageType () const
 
virtual const charGetNameOfClass () const
 
int GetNumberOfTrackingDataElement ()
 
int GetNumberOfTrackingDataElements ()
 
voidGetPackBodyPointer ()
 
int GetPackBodySize ()
 
voidGetPackPointer ()
 
int GetPackSize ()
 
virtual int GetReferenceCount () const
 
void GetTimeStamp (igtl::TimeStamp::Pointer &ts)
 
int GetTimeStamp (unsigned int *sec, unsigned int *frac)
 
void GetTrackingDataElement (int index, TrackingDataElement::Pointer &elem)
 
 igtlNewMacro (igtl::TrackingDataMessage)
 
 igtlTypeMacro (igtl::TrackingDataMessage, igtl::MessageBase)
 
 igtlTypeMacro (Object, LightObject)
 
void InitBuffer ()
 
void InitPack ()
 
virtual int Pack ()
 
void Print (std::ostream &os) const
 
virtual void Register () const
 
void SetDebug (bool debugFlag) const
 
void SetDeviceName (const char *name)
 
void SetDeviceName (const std::string &name)
 
void SetDeviceType (const std::string &type)
 
void SetHeaderVersion (unsigned short headerVersion)
 
virtual int SetMessageHeader (const MessageHeader *mb)
 
virtual void SetReferenceCount (int)
 
void SetTimeStamp (igtl::TimeStamp::Pointer &ts)
 
int SetTimeStamp (unsigned int sec, unsigned int frac)
 
int Unpack (int crccheck=0)
 
virtual void UnRegister () const
 

Static Public Member Functions

static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

virtual void AllocateBuffer (int contentSize)
 
virtual void AllocateUnpack (int bodySizeToRead)
 
virtual int CalculateContentBufferSize ()
 
int CopyBody (const MessageBase *mb)
 
int CopyHeader (const MessageBase *mb)
 
virtual int PackContent ()
 
 TrackingDataMessage ()
 
void UnpackBody (int crccheck, int &r)
 
virtual int UnpackContent ()
 
void UnpackHeader (int &r)
 
 ~TrackingDataMessage ()
 

Protected Attributes

unsigned charm_Body
 
int m_BodySizeToRead
 
unsigned charm_Content
 
std::string m_DeviceName
 
unsigned charm_Header
 
unsigned short m_HeaderVersion
 
bool m_IsBodyPacked
 
bool m_IsBodyUnpacked
 
bool m_IsHeaderUnpacked
 
int m_MessageSize
 
std::string m_ReceiveMessageType
 
std::string m_SendMessageType
 
unsigned int m_TimeStampSec
 
unsigned int m_TimeStampSecFraction
 
std::vector< TrackingDataElement::Pointerm_TrackingDataList
 
volatile int m_ReferenceCount
 
SimpleFastMutexLock m_ReferenceCountLock
 
virtual void PrintHeader (std::ostream &os) const
 
virtual void PrintTrailer (std::ostream &os) const
 
virtual void PrintSelf (std::ostream &os) const
 
static void SetGlobalWarningDisplay (bool flag)
 
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 

Detailed Description

The TDATA message type is intended for transferring 3D positions of surgical tools, markers etc. Those positions are often measured by optical, electromagnetic or other type of 3D position sensor continuously and transferred as series of messages. Since it is important for software that receives TDATA to control data flow, STT_TDATA query data type has interval field to control the frame rate of consecutive messages.

Definition at line 216 of file igtlTrackingDataMessage.h.

Member Typedef Documentation

◆ ConstPointer

Definition at line 222 of file igtlTrackingDataMessage.h.

◆ Pointer

Definition at line 221 of file igtlTrackingDataMessage.h.

◆ Self

Definition at line 219 of file igtlTrackingDataMessage.h.

◆ Superclass

Definition at line 220 of file igtlTrackingDataMessage.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited

Unpack status. They are returned by the Unpack() function.

Enumerator
UNPACK_UNDEF 
UNPACK_HEADER 
UNPACK_BODY 

Definition at line 95 of file igtlMessageBase.h.

Constructor & Destructor Documentation

◆ TrackingDataMessage()

igtl::TrackingDataMessage::TrackingDataMessage ( )
protected

◆ ~TrackingDataMessage()

igtl::TrackingDataMessage::~TrackingDataMessage ( )
protected

Member Function Documentation

◆ AddTrackingDataElement()

int igtl::TrackingDataMessage::AddTrackingDataElement ( TrackingDataElement::Pointer elem)

Adds tracking data element.

◆ AllocateBuffer() [1/2]

void igtl::MessageBase::AllocateBuffer ( )
inherited

AllocatePack() allocates memory for underlying buffer If m_BodySizeToRead > 0, we are allocating for receiving a message

◆ AllocateBuffer() [2/2]

virtual void igtl::MessageBase::AllocateBuffer ( int  contentSize)
protectedvirtualinherited

Allocates memory specifying the content size. Implicitly allocates extended header, metadata header and metadata in addition to content

Reimplemented in igtl::ImageMessage2.

◆ AllocatePack()

void igtl::MessageBase::AllocatePack ( )
inlineinherited

Definition at line 242 of file igtlMessageBase.h.

◆ AllocateUnpack()

virtual void igtl::MessageBase::AllocateUnpack ( int  bodySizeToRead)
protectedvirtualinherited

Allocates memory specifying the unpack content size Size of body to allocate is determined from v1 message header field 'body_size'

◆ BreakOnError()

static void igtl::LightObject::BreakOnError ( )
staticinherited

This method is called when igtlExceptionMacro executes. It allows the debugger to break on error.

◆ CalculateContentBufferSize()

virtual int igtl::TrackingDataMessage::CalculateContentBufferSize ( )
protectedvirtual

Gets the size of the serialized content.

Reimplemented from igtl::MessageBase.

◆ CalculateReceiveContentSize()

int igtl::MessageBase::CalculateReceiveContentSize ( )
inherited

Calculate the size of the received content data Returns -1 if the extended header has not been properly initialized (meta data size, meta data header size, etc...) Used when receiving data, not sending

◆ ClearTrackingDataElements()

void igtl::TrackingDataMessage::ClearTrackingDataElements ( )

Clears the all tracking data element in the list.

◆ Clone()

virtual igtl::MessageBase::Pointer igtl::MessageBase::Clone ( )
virtualinherited

Create a clone of this message, new memory but all internals are preserved.

◆ Copy()

int igtl::MessageBase::Copy ( const MessageBase mb)
inherited

Copy() copies contents from the specified Massage class. If the type of the specified class is the same as this class, general header and body are copied.

◆ CopyBody()

int igtl::MessageBase::CopyBody ( const MessageBase mb)
protectedinherited

Copies the serialized body data.

◆ CopyHeader()

int igtl::MessageBase::CopyHeader ( const MessageBase mb)
protectedinherited

Copies a header from given message.

◆ CreateAnother()

virtual LightObject::Pointer igtl::Object::CreateAnother ( ) const
virtualinherited

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from igtl::LightObject.

◆ DebugOff()

virtual void igtl::Object::DebugOff ( ) const
virtualinherited

Turn debugging output off.

◆ DebugOn()

virtual void igtl::Object::DebugOn ( ) const
virtualinherited

Turn debugging output on.

◆ Delete()

virtual void igtl::LightObject::Delete ( )
virtualinherited

Delete an igtl object. This method should always be used to delete an object when the new operator was used to create it. Using the C delete method will not work with reference counting.

◆ GetBodySizeToRead()

int igtl::MessageBase::GetBodySizeToRead ( )
inherited

GetBodySizeToRead() returns the size of the body to be read. This function must be called after the message header is set.

◆ GetBodyType()

const char * igtl::MessageBase::GetBodyType ( )
inherited

Gets the type of the body.

◆ GetBufferBodyPointer()

void * igtl::MessageBase::GetBufferBodyPointer ( )
inherited

Gets a pointer to the raw byte array for the serialized body data.

◆ GetBufferBodySize()

int igtl::MessageBase::GetBufferBodySize ( )
inherited

Gets the size of the serialized body data.

◆ GetBufferPointer()

void * igtl::MessageBase::GetBufferPointer ( )
inherited

Gets a pointer to the raw byte array for the serialized data including the header and the body.

◆ GetBufferSize()

int igtl::MessageBase::GetBufferSize ( )
inherited

Gets the size of the serialized message data.

◆ GetDebug()

bool igtl::Object::GetDebug ( ) const
inherited

Get the value of the debug flag.

◆ GetDeviceName() [1/2]

const char * igtl::MessageBase::GetDeviceName ( )
inherited

Gets the device name.

◆ GetDeviceName() [2/2]

std::string igtl::MessageBase::GetDeviceName ( ) const
inherited

Gets the device name.

◆ GetDeviceType()

const char * igtl::MessageBase::GetDeviceType ( )
inherited

Gets the device (message) type.

◆ GetGlobalWarningDisplay()

static bool igtl::Object::GetGlobalWarningDisplay ( )
staticinherited

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

◆ GetHeaderVersion()

unsigned short igtl::MessageBase::GetHeaderVersion ( ) const
inherited

Gets the message version number.

◆ GetMessageType()

std::string igtl::MessageBase::GetMessageType ( ) const
inherited

Gets the message type.

◆ GetNameOfClass()

virtual const char * igtl::LightObject::GetNameOfClass ( ) const
inlinevirtualinherited

Return the name of this class as a string. Used by the object factory (implemented in New()) to instantiate objects of a named type. Also used for debugging and other output information.

Definition at line 84 of file igtlLightObject.h.

◆ GetNumberOfTrackingDataElement()

int igtl::TrackingDataMessage::GetNumberOfTrackingDataElement ( )
inline

Definition at line 238 of file igtlTrackingDataMessage.h.

◆ GetNumberOfTrackingDataElements()

int igtl::TrackingDataMessage::GetNumberOfTrackingDataElements ( )

Gets the number of tracking data elements in the list.

◆ GetPackBodyPointer()

void * igtl::MessageBase::GetPackBodyPointer ( )
inlineinherited

Definition at line 218 of file igtlMessageBase.h.

◆ GetPackBodySize()

int igtl::MessageBase::GetPackBodySize ( )
inlineinherited

Definition at line 226 of file igtlMessageBase.h.

◆ GetPackPointer()

void * igtl::MessageBase::GetPackPointer ( )
inlineinherited

Definition at line 214 of file igtlMessageBase.h.

◆ GetPackSize()

int igtl::MessageBase::GetPackSize ( )
inlineinherited

Definition at line 222 of file igtlMessageBase.h.

◆ GetReferenceCount()

virtual int igtl::LightObject::GetReferenceCount ( ) const
inlinevirtualinherited

Gets the reference count on this object.

Definition at line 110 of file igtlLightObject.h.

◆ GetTimeStamp() [1/2]

void igtl::MessageBase::GetTimeStamp ( igtl::TimeStamp::Pointer ts)
inherited

Gets time of message creation.

◆ GetTimeStamp() [2/2]

int igtl::MessageBase::GetTimeStamp ( unsigned int sec,
unsigned int frac 
)
inherited

Gets time of message creation. 'sec' and 'frac' are seconds and fractions of a second respectively.

◆ GetTrackingDataElement()

void igtl::TrackingDataMessage::GetTrackingDataElement ( int  index,
TrackingDataElement::Pointer elem 
)

Gets the tracking data element specified by 'index'.

◆ GlobalWarningDisplayOff()

static void igtl::Object::GlobalWarningDisplayOff ( )
inlinestaticinherited

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Definition at line 116 of file igtlObject.h.

◆ GlobalWarningDisplayOn()

static void igtl::Object::GlobalWarningDisplayOn ( )
inlinestaticinherited

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Definition at line 114 of file igtlObject.h.

◆ igtlNewMacro()

igtl::TrackingDataMessage::igtlNewMacro ( igtl::TrackingDataMessage  )

◆ igtlTypeMacro() [1/2]

igtl::TrackingDataMessage::igtlTypeMacro ( igtl::TrackingDataMessage  ,
igtl::MessageBase   
)

◆ igtlTypeMacro() [2/2]

igtl::Object::igtlTypeMacro ( Object  ,
LightObject   
)
inherited

Standard part of all igtl objects.

◆ InitBuffer()

void igtl::MessageBase::InitBuffer ( )
inherited

Call InitPack() before receive header. This function simply resets the Unpacked flag for both the header and body pack Only allocate the original 58 byte header

◆ InitPack()

void igtl::MessageBase::InitPack ( )
inlineinherited

Definition at line 249 of file igtlMessageBase.h.

◆ New()

static Pointer igtl::Object::New ( )
staticinherited

Method for creation through the object factory.

◆ Pack()

virtual int igtl::MessageBase::Pack ( )
virtualinherited

Pack() serializes the header and body based on the member variables. PackContent() must be implemented in the child class.

Reimplemented in igtl::ImageMessage2.

◆ PackContent()

virtual int igtl::TrackingDataMessage::PackContent ( )
protectedvirtual

Packs (serialize) the content. Must be implemented in all child classes.

Reimplemented from igtl::MessageBase.

◆ Print()

void igtl::LightObject::Print ( std::ostream &  os) const
inherited

Cause the object to print itself out.

◆ PrintHeader()

virtual void igtl::LightObject::PrintHeader ( std::ostream &  os) const
protectedvirtualinherited

Number of uses of this object by other objects.

◆ PrintSelf()

virtual void igtl::Object::PrintSelf ( std::ostream &  os) const
protectedvirtualinherited

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from igtl::LightObject.

Reimplemented in igtl::ClientSocket, igtl::FastMutexLock, igtl::MultiThreader, igtl::MutexLock, igtl::ObjectFactoryBase, igtl::ServerSocket, igtl::Socket, and igtl::TimeStamp.

◆ PrintTrailer()

virtual void igtl::LightObject::PrintTrailer ( std::ostream &  os) const
protectedvirtualinherited

Number of uses of this object by other objects.

◆ Register()

virtual void igtl::Object::Register ( ) const
virtualinherited

Return this objects modified time.
Update the modification time for this object. Many filters rely on the modification time to determine if they need to recompute their data.
Increase the reference count (mark as used by another object).

Reimplemented from igtl::LightObject.

◆ SetDebug()

void igtl::Object::SetDebug ( bool  debugFlag) const
inherited

Set the value of the debug flag. A non-zero value turns debugging on.

◆ SetDeviceName() [1/2]

void igtl::MessageBase::SetDeviceName ( const char name)
inherited

Sets the device name.

◆ SetDeviceName() [2/2]

void igtl::MessageBase::SetDeviceName ( const std::string &  name)
inherited

Sets the device name.

◆ SetDeviceType()

void igtl::MessageBase::SetDeviceType ( const std::string &  type)
inherited

Sets the device (message) type.

◆ SetGlobalWarningDisplay()

static void igtl::Object::SetGlobalWarningDisplay ( bool  flag)
staticinherited

This is a global flag that controls whether any debug, warning or error messages are displayed.

◆ SetHeaderVersion()

void igtl::MessageBase::SetHeaderVersion ( unsigned short  headerVersion)
inherited

Sets the message version number.

◆ SetMessageHeader()

virtual int igtl::MessageBase::SetMessageHeader ( const MessageHeader mb)
virtualinherited

Sets the message header.

Reimplemented in igtl::PositionMessage.

◆ SetReferenceCount()

virtual void igtl::Object::SetReferenceCount ( int  )
virtualinherited

Sets the reference count (use with care)

Reimplemented from igtl::LightObject.

◆ SetTimeStamp() [1/2]

void igtl::MessageBase::SetTimeStamp ( igtl::TimeStamp::Pointer ts)
inherited

Sets time of message creation.

◆ SetTimeStamp() [2/2]

int igtl::MessageBase::SetTimeStamp ( unsigned int  sec,
unsigned int  frac 
)
inherited

Sets time of message creation. 'sec' and 'frac' are seconds and fractions of a second respectively.

◆ Unpack()

int igtl::MessageBase::Unpack ( int  crccheck = 0)
inherited

Unpack() deserializes the header and/or body, extracting data from the byte stream. If the header has already been deserilized, Unpack() deserializes only the body part. UnpackBody() must be implemented to deserialize the body part. Unpack() performs 64-bit CRC check, when crccheck = 1. It returns:

UNPACK_UNDEF : Nothing deserialized UNPACK_HEADER : The header has been deserialized. UNPACK_BODY : The body has been deserialized. If CRC check fails, Unpack() doesn't deserialize the body, thus it doesn't return UNPACK_BODY flag. UNPACK_HEADER|UNPACK_BODY: Both the header and body have been deserialized

◆ UnpackBody()

void igtl::MessageBase::UnpackBody ( int  crccheck,
int r 
)
protectedinherited

Unpack the body If it's a v3 message, body is ext header + content + metadataheader + metadata<optional>

◆ UnpackContent()

virtual int igtl::TrackingDataMessage::UnpackContent ( )
protectedvirtual

Unpacks (deserialize) the content. Must be implemented in all child classes.

Reimplemented from igtl::MessageBase.

◆ UnpackHeader()

void igtl::MessageBase::UnpackHeader ( int r)
protectedinherited

Unpack the first 58 bytes.

◆ UnRegister()

virtual void igtl::Object::UnRegister ( ) const
virtualinherited

Decrease the reference count (release by another object).

Reimplemented from igtl::LightObject.

Member Data Documentation

◆ m_Body

unsigned char* igtl::MessageBase::m_Body
protectedinherited

A pointer to the byte array for the serialized body. To prevent large copy of the byte array in the Pack() function, header byte array is concatenated to the byte array for the header.

Definition at line 308 of file igtlMessageBase.h.

◆ m_BodySizeToRead

int igtl::MessageBase::m_BodySizeToRead
protectedinherited

The size of the body to be read. This function must be called after the message header is set.

Definition at line 315 of file igtlMessageBase.h.

◆ m_Content

unsigned char* igtl::MessageBase::m_Content
protectedinherited

A pointer to the underlying content of a message.

Definition at line 311 of file igtlMessageBase.h.

◆ m_DeviceName

std::string igtl::MessageBase::m_DeviceName
protectedinherited

A character string for the device name (message name).

Definition at line 328 of file igtlMessageBase.h.

◆ m_Header

unsigned char* igtl::MessageBase::m_Header
protectedinherited

A pointer to the byte array for the serialized header. To prevent large copy of the byte array in the Pack() function, header byte array is concatenated to the byte array for the body.

Definition at line 303 of file igtlMessageBase.h.

◆ m_HeaderVersion

unsigned short igtl::MessageBase::m_HeaderVersion
protectedinherited

An unsigned short for the message format version.

Definition at line 325 of file igtlMessageBase.h.

◆ m_IsBodyPacked

bool igtl::MessageBase::m_IsBodyPacked
protectedinherited

Packing (serialization) status for the body.

Definition at line 345 of file igtlMessageBase.h.

◆ m_IsBodyUnpacked

bool igtl::MessageBase::m_IsBodyUnpacked
protectedinherited

Unpacking (deserialization) status for the body.

Definition at line 342 of file igtlMessageBase.h.

◆ m_IsHeaderUnpacked

bool igtl::MessageBase::m_IsHeaderUnpacked
protectedinherited

Unpacking (deserialization) status for the header.

Definition at line 339 of file igtlMessageBase.h.

◆ m_MessageSize

int igtl::MessageBase::m_MessageSize
protectedinherited

Definition at line 298 of file igtlMessageBase.h.

◆ m_ReceiveMessageType

std::string igtl::MessageBase::m_ReceiveMessageType
protectedinherited

A character string for the device type (message type). This will be used when the header is deserialized from a byte stream received from the network.

Definition at line 322 of file igtlMessageBase.h.

◆ m_ReferenceCount

volatile int igtl::LightObject::m_ReferenceCount
mutableprotectedinherited

Number of uses of this object by other objects.

Definition at line 131 of file igtlLightObject.h.

◆ m_ReferenceCountLock

SimpleFastMutexLock igtl::LightObject::m_ReferenceCountLock
mutableprotectedinherited

Mutex lock to protect modification to the reference count

Definition at line 134 of file igtlLightObject.h.

◆ m_SendMessageType

std::string igtl::MessageBase::m_SendMessageType
protectedinherited

A character string for the send device type (message type).

Definition at line 318 of file igtlMessageBase.h.

◆ m_TimeStampSec

unsigned int igtl::MessageBase::m_TimeStampSec
protectedinherited

A time stamp (second) for message creation. It consists of fields for seconds (m_TimeStampSec)and fractions of a second (m_TimeStampSecFraction).

Definition at line 332 of file igtlMessageBase.h.

◆ m_TimeStampSecFraction

unsigned int igtl::MessageBase::m_TimeStampSecFraction
protectedinherited

A time stamp (second) for message creation. It consists of fields for seconds (m_TimeStampSec)and fractions of a second (m_TimeStampSecFraction).

Definition at line 336 of file igtlMessageBase.h.

◆ m_TrackingDataList

std::vector<TrackingDataElement::Pointer> igtl::TrackingDataMessage::m_TrackingDataList
protected

The list of tracking data elements.

Definition at line 255 of file igtlTrackingDataMessage.h.


The documentation for this class was generated from the following file:

Generated for OpenIGTLink by Doxygen 1.9.8 written by Dimitri van Heesch, © 1997-2012