2 #include "PVGUI_OutputWindowAdapter.h"
4 #include <vtkObjectFactory.h>
6 #include <LightApp_Application.h>
8 #include <SUIT_Session.h>
10 vtkStandardNewMacro(PVGUI_OutputWindowAdapter);
11 vtkCxxRevisionMacro(PVGUI_OutputWindowAdapter, "$Revision$");
13 PVGUI_OutputWindowAdapter::PVGUI_OutputWindowAdapter() :
17 GenericWarningCount(0)
21 PVGUI_OutputWindowAdapter::~PVGUI_OutputWindowAdapter()
25 const unsigned int PVGUI_OutputWindowAdapter::getTextCount()
27 return this->TextCount;
30 const unsigned int PVGUI_OutputWindowAdapter::getErrorCount()
32 return this->ErrorCount;
35 const unsigned int PVGUI_OutputWindowAdapter::getWarningCount()
37 return this->WarningCount;
40 const unsigned int PVGUI_OutputWindowAdapter::getGenericWarningCount()
42 return this->GenericWarningCount;
45 static LogWindow* getLogWindow()
48 LightApp_Application* anApp = dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() );
50 wnd = anApp->logWindow();
54 void PVGUI_OutputWindowAdapter::DisplayText(const char* text)
57 LogWindow* wnd = getLogWindow();
59 wnd->putMessage( text, Qt::darkGreen, LogWindow::DisplayNormal );
62 void PVGUI_OutputWindowAdapter::DisplayErrorText(const char* text)
65 LogWindow* wnd = getLogWindow();
67 wnd->putMessage( text, Qt::darkRed, LogWindow::DisplayNormal );
70 void PVGUI_OutputWindowAdapter::DisplayWarningText(const char* text)
73 LogWindow* wnd = getLogWindow();
75 wnd->putMessage( text, Qt::black, LogWindow::DisplayNormal );
78 void PVGUI_OutputWindowAdapter::DisplayGenericWarningText(const char* text)
80 ++this->GenericWarningCount;
81 LogWindow* wnd = getLogWindow();
83 wnd->putMessage( text, Qt::black, LogWindow::DisplayNormal );