22 m_DataValid(false), m_IGTTimeStamp(0.0), m_Name()
43 this->SetMessage(message);
53 msg =
dynamic_cast<const Self *
>(data);
57 itkExceptionMacro( <<
"mitk::IGTLMessage::Graft cannot cast "
58 <<
typeid(data).name() <<
" to "
59 <<
typeid(
const Self *).name() );
65 itkExceptionMacro( <<
"mitk::IGTLMessage::Graft cannot cast "
66 <<
typeid(data).name() <<
" to "
67 <<
typeid(
const Self *).name() );
71 this->SetMessage(msg->GetMessage());
72 this->SetDataValid(msg->IsDataValid());
73 this->SetIGTTimeStamp(msg->GetIGTTimeStamp());
74 this->SetName(msg->GetName());
81 unsigned int frac = 0;
82 m_Message->GetTimeStamp(&ts, &frac);
83 this->SetIGTTimeStamp((
double)ts + (
double)frac/1000.0);
84 this->SetDataValid(
true);
95 this->Superclass::PrintSelf(os, indent);
96 os << indent <<
"name: " << this->
GetName() << std::endl;
97 os << indent <<
"data valid: " << this->IsDataValid() << std::endl;
98 os << indent <<
"TimeStamp: " << this->GetIGTTimeStamp() << std::endl;
99 os << indent <<
"OpenIGTLinkMessage: " << std::endl;
100 m_Message->Print(os);
106 this->Superclass::CopyInformation( data );
108 const Self * nd =
nullptr;
111 nd =
dynamic_cast<const Self*
>(data);
116 itkExceptionMacro(<<
"mitk::IGTLMessage::CopyInformation() cannot cast "
117 <<
typeid(data).name() <<
" to "
118 <<
typeid(Self*).name() );
123 itkExceptionMacro(<<
"mitk::IGTLMessage::CopyInformation() cannot cast "
124 <<
typeid(data).name() <<
" to "
125 <<
typeid(Self*).name() );
134 bool returnValue =
true;
136 if( std::string(rightHandSide.
GetName()) != std::string(leftHandSide.
GetName()) )
140 MITK_INFO <<
"[( IGTLMessage )] Name differs.";
142 <<
"rightHandSide is " << rightHandSide.
GetName();
151 MITK_INFO <<
"[( IGTLMessage )] IGTTimeStamp differs.";
163 return this->m_Message->GetDeviceType();
166 template <
typename IGTLMessageType >
169 return dynamic_cast<IGTLMessageType*
>(this->m_Message);
virtual bool IsDataValid() const
returns true if the object contains valid data
virtual igtl::MessageBase::Pointer GetMessage() const
returns the OpenIGTLink message
itk::SmartPointer< Self > Pointer
void SetMessage(igtl::MessageBase::Pointer msg)
Sets the OpenIGTLink message.
const char * GetIGTLMessageType() const
A wrapper for the OpenIGTLink message type.
void PrintSelf(std::ostream &os, itk::Indent indent) const override
Prints the object information to the given stream os.
virtual const char * GetName() const
returns the name of the IGTLMessage object
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.
static std::string GetName(std::string fileName, std::string suffix)
igtl::MessageBase::Pointer m_Message
holds the actual OpenIGTLink message
virtual void Graft(const DataObject *data) override
Graft the data and information from one IGTLMessage to another.
virtual void CopyInformation(const DataObject *data) override
copy meta data of a IGTLMessage object
virtual TimeStampType GetIGTTimeStamp() const
gets the IGT timestamp of the IGTLMessage object
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.