1 // Copyright (C) 2014-2021 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "PVViewer_OutputWindow.h"
22 #include <vtkObjectFactory.h>
24 vtkStandardNewMacro(PVViewer_OutputWindow)
26 PVViewer_OutputWindow::PVViewer_OutputWindow()
30 PVViewer_OutputWindow::~PVViewer_OutputWindow()
34 unsigned int PVViewer_OutputWindow::getTextCount() const
36 return count(MESSAGE_TYPE_TEXT);
39 unsigned int PVViewer_OutputWindow::getErrorCount() const
41 return count(MESSAGE_TYPE_ERROR);
44 unsigned int PVViewer_OutputWindow::getWarningCount() const
46 return count(MESSAGE_TYPE_WARNING);
49 unsigned int PVViewer_OutputWindow::getGenericWarningCount() const
51 return count(MESSAGE_TYPE_GENERIC_WARNING);
54 unsigned int PVViewer_OutputWindow::getDebugCount() const
56 return count(MESSAGE_TYPE_DEBUG);
59 void PVViewer_OutputWindow::DisplayText(const char* text)
61 MessageTypes type = GetCurrentMessageType();
62 myCounter[type] = count(type) + 1;
65 case MESSAGE_TYPE_ERROR:
68 case MESSAGE_TYPE_WARNING:
69 case MESSAGE_TYPE_GENERIC_WARNING:
72 case MESSAGE_TYPE_DEBUG:
75 case MESSAGE_TYPE_TEXT:
82 int PVViewer_OutputWindow::count(const MessageTypes& type) const
84 return myCounter.value(type, 0);