Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 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() != NULL ? 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 415 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 425 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintEndMacro

#define vtkMRMLPrintEndMacro ( )    }

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

Definition at line 421 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 437 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 445 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 441 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 468 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 484 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 433 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 500 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLPrintStringMacro

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

Macro for printing char* node property value.

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