Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Macros
Helper macros for copying node properties from a source node.

Macros

#define vtkMRMLPrintBeginMacro(os, indent)
 
#define vtkMRMLPrintBooleanMacro(propertyName)   printOutputStream << printOutputIndent << #propertyName ": " << (this->Get##propertyName() ? "true" : "false") << "\n";
 Macro for printing bool node property value. More...
 
#define vtkMRMLPrintEndMacro()   }
 This macro must be placed after the last value printing macro. More...
 
#define vtkMRMLPrintEnumMacro(propertyName)   printOutputStream << printOutputIndent << #propertyName ": " << (Get##propertyName##AsString(Get##propertyName())) << "\n";
 Macro for printing enum node property value. More...
 
#define vtkMRMLPrintFloatMacro(propertyName)   printOutputStream << printOutputIndent << #propertyName ": " << this->Get##propertyName() << "\n";
 Macro for printing floating-point (float or double) node property value. More...
 
#define vtkMRMLPrintIntMacro(propertyName)   printOutputStream << printOutputIndent << #propertyName ": " << this->Get##propertyName() << "\n";
 Macro for printing int node property value. More...
 
#define vtkMRMLPrintMatrix4x4Macro(propertyName)
 
#define vtkMRMLPrintObjectMacro(propertyName)
 
#define vtkMRMLPrintStdFloatVectorMacro(propertyName, vectorType)
 Macro for printing an iterable container (float or double) node property value. More...
 
#define vtkMRMLPrintStdIntVectorMacro(propertyName, vectorType)
 Macro for printing an iterable container (int) node property value. More...
 
#define vtkMRMLPrintStdStringMacro(propertyName)   printOutputStream << printOutputIndent << #propertyName ": " << this->Get##propertyName() << "\n";
 Macro for printing std::string node property value. More...
 
#define vtkMRMLPrintStdStringVectorMacro(propertyName, vectorType)
 Macro for printing iterable container (of std::string) node property value. More...
 
#define vtkMRMLPrintStringMacro(propertyName)   printOutputStream << printOutputIndent << #propertyName ": " << (this->Get##propertyName() != nullptr ? this->Get##propertyName() : "(none)") << "\n";
 Macro for printing char* node property value. More...
 
#define vtkMRMLPrintVectorMacro(propertyName, vectorType, vectorSize)
 Macro for printing floating-point (float or double) vector node property value. More...
 

Detailed Description

They are To be used in PrintSelf(ostream& os, vtkIndent indent) method. Arguments of value printing macros:

Macro Definition Documentation

◆ vtkMRMLPrintBeginMacro

#define vtkMRMLPrintBeginMacro (   os,
  indent 
)
Value:
{ \
ostream& printOutputStream = os; \
vtkIndent printOutputIndent = indent;

This macro must be placed before the first value printing macro.

  • os: output stream
  • indent: current indentation level

Definition at line 482 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintBooleanMacro

#define vtkMRMLPrintBooleanMacro (   propertyName)    printOutputStream << printOutputIndent << #propertyName ": " << (this->Get##propertyName() ? "true" : "false") << "\n";

Macro for printing bool node property value.

Definition at line 492 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintEndMacro

#define vtkMRMLPrintEndMacro ( )    }

This macro must be placed after the last value printing macro.

Definition at line 488 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintEnumMacro

#define vtkMRMLPrintEnumMacro (   propertyName)    printOutputStream << printOutputIndent << #propertyName ": " << (Get##propertyName##AsString(Get##propertyName())) << "\n";

Macro for printing enum node property value.

Definition at line 504 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintFloatMacro

#define vtkMRMLPrintFloatMacro (   propertyName)    printOutputStream << printOutputIndent << #propertyName ": " << this->Get##propertyName() << "\n";

Macro for printing floating-point (float or double) node property value.

Definition at line 512 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintIntMacro

#define vtkMRMLPrintIntMacro (   propertyName)    printOutputStream << printOutputIndent << #propertyName ": " << this->Get##propertyName() << "\n";

Macro for printing int node property value.

Definition at line 508 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintMatrix4x4Macro

#define vtkMRMLPrintMatrix4x4Macro (   propertyName)
Value:
{ \
vtkMatrix4x4* matrix = this->Get##propertyName(); \
printOutputStream << printOutputIndent << #propertyName ":"; \
if (matrix) \
{ \
printOutputStream << "\n"; \
matrix->PrintSelf(printOutputStream, printOutputIndent.GetNextIndent()); \
} \
else \
{ \
printOutputStream << " (none)\n"; \
} \
}

Definition at line 582 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintObjectMacro

#define vtkMRMLPrintObjectMacro (   propertyName)
Value:
{ \
vtkObject* obj = this->Get##propertyName(); \
printOutputStream << printOutputIndent << #propertyName ":"; \
if (obj) \
{ \
printOutputStream << "\n"; \
obj->PrintSelf(printOutputStream, printOutputIndent.GetNextIndent()); \
} \
else \
{ \
printOutputStream << " (none)\n"; \
} \
}

Definition at line 597 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintStdFloatVectorMacro

#define vtkMRMLPrintStdFloatVectorMacro (   propertyName,
  vectorType 
)
Value:
{ \
printOutputStream << printOutputIndent << #propertyName " : ["; \
vectorType vector = this->Get##propertyName(); \
for (vectorType::iterator it=vector.begin(); it!=vector.end(); it++) \
{ \
if (it != vector.begin()) \
{ \
printOutputStream << ", "; \
} \
printOutputStream << *it; \
} \
printOutputStream << "]\n"; \
}

Macro for printing an iterable container (float or double) node property value.

Definition at line 535 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintStdIntVectorMacro

#define vtkMRMLPrintStdIntVectorMacro (   propertyName,
  vectorType 
)
Value:
{ \
printOutputStream << printOutputIndent << #propertyName " : ["; \
vectorType vector = this->Get##propertyName(); \
for (vectorType::iterator it=vector.begin(); it!=vector.end(); it++) \
{ \
if (it != vector.begin()) \
{ \
printOutputStream << ", "; \
} \
printOutputStream << *it; \
} \
printOutputStream << "]\n"; \
}

Macro for printing an iterable container (int) node property value.

Definition at line 551 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintStdStringMacro

#define vtkMRMLPrintStdStringMacro (   propertyName)    printOutputStream << printOutputIndent << #propertyName ": " << this->Get##propertyName() << "\n";

Macro for printing std::string node property value.

Definition at line 500 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintStdStringVectorMacro

#define vtkMRMLPrintStdStringVectorMacro (   propertyName,
  vectorType 
)
Value:
{ \
printOutputStream << printOutputIndent << #propertyName " : ["; \
vectorType<std::string> vector = this->Get##propertyName(); \
for (vectorType<std::string>::iterator it=vector.begin(); it!=vector.end(); it++) \
{ \
if (it != vector.begin()) \
{ \
printOutputStream << ", "; \
} \
printOutputStream << *it; \
} \
printOutputStream << "]\n"; \
}

Macro for printing iterable container (of std::string) node property value.

Definition at line 567 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintStringMacro

#define vtkMRMLPrintStringMacro (   propertyName)    printOutputStream << printOutputIndent << #propertyName ": " << (this->Get##propertyName() != nullptr ? this->Get##propertyName() : "(none)") << "\n";

Macro for printing char* node property value.

Definition at line 496 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintVectorMacro

#define vtkMRMLPrintVectorMacro (   propertyName,
  vectorType,
  vectorSize 
)
Value:
{ \
printOutputStream << printOutputIndent << #propertyName " : ["; \
vectorType* vectorValue = this->Get##propertyName(); \
if (vectorValue) \
{ \
for (int i=0; i<vectorSize; i++) \
{ \
if (i > 0) \
{ \
printOutputStream << ", "; \
} \
printOutputStream << vectorValue[i]; \
} \
printOutputStream << "]\n"; \
} \
}

Macro for printing floating-point (float or double) vector node property value.

Definition at line 516 of file vtkMRMLNodePropertyMacros.h.