NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkUCLMacro.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef itkUCLMacro_h
16 #define itkUCLMacro_h
17 
18 #include <NifTKConfigure.h>
20 
21 #include <iostream>
22 #include <itkObject.h>
23 #include <itkArray.h>
24 #include <itkMacro.h>
25 
26 namespace niftk
27 {
28 
29 #define niftkitkDebugMacro(x) itkDebugMacro(x)
30 
31 #define niftkitkWarningMacro(x) itkWarningMacro(x)
32 
33 #define niftkitkExceptionMacro(x) itkExceptionMacro(x)
34 
35 
36 #define niftkitkInfoMacro(x) \
37 { \
38  if ( ::itk::Object::GetGlobalWarningDisplay() ) \
39  { \
40  std::ostringstream itkmsg; \
41  itkmsg << "Info: In " __FILE__ ", line " << __LINE__ << "\n" \
42  << this->GetNameOfClass() << " (" << this << "): " x \
43  << "\n\n"; \
44  ::itk::OutputWindowDisplayText( itkmsg.str().c_str() ); \
45  } \
46 } \
47 
48 
49 #define niftkitkErrorMacro(x) \
50 { \
51  if ( ::itk::Object::GetGlobalWarningDisplay() ) \
52  { \
53  std::ostringstream itkmsg; \
54  itkmsg << "Error: In " __FILE__ ", line " << __LINE__ << "\n" \
55  << this->GetNameOfClass() << " (" << this << "): " x \
56  << "\n\n"; \
57  ::itk::OutputWindowDisplayText( itkmsg.str().c_str() ); \
58  } \
59 }
60 
61 
65 {
66 
68 
69  static KeepTextOutputInShell s_KeepTextOutputInShell;
70 
71 };
72 
73 
74 }
75 
76 #endif
Definition: itkUCLMacro.h:64
Definition: niftkExceptionObject.h:21