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

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) \
{
Abstract Superclass for all specific types of MRML nodes.

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

◆ vtkMRMLCopyBooleanMacro

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

Macro for copying bool node property value.

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

◆ vtkMRMLCopyEnumMacro

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

Macro for copying enum node property value.

Definition at line 398 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyFloatMacro

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

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

Definition at line 401 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyIntMacro

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

Macro for copying int node property value.

Definition at line 395 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyOwnedMatrix4x4Macro

#define vtkMRMLCopyOwnedMatrix4x4Macro ( propertyName)
Value:
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 431 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyStdFloatVectorMacro

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

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

Definition at line 420 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyStdIntVectorMacro

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

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

Definition at line 423 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyStdStringMacro

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

Macro for copying std::string node property value.

Definition at line 392 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyStdStringVectorMacro

#define vtkMRMLCopyStdStringVectorMacro ( propertyName)
Value:
this->Set##propertyName(this->SafeDownCast(copySourceNode)->Get##propertyName());

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

Definition at line 426 of file vtkMRMLNodePropertyMacros.h.

◆ vtkMRMLCopyStringMacro

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

Macro for copying char* node property value.

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