PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusMacro.h
Go to the documentation of this file.
1 /*=Plus=header=begin======================================================
2  Program: Plus
3  Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved.
4  See License.txt for details.
5 =========================================================Plus=header=end*/
6 
7 #ifndef __vtkPlusMacro_h
8 #define __vtkPlusMacro_h
9 
10 //
11 // Const version of Get pointer to object. Creates member Get"name" (e.g., GetPoints()).
12 // This macro should be used in the header file.
13 //
14 #define vtkGetObjectConstMacro(name,type) \
15  virtual type *Get##name () const \
16  { \
17  /* vtkDebugConstMacro(<< this->GetClassName() << " (" << this << "): returning " #name " address " << this->name ); */ \
18  return this->name; \
19  }
20 
21 //
22 // This macro is used for debug statements in instance methods
23 // vtkDebugMacro(<< "this is debug info" << this->SomeVariable);
24 //
25 #define vtkDebugConstMacro(x) \
26  vtkDebugWithObjectConstMacro(this,x)
27 
28 #ifdef NDEBUG
29 # define vtkDebugWithObjectConstMacro(self, x)
30 #else
31 # define vtkDebugWithObjectConstMacro(self, x) \
32  { \
33  if (vtkObject::GetGlobalWarningDisplay()) \
34  { \
35  vtkOStreamWrapper::EndlType endl; \
36  vtkOStreamWrapper::UseEndl(endl); \
37  vtkOStrStreamWrapper vtkmsg; \
38  vtkmsg << "Debug: In " __FILE__ ", line " << __LINE__ << "\n" \
39  << self->GetClassName() << " (" << self << "): " x << "\n\n"; \
40  vtkOutputWindowDisplayDebugText(vtkmsg.str()); \
41  } \
42  }
43 #endif
44 #endif //__vtkPlusMacro_h