Skip to content

Commit 8ae9f91

Browse files
N-Dekkerdzenanz
authored andcommitted
STYLE: Move empty member functions from .hxx to .h
Moved the member function definitions of member functions that have an empty member function definition from their "itk*.hxx" file to the corresponding "itk*.h" file, and into their class definition. Found by regular expression `^..[^:,].+\)\r\n{}` in "itk*.hxx" files. - Follow-up to pull request InsightSoftwareConsortium#5198 commit b94770d "STYLE: Move empty member functions with empty param list from .hxx to .h"
1 parent a5db4a8 commit 8ae9f91

20 files changed

+44
-131
lines changed

Modules/Core/Common/include/itkImageBase.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ class ITK_TEMPLATE_EXPORT ImageBase : public DataObject
249249
*
250250
*/
251251
virtual void
252-
Allocate(bool initialize = false);
252+
Allocate(bool itkNotUsed(initialize) = false)
253+
{}
253254

254255
/** Allocates the pixel buffer of the image, zero-initializing its pixels. `AllocateInitialized()` is equivalent to
255256
* `Allocate(true)`. It is just intended to make the code more readable. */

Modules/Core/Common/include/itkImageBase.hxx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@
3737

3838
namespace itk
3939
{
40-
41-
template <unsigned int VImageDimension>
42-
void
43-
ImageBase<VImageDimension>::Allocate(bool)
44-
{}
45-
46-
4740
template <unsigned int VImageDimension>
4841
void
4942
ImageBase<VImageDimension>::Initialize()

Modules/Numerics/FEM/include/itkFEMSolver.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ class ITK_TEMPLATE_EXPORT Solver : public ProcessObject
141141
* \param dt New time step.
142142
*/
143143
virtual void
144-
SetTimeStep(Float dt);
144+
SetTimeStep(Float itkNotUsed(dt))
145+
{}
145146

146147
/** Returns the Solution for the specified nodal point. */
147148
Float

Modules/Numerics/FEM/include/itkFEMSolver.hxx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,6 @@ Solver<VDimension>::GetTimeStep() const -> Float
107107
return Float{};
108108
}
109109

110-
template <unsigned int VDimension>
111-
void
112-
Solver<VDimension>::SetTimeStep(Float itkNotUsed(dt))
113-
{}
114-
115110
template <unsigned int VDimension>
116111
auto
117112
Solver<VDimension>::GetSolution(unsigned int i, unsigned int which) -> Float

Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationAdvectionTerm.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,15 @@ class ITK_TEMPLATE_EXPORT LevelSetEquationAdvectionTerm : public LevelSetEquatio
118118

119119
/** \todo to be documented. */
120120
void
121-
Initialize(const LevelSetInputIndexType &) override;
121+
Initialize(const LevelSetInputIndexType &) override
122+
{}
122123

123124
/** Supply updates at pixels to keep the term parameters always updated */
124125
void
125-
UpdatePixel(const LevelSetInputIndexType & iP,
126-
const LevelSetOutputRealType & oldValue,
127-
const LevelSetOutputRealType & newValue) override;
126+
UpdatePixel(const LevelSetInputIndexType & itkNotUsed(iP),
127+
const LevelSetOutputRealType & itkNotUsed(oldValue),
128+
const LevelSetOutputRealType & itkNotUsed(newValue)) override
129+
{}
128130

129131
protected:
130132
LevelSetEquationAdvectionTerm();

Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationAdvectionTerm.hxx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,6 @@ LevelSetEquationAdvectionTerm<TInput, TLevelSetContainer>::GenerateAdvectionImag
118118
}
119119
}
120120

121-
template <typename TInput, typename TLevelSetContainer>
122-
void
123-
LevelSetEquationAdvectionTerm<TInput, TLevelSetContainer>::Initialize(const LevelSetInputIndexType &)
124-
{}
125-
126-
template <typename TInput, typename TLevelSetContainer>
127-
void
128-
LevelSetEquationAdvectionTerm<TInput, TLevelSetContainer>::UpdatePixel(
129-
const LevelSetInputIndexType & itkNotUsed(iP),
130-
const LevelSetOutputRealType & itkNotUsed(oldValue),
131-
const LevelSetOutputRealType & itkNotUsed(newValue))
132-
{}
133-
134121
template <typename TInput, typename TLevelSetContainer>
135122
auto
136123
LevelSetEquationAdvectionTerm<TInput, TLevelSetContainer>::AdvectionSpeed(const LevelSetInputIndexType & iP) const

Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationBinaryMaskTerm.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,15 @@ class ITK_TEMPLATE_EXPORT LevelSetEquationBinaryMaskTerm : public LevelSetEquati
9494

9595
/** Initialize term parameters in the dense case by computing for each pixel location */
9696
void
97-
Initialize(const LevelSetInputIndexType & iP) override;
97+
Initialize(const LevelSetInputIndexType & itkNotUsed(iP)) override
98+
{}
9899

99100
/** Supply updates at pixels to keep the term parameters always updated */
100101
void
101-
UpdatePixel(const LevelSetInputIndexType & iP,
102-
const LevelSetOutputRealType & oldValue,
103-
const LevelSetOutputRealType & newValue) override;
102+
UpdatePixel(const LevelSetInputIndexType & itkNotUsed(iP),
103+
const LevelSetOutputRealType & itkNotUsed(oldValue),
104+
const LevelSetOutputRealType & itkNotUsed(newValue)) override
105+
{}
104106

105107
protected:
106108
LevelSetEquationBinaryMaskTerm();

Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationBinaryMaskTerm.hxx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,6 @@ LevelSetEquationBinaryMaskTerm<TInput, TLevelSetContainer>::InitializeParameters
3838
}
3939

4040

41-
template <typename TInput, typename TLevelSetContainer>
42-
void
43-
LevelSetEquationBinaryMaskTerm<TInput, TLevelSetContainer>::Initialize(const LevelSetInputIndexType & itkNotUsed(index))
44-
{}
45-
46-
47-
template <typename TInput, typename TLevelSetContainer>
48-
void
49-
LevelSetEquationBinaryMaskTerm<TInput, TLevelSetContainer>::UpdatePixel(
50-
const LevelSetInputIndexType & itkNotUsed(index),
51-
const LevelSetOutputRealType & itkNotUsed(oldValue),
52-
const LevelSetOutputRealType & itkNotUsed(newValue))
53-
{}
54-
5541
template <typename TInput, typename TLevelSetContainer>
5642
auto
5743
LevelSetEquationBinaryMaskTerm<TInput, TLevelSetContainer>::Value(const LevelSetInputIndexType & index)

Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationCurvatureTerm.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,15 @@ class ITK_TEMPLATE_EXPORT LevelSetEquationCurvatureTerm : public LevelSetEquatio
117117

118118
/** Initialize term parameters in the dense case by computing for each pixel location */
119119
void
120-
Initialize(const LevelSetInputIndexType &) override;
120+
Initialize(const LevelSetInputIndexType &) override
121+
{}
121122

122123
/** Supply updates at pixels to keep the term parameters always updated */
123124
void
124-
UpdatePixel(const LevelSetInputIndexType & iP,
125-
const LevelSetOutputRealType & oldValue,
126-
const LevelSetOutputRealType & newValue) override;
125+
UpdatePixel(const LevelSetInputIndexType & itkNotUsed(iP),
126+
const LevelSetOutputRealType & itkNotUsed(oldValue),
127+
const LevelSetOutputRealType & itkNotUsed(newValue)) override
128+
{}
127129

128130
protected:
129131
LevelSetEquationCurvatureTerm();

Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationCurvatureTerm.hxx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,6 @@ LevelSetEquationCurvatureTerm<TInput, TLevelSetContainer, TCurvatureImage>::Init
7676
}
7777
}
7878

79-
template <typename TInput, typename TLevelSetContainer, typename TCurvatureImage>
80-
void
81-
LevelSetEquationCurvatureTerm<TInput, TLevelSetContainer, TCurvatureImage>::Initialize(const LevelSetInputIndexType &)
82-
{}
83-
84-
template <typename TInput, typename TLevelSetContainer, typename TCurvatureImage>
85-
void
86-
LevelSetEquationCurvatureTerm<TInput, TLevelSetContainer, TCurvatureImage>::UpdatePixel(
87-
const LevelSetInputIndexType & itkNotUsed(iP),
88-
const LevelSetOutputRealType & itkNotUsed(oldValue),
89-
const LevelSetOutputRealType & itkNotUsed(newValue))
90-
{}
91-
9279
template <typename TInput, typename TLevelSetContainer, typename TCurvatureImage>
9380
auto
9481
LevelSetEquationCurvatureTerm<TInput, TLevelSetContainer, TCurvatureImage>::Value(const LevelSetInputIndexType & iP)

0 commit comments

Comments
 (0)