OGS
VtkConsoleOutputWindow.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
5
6#include <ostream>
7#include <string>
8
9#include "vtkObjectFactory.h"
10#ifdef WIN32
11#include "vtkWindows.h"
12#endif
13
15
16//----------------------------------------------------------------------------
18
19//----------------------------------------------------------------------------
21
22//----------------------------------------------------------------------------
23// Display text in the window, and translate the \n to \r\n.
24//
25void VtkConsoleOutputWindow::DisplayText(const char* someText)
26{
27 if (!someText)
28 {
29 return;
30 }
31
32 // Disable warnings
33 std::string someTextString(someText);
34 if ((someTextString.find(
35 "This is very expensive for vtkMappedDataArray subclasses, since "
36 "the scalar array must be generated for each call.") !=
37 std::string::npos) ||
38 (someTextString.find("Invalid framebuffer operation") !=
39 std::string::npos))
40 {
41 return;
42 }
43
44#ifdef WIN32
45 OutputDebugString(someTextString.c_str());
46#endif
47 std::cerr << someText;
48}
49
50//----------------------------------------------------------------------------
51void VtkConsoleOutputWindow::PrintSelf(ostream& os, vtkIndent indent)
52{
53 this->Superclass::PrintSelf(os, indent);
54}
vtkStandardNewMacro(VtkConsoleOutputWindow)
void DisplayText(const char *) override
void PrintSelf(ostream &os, vtkIndent indent) override
~VtkConsoleOutputWindow() override