Orfeo Toolbox  3.16
itkOutputWindow.cxx
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkOutputWindow.cxx,v $
5  Language: C++
6  Date: $Date: 2003-09-10 14:29:19 $
7  Version: $Revision: 1.17 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  Portions of this code are covered under the VTK copyright.
13  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
14 
15  This software is distributed WITHOUT ANY WARRANTY; without even
16  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
17  PURPOSE. See the above copyright notices for more information.
18 
19 =========================================================================*/
20 #include "itkOutputWindow.h"
21 #ifdef _WIN32
22 #include "itkWin32OutputWindow.h"
23 #endif
24 #include "itkObjectFactory.h"
25 
26 namespace itk
27 {
28 
30 
36 {
37  m_PromptUser = 0;
38 }
39 
42 {
43 }
44 
45 void
46 OutputWindowDisplayText(const char* message)
47 {
48  OutputWindow::GetInstance()->DisplayText(message);
49 }
50 
51 void
52 OutputWindowDisplayErrorText(const char* message)
53 {
54  OutputWindow::GetInstance()->DisplayErrorText(message);
55 }
56 
57 void
58 OutputWindowDisplayWarningText(const char* message)
59 {
60  OutputWindow::GetInstance()->DisplayWarningText(message);
61 }
62 
63 void
65 {
66  OutputWindow::GetInstance()->DisplayGenericOutputText(message);
67 }
68 
69 void
70 OutputWindowDisplayDebugText(const char* message)
71 {
72  OutputWindow::GetInstance()->DisplayDebugText(message);
73 }
74 
75 
76 void
78 ::PrintSelf(std::ostream& os, Indent indent) const
79 {
80  Superclass::PrintSelf(os, indent);
81 
82  os << indent << "OutputWindow (single instance): "
83  << (void*)OutputWindow::m_Instance << std::endl;
84 
85  os << indent << "Prompt User: " << (m_PromptUser ? "On\n" : "Off\n");
86 }
87 
88 
92 void
94 ::DisplayText(const char* txt)
95 {
96  std::cerr << txt;
97  if ( m_PromptUser )
98  {
99  char c = 'n';
100  std::cerr << "\nDo you want to suppress any further messages (y,n)?."
101  << std::endl;
102  std::cin >> c;
103  if ( c == 'y' || c == 'Y' )
104  {
106  }
107  }
108 }
109 
116 {
118  {
119  // Try the factory first
121  // if the factory did not provide one, then create it here
123  {
124  // For the windows OS, use a special output window
125 #ifdef _WIN32
127 #else
129  // Remove extra reference from construction.
131 #endif
132  }
133  }
138 }
139 
140 void
143 {
144  if ( OutputWindow::m_Instance == instance )
145  {
146  return;
147  }
148  OutputWindow::m_Instance = instance;
149 }
150 
157 {
158  return GetInstance();
159 }
160 
161 
162 } // end namespace itk

Generated at Sat Feb 2 2013 23:58:06 for Orfeo Toolbox with doxygen 1.8.1.1