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 vtkMRMLCopyBeginMacro(sourceNode)
 
#define vtkMRMLCopyBooleanMacro(propertyName)   this->Set##propertyName(this->SafeDownCast(copySourceNode)->Get##propertyName());
 Macro for copying bool node property value. More...
 
#define vtkMRMLCopyEndMacro()
 This macro must be placed after the last value copying macro. More...
 
#define vtkMRMLCopyEnumMacro(propertyName)   this->Set##propertyName(this->SafeDownCast(copySourceNode)->Get##propertyName());
 Macro for copying enum node property value. More...
 
#define vtkMRMLCopyFloatMacro(propertyName)   this->Set##propertyName(this->SafeDownCast(copySourceNode)->Get##propertyName());
 Macro for copying floating-point (float or double) node property value. More...
 
#define vtkMRMLCopyIntMacro(propertyName)   this->Set##propertyName(this->SafeDownCast(copySourceNode)->Get##propertyName());
 Macro for copying int node property value. More...
 
#define vtkMRMLCopyStdFloatVectorMacro(propertyName)   this->Set##propertyName(this->SafeDownCast(copySourceNode)->Get##propertyName());
 Macro for copying an iterable container (float or double) vector node property value. More...
 
#define vtkMRMLCopyStdIntVectorMacro(propertyName)   this->Set##propertyName(this->SafeDownCast(copySourceNode)->Get##propertyName());
 Macro for copying an iterable container (int) vector node property value. More...
 
#define vtkMRMLCopyStdStringMacro(propertyName)   this->Set##propertyName(this->SafeDownCast(copySourceNode)->Get##propertyName());
 Macro for copying std::string node property value. More...
 
#define vtkMRMLCopyStdStringVectorMacroMacro(propertyName)   this->Set##propertyName(this->SafeDownCast(copySourceNode)->Get##propertyName());
 Macro for copying an iterable container (of std::string) vector node property value. More...
 
#define vtkMRMLCopyStringMacro(propertyName)   this->Set##propertyName(this->SafeDownCast(copySourceNode)->Get##propertyName());
 Macro for copying char* node property value. More...
 
#define vtkMRMLCopyVectorMacro(propertyName, vectorType, vectorSize)
 Macro for copying floating-point (float or double) vector node property value. More...
 

Detailed Description

They are To be used in Copy(vtkMRMLNode *anode) method. Arguments of value copying macros:

Macro Definition Documentation

◆ vtkMRMLCopyBeginMacro

#define vtkMRMLCopyBeginMacro (   sourceNode)
Value:
{ \
vtkMRMLNode* copySourceNode = this->SafeDownCast(sourceNode); \
if (copySourceNode != NULL) \
{

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

Parameters
sourceNodepointer to the node where property values will be copied from

Definition at line 335 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyBooleanMacro

#define vtkMRMLCopyBooleanMacro (   propertyName)    this->Set##propertyName(this->SafeDownCast(copySourceNode)->Get##propertyName());

Macro for copying bool node property value.

Definition at line 351 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyEndMacro

#define vtkMRMLCopyEndMacro ( )
Value:
} \
else \
{ \
vtkErrorMacro("Copy failed: invalid source node"); \
} \
}

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

Definition at line 342 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyEnumMacro

#define vtkMRMLCopyEnumMacro (   propertyName)    this->Set##propertyName(this->SafeDownCast(copySourceNode)->Get##propertyName());

Macro for copying enum node property value.

Definition at line 367 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyFloatMacro

#define vtkMRMLCopyFloatMacro (   propertyName)    this->Set##propertyName(this->SafeDownCast(copySourceNode)->Get##propertyName());

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

Definition at line 371 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyIntMacro

#define vtkMRMLCopyIntMacro (   propertyName)    this->Set##propertyName(this->SafeDownCast(copySourceNode)->Get##propertyName());

Macro for copying int node property value.

Definition at line 363 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyStdFloatVectorMacro

#define vtkMRMLCopyStdFloatVectorMacro (   propertyName)    this->Set##propertyName(this->SafeDownCast(copySourceNode)->Get##propertyName());

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

Definition at line 391 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyStdIntVectorMacro

#define vtkMRMLCopyStdIntVectorMacro (   propertyName)    this->Set##propertyName(this->SafeDownCast(copySourceNode)->Get##propertyName());

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

Definition at line 395 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyStdStringMacro

#define vtkMRMLCopyStdStringMacro (   propertyName)    this->Set##propertyName(this->SafeDownCast(copySourceNode)->Get##propertyName());

Macro for copying std::string node property value.

Definition at line 359 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyStdStringVectorMacroMacro

#define vtkMRMLCopyStdStringVectorMacroMacro (   propertyName)    this->Set##propertyName(this->SafeDownCast(copySourceNode)->Get##propertyName());

Macro for copying an iterable container (of std::string) vector node property value.

Definition at line 399 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyStringMacro

#define vtkMRMLCopyStringMacro (   propertyName)    this->Set##propertyName(this->SafeDownCast(copySourceNode)->Get##propertyName());

Macro for copying char* node property value.

Definition at line 355 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyVectorMacro

#define vtkMRMLCopyVectorMacro (   propertyName,
  vectorType,
  vectorSize 
)
Value:
{ \
/* Currently, vectorType and vectorSize is not essential, but in the future */ \
/* this information may be used more. */ \
vectorType* sourceVector = this->SafeDownCast(copySourceNode)->Get##propertyName(); \
if (sourceVector != NULL) \
{ \
this->Set##propertyName(sourceVector); \
} \
else \
{ \
vtkErrorMacro("Failed to copy #xmlAttributeName attribute value: source node returned NULL"); \
} \
}

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

Definition at line 375 of file vtkMRMLNodePropertyMacros.h.