Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
Helper macros for copying node properties from a source node.

Macros

#define vtkMRMLPrintBeginMacro(os, indent)
 
#define vtkMRMLPrintBooleanMacro(propertyName)
 Macro for printing bool node property value.
 
#define vtkMRMLPrintEndMacro()
 This macro must be placed after the last value printing macro.
 
#define vtkMRMLPrintEnumMacro(propertyName)
 Macro for printing enum node property value.
 
#define vtkMRMLPrintFloatMacro(propertyName)
 Macro for printing floating-point (float or double) node property value.
 
#define vtkMRMLPrintIntMacro(propertyName)
 Macro for printing int node property value.
 
#define vtkMRMLPrintMatrix4x4Macro(propertyName)
 
#define vtkMRMLPrintObjectMacro(propertyName)
 
#define vtkMRMLPrintStdFloatVectorMacro(propertyName, vectorType)
 
#define vtkMRMLPrintStdIntVectorMacro(propertyName, vectorType)
 
#define vtkMRMLPrintStdStringMacro(propertyName)
 Macro for printing std::string node property value.
 
#define vtkMRMLPrintStdStringVectorMacro(propertyName, vectorType)
 Macro for printing iterable container (of std::string) node property value.
 
#define vtkMRMLPrintStringMacro(propertyName)
 Macro for printing char* node property value.
 
#define vtkMRMLPrintVectorMacro(propertyName, vectorType, vectorSize)
 

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 446 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintBooleanMacro

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

Macro for printing bool node property value.

Definition at line 455 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintEndMacro

#define vtkMRMLPrintEndMacro ( )
Value:
}

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

Definition at line 452 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintEnumMacro

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

Macro for printing enum node property value.

Definition at line 465 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintFloatMacro

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

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

Definition at line 471 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintIntMacro

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

Macro for printing int node property value.

Definition at line 468 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 543 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 558 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. Follow VTK's PrintSelf convention of using parentheses for multiple values.

Definition at line 495 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. Follow VTK's PrintSelf convention of using parentheses for multiple values.

Definition at line 512 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintStdStringMacro

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

Macro for printing std::string node property value.

Definition at line 462 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 528 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintStringMacro

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

Macro for printing char* node property value.

Definition at line 458 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. Follow VTK's PrintSelf convention of using parentheses for multiple values.

Definition at line 475 of file vtkMRMLNodePropertyMacros.h.