From 02c577c8ac5444a7e63a5d7f41a6351f63cd321d Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Fri, 31 May 2024 15:50:13 -0500 Subject: [PATCH] COMP: `ImageRegion` no longer inherits from `Region` Remove Macro added to each `ImageRegion` member function that overrides a virtual member function of `Region`, when legacy support is enabled. Without legacy support, `ImageRegion` will no longer inherit from `Region`, so then those `ImageRegion` member functions will no longer override. --- Modules/Core/Common/include/itkImageRegion.h | 23 +++++--------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/Modules/Core/Common/include/itkImageRegion.h b/Modules/Core/Common/include/itkImageRegion.h index 39d4097487c..1ce4fe78c8c 100644 --- a/Modules/Core/Common/include/itkImageRegion.h +++ b/Modules/Core/Common/include/itkImageRegion.h @@ -36,18 +36,9 @@ #include // For conditional and integral_constant. #include // For tuple_element and tuple_size. -// Macro added to each `ImageRegion` member function that overrides a virtual member function of `Region`, when legacy -// support is enabled. Without legacy support, `ImageRegion` will no longer inherit from `Region`, so then those -// `ImageRegion` member functions will no longer override. -#ifdef ITK_LEGACY_REMOVE -# define itkRegionOverrideMacro // nothing -#else -# define itkRegionOverrideMacro override -#endif - namespace itk { -// Forward declaration of ImageBase so it can be declared a friend +// Forward declaration of ImageBase, so it can be declared a friend // (needed for PrintSelf mechanism) template class ITK_TEMPLATE_EXPORT ImageBase; @@ -85,7 +76,7 @@ class ITK_TEMPLATE_EXPORT ImageRegion final /** Standard part of all itk objects. */ const char * - GetNameOfClass() const itkRegionOverrideMacro + GetNameOfClass() const { return "ImageRegion"; } @@ -121,14 +112,14 @@ class ITK_TEMPLATE_EXPORT ImageRegion final /** Return the region type. Images are described with structured regions. */ Region::RegionEnum - GetRegionType() const itkRegionOverrideMacro + GetRegionType() const { return Region::RegionEnum::ITK_STRUCTURED_REGION; } /** Print the region. */ void - Print(std::ostream & os, Indent indent = 0) const itkRegionOverrideMacro; + Print(std::ostream & os, Indent indent = 0) const; /** Constructor. ImageRegion is a lightweight object that is not reference * counted, so the constructor is public. Its two data members are filled @@ -137,7 +128,7 @@ class ITK_TEMPLATE_EXPORT ImageRegion final /** Destructor. ImageRegion is a lightweight object that is not reference * counted, so the destructor is public. */ - ~ImageRegion() itkRegionOverrideMacro = default; + ~ImageRegion() = default; /** Copy constructor. ImageRegion is a lightweight object that is not * reference counted, so the copy constructor is public. */ @@ -392,7 +383,7 @@ class ITK_TEMPLATE_EXPORT ImageRegion final * instead) but used in the hierarchical print process to combine the * output of several classes. */ void - PrintSelf(std::ostream & os, Indent indent) const itkRegionOverrideMacro; + PrintSelf(std::ostream & os, Indent indent) const; private: IndexType m_Index = { { 0 } }; @@ -453,8 +444,6 @@ struct tuple_element> #endif } // namespace std -#undef itkRegionOverrideMacro - #ifndef ITK_MANUAL_INSTANTIATION # include "itkImageRegion.hxx" #endif