00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __igstkFLTKTextLogOutput_h
00019 #define __igstkFLTKTextLogOutput_h
00020
00021 #include <iostream>
00022 #include <string>
00023
00024 #include "itkObject.h"
00025 #include "itkObjectFactory.h"
00026 #include "itkSimpleFastMutexLock.h"
00027 #include "itkLogOutput.h"
00028
00029 #include <FL/Fl_Text_Buffer.H>
00030 #include <FL/Fl_Text_Display.H>
00031
00032 #include "igstkMacros.h"
00033 #include "igstkStateMachine.h"
00034
00035
00036 namespace igstk
00037 {
00038
00047 class FLTKTextLogOutput : public ::itk::LogOutput
00048 {
00049
00050 public:
00051
00053 igstkStandardClassTraitsMacro( FLTKTextLogOutput, ::itk::LogOutput )
00054
00055 public:
00056
00057 typedef Fl_Text_Display StreamType;
00058 typedef StreamType* StreamPointerType;
00059
00061 igstkGetMacro(Stream, StreamPointerType);
00062
00064 void SetStream(StreamType &Stream);
00065
00067 virtual void Flush();
00068
00070 virtual void Write(double timestamp);
00071
00073 virtual void Write(std::string const &content);
00074
00076 virtual void Write(std::string const &content, double timestamp);
00077
00078 protected:
00080 FLTKTextLogOutput();
00081
00083 virtual ~FLTKTextLogOutput();
00084
00086 virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
00087
00088 private:
00089
00091 StreamPointerType m_Stream;
00092
00094 itk::SimpleFastMutexLock m_Mutex;
00095 };
00096
00097 }
00098
00099 #endif //__igstk_FLTKTextLogOutput_h_