IGSTK
|
00001 /*========================================================================= 00002 00003 Program: Image Guided Surgery Software Toolkit 00004 Module: $RCSfile: igstkTrackerToolObserverToOpenIGTLinkRelay.h,v $ 00005 Language: C++ 00006 Date: $Date: 2010-12-01 15:08:27 $ 00007 Version: $Revision: 1.4 $ 00008 00009 Copyright (c) ISC Insight Software Consortium. All rights reserved. 00010 See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #ifndef __igstkTrackerToolObserverToOpenIGTLinkRelay_h 00019 #define __igstkTrackerToolObserverToOpenIGTLinkRelay_h 00020 00021 #include "igstkObject.h" 00022 #include "igstkMacros.h" 00023 #include "igstkStateMachine.h" 00024 #include "igstkTrackerTool.h" 00025 00026 #include "igtlOSUtil.h" 00027 #include "igtlTransformMessage.h" 00028 #include "igtlClientSocket.h" 00029 00030 00031 namespace igstk 00032 { 00040 class TrackerToolObserverToOpenIGTLinkRelay : public Object 00041 { 00042 00043 public: 00044 00046 igstkStandardClassTraitsMacro( TrackerToolObserverToOpenIGTLinkRelay, Object ) 00047 00048 public: 00049 00050 void RequestSetPort( int port ); 00051 00052 void RequestSetHostName( const char * hostname ); 00053 00054 void RequestSetDeviceName( const char * devicename ); 00055 00056 void RequestSetTrackerTool( const TrackerTool * tracker ); 00057 00058 void RequestStart(); 00059 00060 protected: 00061 00064 TrackerToolObserverToOpenIGTLinkRelay(void); 00065 00066 virtual ~TrackerToolObserverToOpenIGTLinkRelay(void); 00067 00069 virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const; 00070 00071 void ResendTransformThroughOpenIGTLink( 00072 itk::Object * caller, const itk::EventObject & event ); 00073 00074 typedef itk::MemberCommand< TrackerToolObserverToOpenIGTLinkRelay > 00075 ObserverType; 00076 00077 00078 private: 00079 00080 ObserverType::Pointer m_Observer; 00081 00082 TrackerTool::ConstPointer m_TrackerTool; 00083 00084 vtkMatrix4x4 * m_Matrix; 00085 00086 unsigned int m_Tag; 00087 00088 int m_Port; 00089 00090 std::string m_HostName; 00091 00092 igtl::ClientSocket::Pointer m_Socket; 00093 00094 igtl::TransformMessage::Pointer m_TransformMessage; 00095 00096 }; 00097 00098 } // end of namespace igstk 00099 00100 #endif //__igstk_TrackerToolObserverToOpenIGTLinkRelay_h_