Skip to content

Commit

Permalink
STYLE: Add itkVirtualGetNameOfClassMacro + itkOverrideGetNameOfClassM…
Browse files Browse the repository at this point in the history
…acro

Added two new macro's, intended to replace the old 'itkTypeMacro' and
'itkTypeMacroNoParent'.

The main aim is to be clearer about what those macro's do: add a virtual
'GetNameOfClass()' member function and override it. Unlike 'itkTypeMacro',
'itkOverrideGetNameOfClassMacro' does not have a 'superclass' parameter, as it
was not used anyway.

Note that originally 'itkTypeMacro' did not use its 'superclass' parameter
either, looking at commit 699b66cb04d410e555656828e8892107add38ccb, Will
Schroeder, June 27, 2001:
https://github.com/InsightSoftwareConsortium/ITK/blob/699b66cb04d410e555656828e8892107add38ccb/Code/Common/itkMacro.h#L331-L337
  • Loading branch information
hjmjohnson committed Jan 26, 2025
1 parent 73dcf82 commit f6b5111
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/itkBSplineApproximationGradientImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class ITK_TEMPLATE_EXPORT BSplineApproximationGradientImageFilter

itkNewMacro(Self);

itkTypeMacro(BSplineApproximationGradientImageFilter, ImageToImageFilter);
itkOverrideGetNameOfClassMacro(BSplineApproximationGradientImageFilter);

using OutputValueType = TOutputValueType;
using InputPixelType = typename InputImageType::PixelType;
Expand Down
2 changes: 1 addition & 1 deletion include/itkBSplineGradientImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class ITK_TEMPLATE_EXPORT BSplineGradientImageFilter
itkNewMacro(Self);

/** Run-time type information (and related methods). */
itkTypeMacro(BSplineGradientImageFilter, ImageToImageFilter);
itkOverrideGetNameOfClassMacro(BSplineGradientImageFilter);

/** Image type alias support. */
using InputPixelType = typename InputImageType::PixelType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class BSplineScatteredDataPointSetToGradientImageFilter
itkNewMacro(Self);

/** Run-time type information (and related methods). */
itkTypeMacro(BSplineScatteredDataPointSetToGradientImageFilter, PointSetToImageFilter);
itkOverrideGetNameOfClassMacro(BSplineScatteredDataPointSetToGradientImageFilter);

/** Image type alias support. */
using InputPixelType = typename InputPointSetType::PixelType;
Expand Down
2 changes: 1 addition & 1 deletion include/itkImageToImageOfVectorsFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ITK_TEMPLATE_EXPORT ImageToImageOfVectorsFilter
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(ImageToImageOfVectorsFilter, ImageToImageFilter);
itkOverrideGetNameOfClassMacro(ImageToImageOfVectorsFilter);

using InputImageType = TInputImage;
itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
Expand Down

0 comments on commit f6b5111

Please sign in to comment.