Slicer  5.1
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 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 vtkMRMLCopyOwnedMatrix4x4Macro(propertyName)   this->Get##propertyName()->DeepCopy(this->SafeDownCast(copySourceNode)->Get##propertyName());
 
#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 vtkMRMLCopyStdStringVectorMacro(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 != nullptr) \
{

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 377 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 393 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 384 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 409 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 413 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 405 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyOwnedMatrix4x4Macro

#define vtkMRMLCopyOwnedMatrix4x4Macro (   propertyName)    this->Get##propertyName()->DeepCopy(this->SafeDownCast(copySourceNode)->Get##propertyName());

Macro for copying a vtkMatrix4x4* property value. "Owned" means that the node owns the matrix, the object is always valid and cannot be replaced from outside (there is no public Set...() method for the matrix).

Definition at line 447 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 433 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 437 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 401 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyStdStringVectorMacro

#define vtkMRMLCopyStdStringVectorMacro (   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 441 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 397 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 != nullptr) \
{ \
this->Set##propertyName(sourceVector); \
} \
else \
{ \
vtkErrorMacro("Failed to copy " #propertyName " attribute value: source node returned NULL"); \
} \
}

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

Definition at line 417 of file vtkMRMLNodePropertyMacros.h.