7 #include "PlusConfigure.h" 9 #include "vtkImageData.h" 10 #include "vtkMatrix4x4.h" 19 this->m_SendMessageType =
"TRACKEDFRAME";
30 igtl::MessageBase::Pointer clone;
32 vtkSmartPointer<vtkPlusIgtlMessageFactory> factory = vtkSmartPointer<vtkPlusIgtlMessageFactory>::New();
33 clone = dynamic_cast<igtl::MessageBase*>(factory->CreateSendMessage(this->GetMessageType(), this->GetHeaderVersion()).GetPointer());
36 igtl::PlusTrackedFrameMessage::Pointer msg = dynamic_cast<igtl::PlusTrackedFrameMessage*>(clone.GetPointer());
38 int bodySize = this->m_MessageSize - IGTL_HEADER_SIZE;
40 msg->CopyHeader(
this);
41 msg->AllocateBuffer(bodySize);
57 LOG_ERROR(
"Failed to pack Plus TrackedFrame message - unable to get tracked frame in xml data.");
62 if (frameSize[0] > static_cast<unsigned int>(std::numeric_limits<igtl_uint16>::max()) ||
63 frameSize[1] > static_cast<unsigned int>(std::numeric_limits<igtl_uint16>::max()) ||
64 frameSize[2] > static_cast<unsigned int>(std::numeric_limits<igtl_uint16>::max()))
66 LOG_ERROR(
"Frame size element is too large to be sent over OpenIGTLink. Cannot set tracked frame.");
76 unsigned int numberOfScalarComponents(1);
79 LOG_ERROR(
"Unable to retrieve number of scalar components.");
99 for (
int i = 0;
i < 4; ++
i)
101 for (
int j = 0; j < 4; ++j)
113 vtkSmartPointer<vtkMatrix4x4> mat(vtkSmartPointer<vtkMatrix4x4>::New());
114 for (
int i = 0;
i < 4; ++
i)
116 for (
int j = 0; j < 4; ++j)
195 LOG_ERROR(
"Failed to set tracked frame data from xml received in Plus TrackedFrame message");
204 LOG_ERROR(
"Failed to allocate memory for frame received in Plus TrackedFrame message");
igsioTrackedFrame m_TrackedFrame
igsioTrackedFrame GetTrackedFrame()
virtual int UnpackContent()
virtual int PackContent()
PlusStatus SetTrackedFrame(const igsioTrackedFrame &trackedFrame, const std::vector< igsioTransformName > &requestedTransforms)
vtkSmartPointer< vtkMatrix4x4 > GetEmbeddedImageTransform()
PlusTrackedFrameMessage()
virtual igtlUint64 CalculateContentBufferSize()
~PlusTrackedFrameMessage()
PlusStatus SetEmbeddedImageTransform(vtkSmartPointer< vtkMatrix4x4 > matrix)
std::string m_TrackedFrameXmlData
virtual igtl::MessageBase::Pointer Clone()
TrackedFrameHeader m_MessageHeader