Skip to content

Commit

Permalink
COMP: Added override by Clang Tidy-Fix modernize-use-override
Browse files Browse the repository at this point in the history
Added override specifiers by running Tidy-Fix (Clang Power Tools 4.10.1 in Visual Studio 2017).

Aims to fix elastix issue #110 ("-Winconsistent-missing-override on MacOS") by Harmen Stoppels (@haampie)

As I was using the default modernize-use-override options, Tidy-Fix also added `override` specifiers to destructors. (Which appears under discussion: 'C.128: Should destructors be marked "override"?' isocpp/CppCoreGuidelines#721).

Moreover, Tidy-Fix has removed `virtual` keywords that are not required.

See https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html
  • Loading branch information
N-Dekker committed Apr 7, 2019
1 parent dbb19f6 commit bb6bf2f
Show file tree
Hide file tree
Showing 143 changed files with 812 additions and 812 deletions.
6 changes: 3 additions & 3 deletions Common/CostFunctions/itkAdvancedImageToImageMetric.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class AdvancedImageToImageMetric :
* \li Check if a B-spline interpolator has been set
* \li Check if an AdvancedTransform has been set
*/
virtual void Initialize( void ) override;
void Initialize( void ) override;

/** Experimental feature: compute SelfHessian.
* This base class just returns an identity matrix of the right size.
Expand Down Expand Up @@ -297,10 +297,10 @@ class AdvancedImageToImageMetric :
AdvancedImageToImageMetric();

/** Destructor. */
virtual ~AdvancedImageToImageMetric();
~AdvancedImageToImageMetric() override;

/** PrintSelf. */
void PrintSelf( std::ostream & os, Indent indent ) const;
void PrintSelf( std::ostream & os, Indent indent ) const override;

/** Protected Typedefs ******************/

Expand Down
4 changes: 2 additions & 2 deletions Common/CostFunctions/itkLimiterFunctionBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class LimiterFunctionBase :
itkGetStaticConstMacro( Dimension ) > DerivativeType;

/** Limit the input value. */
virtual OutputType Evaluate( const InputType & input ) const = 0;
OutputType Evaluate( const InputType & input ) const override = 0;

/** Limit the input value and change the input function derivative accordingly */
virtual OutputType Evaluate( const InputType & input, DerivativeType & derivative ) const = 0;
Expand Down Expand Up @@ -114,7 +114,7 @@ class LimiterFunctionBase :
}


~LimiterFunctionBase(){}
~LimiterFunctionBase() override{}

OutputType m_UpperBound;
OutputType m_LowerBound;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,23 +143,23 @@ class ParzenWindowHistogramImageToImageMetric :
* (3) InitializeKernels()
* (4) Resize AlphaDerivatives
*/
void Initialize( void );
void Initialize( void ) override;

/** Get the derivatives of the match measure. This method simply calls the
* the GetValueAndDerivative, since this will be mostly almost as fast
* as just computing the derivative.
*/
void GetDerivative(
const ParametersType & parameters,
DerivativeType & Derivative ) const;
DerivativeType & Derivative ) const override;

/** Get the value and derivatives for single valued optimizers.
* This method calls this->GetValueAndAnalyticDerivative or
* this->GetValueAndFiniteDifferenceDerivative, depending on the bool
* m_UseFiniteDifferenceDerivative.
*/
void GetValueAndDerivative( const ParametersType & parameters,
MeasureType & value, DerivativeType & derivative ) const;
MeasureType & value, DerivativeType & derivative ) const override;

/** Number of bins to use for the fixed image in the histogram.
* Typical value is 32. The minimum value is 4 due to the padding
Expand Down Expand Up @@ -221,10 +221,10 @@ class ParzenWindowHistogramImageToImageMetric :
ParzenWindowHistogramImageToImageMetric();

/** The destructor. */
virtual ~ParzenWindowHistogramImageToImageMetric();
~ParzenWindowHistogramImageToImageMetric() override;

/** Print Self. */
void PrintSelf( std::ostream & os, Indent indent ) const;
void PrintSelf( std::ostream & os, Indent indent ) const override;

/** Protected Typedefs ******************/

Expand Down Expand Up @@ -322,7 +322,7 @@ class ParzenWindowHistogramImageToImageMetric :
mutable ThreadIdType m_ParzenWindowHistogramGetValueAndDerivativePerThreadVariablesSize;

/** Initialize threading related parameters. */
virtual void InitializeThreadingParameters( void ) const;
void InitializeThreadingParameters( void ) const override;

/** Multi-threaded versions of the ComputePDF function. */
inline void ThreadedComputePDFs( ThreadIdType threadId );
Expand Down
16 changes: 8 additions & 8 deletions Common/CostFunctions/itkScaledSingleValuedCostFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,24 @@ class ScaledSingleValuedCostFunction : public SingleValuedCostFunction
/** Divide the parameters by the scales and call the GetValue routine
* of the unscaled cost function.
*/
virtual MeasureType GetValue( const ParametersType & parameters ) const;
MeasureType GetValue( const ParametersType & parameters ) const override;

/** Divide the parameters by the scales, call the GetDerivative routine
* of the unscaled cost function and divide the resulting derivative by
* the scales.
*/
virtual void GetDerivative(
void GetDerivative(
const ParametersType & parameters,
DerivativeType & derivative ) const;
DerivativeType & derivative ) const override;

/** Same procedure as in GetValue and GetDerivative. */
virtual void GetValueAndDerivative(
void GetValueAndDerivative(
const ParametersType & parameters,
MeasureType & value,
DerivativeType & derivative ) const;
DerivativeType & derivative ) const override;

/** Ask the UnscaledCostFunction how many parameters it has. */
virtual NumberOfParametersType GetNumberOfParameters( void ) const;
NumberOfParametersType GetNumberOfParameters( void ) const override;

/** Set the cost function that needs scaling. */
itkSetObjectMacro( UnscaledCostFunction, Superclass );
Expand Down Expand Up @@ -131,10 +131,10 @@ class ScaledSingleValuedCostFunction : public SingleValuedCostFunction
/** The constructor. */
ScaledSingleValuedCostFunction();
/** The destructor. */
virtual ~ScaledSingleValuedCostFunction() {}
~ScaledSingleValuedCostFunction() override {}

/** PrintSelf. */
void PrintSelf( std::ostream & os, Indent indent ) const;
void PrintSelf( std::ostream & os, Indent indent ) const override;

private:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class SingleValuedPointSetToPointSetMetric :
void SetTransformParameters( const ParametersType & parameters ) const;

/** Return the number of parameters required by the transform. */
unsigned int GetNumberOfParameters( void ) const
unsigned int GetNumberOfParameters( void ) const override
{ return this->m_Transform->GetNumberOfParameters(); }

/** Initialize the Metric by making sure that all the components are
Expand Down Expand Up @@ -174,10 +174,10 @@ class SingleValuedPointSetToPointSetMetric :
protected:

SingleValuedPointSetToPointSetMetric();
virtual ~SingleValuedPointSetToPointSetMetric() {}
~SingleValuedPointSetToPointSetMetric() override {}

/** PrintSelf. */
void PrintSelf( std::ostream & os, Indent indent ) const;
void PrintSelf( std::ostream & os, Indent indent ) const override;

/** Member variables. */
FixedPointSetConstPointer m_FixedPointSet;
Expand Down
14 changes: 7 additions & 7 deletions Common/ImageSamplers/itkImageFullSampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ class ImageFullSampler :
/** Selecting new samples makes no sense if nothing changed.
* The same samples would be selected anyway.
*/
virtual bool SelectNewSamplesOnUpdate( void )
bool SelectNewSamplesOnUpdate( void ) override
{
return false;
}


/** Returns whether the sampler supports SelectNewSamplesOnUpdate(). */
virtual bool SelectingNewSamplesOnUpdateSupported( void ) const
bool SelectingNewSamplesOnUpdateSupported( void ) const override
{
return false;
}
Expand All @@ -94,18 +94,18 @@ class ImageFullSampler :
/** The constructor. */
ImageFullSampler() {}
/** The destructor. */
virtual ~ImageFullSampler() {}
~ImageFullSampler() override {}

/** PrintSelf. */
void PrintSelf( std::ostream & os, Indent indent ) const;
void PrintSelf( std::ostream & os, Indent indent ) const override;

/** Function that does the work. */
virtual void GenerateData( void );
void GenerateData( void ) override;

/** Multi-threaded function that does the work. */
virtual void ThreadedGenerateData(
void ThreadedGenerateData(
const InputImageRegionType & inputRegionForThread,
ThreadIdType threadId );
ThreadIdType threadId ) override;

private:

Expand Down
12 changes: 6 additions & 6 deletions Common/ImageSamplers/itkImageGridSampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,19 @@ class ImageGridSampler :
*
* This function overrules any previous calls to SetSampleGridSpacing.
*/
virtual void SetNumberOfSamples( unsigned long nrofsamples );
void SetNumberOfSamples( unsigned long nrofsamples ) override;

/** Selecting new samples makes no sense if nothing changed. The same
* samples would be selected anyway.
*/
virtual bool SelectNewSamplesOnUpdate( void )
bool SelectNewSamplesOnUpdate( void ) override
{
return false;
}


/** Returns whether the sampler supports SelectNewSamplesOnUpdate() */
virtual bool SelectingNewSamplesOnUpdateSupported( void ) const
bool SelectingNewSamplesOnUpdateSupported( void ) const override
{
return false;
}
Expand All @@ -137,13 +137,13 @@ class ImageGridSampler :
ImageGridSampler();

/** The destructor. */
virtual ~ImageGridSampler() {}
~ImageGridSampler() override {}

/** PrintSelf. */
void PrintSelf( std::ostream & os, Indent indent ) const;
void PrintSelf( std::ostream & os, Indent indent ) const override;

/** Function that does the work. */
virtual void GenerateData( void );
void GenerateData( void ) override;

/** An array of integer spacing factors */
SampleGridSpacingType m_SampleGridSpacing;
Expand Down
12 changes: 6 additions & 6 deletions Common/ImageSamplers/itkImageRandomCoordinateSampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,20 @@ class ImageRandomCoordinateSampler :
/** The constructor. */
ImageRandomCoordinateSampler();
/** The destructor. */
virtual ~ImageRandomCoordinateSampler() {}
~ImageRandomCoordinateSampler() override {}

/** PrintSelf. */
void PrintSelf( std::ostream & os, Indent indent ) const;
void PrintSelf( std::ostream & os, Indent indent ) const override;

/** Function that does the work. */
virtual void GenerateData( void );
void GenerateData( void ) override;

/** Multi-threaded functionality that does the work. */
virtual void BeforeThreadedGenerateData( void );
void BeforeThreadedGenerateData( void ) override;

virtual void ThreadedGenerateData(
void ThreadedGenerateData(
const InputImageRegionType & inputRegionForThread,
ThreadIdType threadId );
ThreadIdType threadId ) override;

/** Generate a point randomly in a bounding box. */
virtual void GenerateRandomCoordinate(
Expand Down
8 changes: 4 additions & 4 deletions Common/ImageSamplers/itkImageRandomSampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ class ImageRandomSampler :
/** The constructor. */
ImageRandomSampler() {}
/** The destructor. */
virtual ~ImageRandomSampler() {}
~ImageRandomSampler() override {}

/** Functions that do the work. */
virtual void GenerateData( void );
void GenerateData( void ) override;

virtual void ThreadedGenerateData(
void ThreadedGenerateData(
const InputImageRegionType & inputRegionForThread,
ThreadIdType threadId );
ThreadIdType threadId ) override;

private:

Expand Down
6 changes: 3 additions & 3 deletions Common/ImageSamplers/itkImageRandomSamplerBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ class ImageRandomSamplerBase :
ImageRandomSamplerBase();

/** The destructor. */
virtual ~ImageRandomSamplerBase() {}
~ImageRandomSamplerBase() override {}

/** Multi-threaded function that does the work. */
virtual void BeforeThreadedGenerateData( void );
void BeforeThreadedGenerateData( void ) override;

/** PrintSelf. */
void PrintSelf( std::ostream & os, Indent indent ) const;
void PrintSelf( std::ostream & os, Indent indent ) const override;

/** Member variable used when threading. */
std::vector< double > m_RandomNumberList;
Expand Down
12 changes: 6 additions & 6 deletions Common/ImageSamplers/itkImageRandomSamplerSparseMask.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,20 @@ class ImageRandomSamplerSparseMask :
/** The constructor. */
ImageRandomSamplerSparseMask();
/** The destructor. */
virtual ~ImageRandomSamplerSparseMask() {}
~ImageRandomSamplerSparseMask() override {}

/** PrintSelf. */
void PrintSelf( std::ostream & os, Indent indent ) const;
void PrintSelf( std::ostream & os, Indent indent ) const override;

/** Function that does the work. */
virtual void GenerateData( void );
void GenerateData( void ) override;

/** Multi-threaded functionality that does the work. */
virtual void BeforeThreadedGenerateData( void );
void BeforeThreadedGenerateData( void ) override;

virtual void ThreadedGenerateData(
void ThreadedGenerateData(
const InputImageRegionType & inputRegionForThread,
ThreadIdType threadId );
ThreadIdType threadId ) override;

RandomGeneratorPointer m_RandomGenerator;
InternalFullSamplerPointer m_InternalFullSampler;
Expand Down
10 changes: 5 additions & 5 deletions Common/ImageSamplers/itkImageSamplerBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ class ImageSamplerBase :
ImageSamplerBase();

/** The destructor. */
virtual ~ImageSamplerBase() {}
~ImageSamplerBase() override {}

/** PrintSelf. */
void PrintSelf( std::ostream & os, Indent indent ) const;
void PrintSelf( std::ostream & os, Indent indent ) const override;

/** GenerateInputRequestedRegion. */
virtual void GenerateInputRequestedRegion( void );
void GenerateInputRequestedRegion( void ) override;

/** IsInsideAllMasks. */
virtual bool IsInsideAllMasks( const InputImagePointType & point ) const;
Expand All @@ -200,9 +200,9 @@ class ImageSamplerBase :
void CropInputImageRegion( void );

/** Multi-threaded function that does the work. */
virtual void BeforeThreadedGenerateData( void );
void BeforeThreadedGenerateData( void ) override;

virtual void AfterThreadedGenerateData( void );
void AfterThreadedGenerateData( void ) override;

/***/
unsigned long m_NumberOfSamples;
Expand Down
8 changes: 4 additions & 4 deletions Common/ImageSamplers/itkImageToVectorContainerFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ImageToVectorContainerFilter :
typedef typename InputImageType::PixelType InputImagePixelType;

/** Create a valid output. */
DataObject::Pointer MakeOutput( unsigned int idx );
DataObject::Pointer MakeOutput( unsigned int idx ) override;

/** Set the input image of this process object. */
void SetInput( unsigned int idx, const InputImageType * input );
Expand Down Expand Up @@ -96,7 +96,7 @@ class ImageToVectorContainerFilter :
* instead.
*
* \sa ThreadedGenerateData() */
virtual void GenerateData( void );
void GenerateData( void ) override;

/** If an imaging filter can be implemented as a multithreaded
* algorithm, the filter will provide an implementation of
Expand Down Expand Up @@ -172,10 +172,10 @@ class ImageToVectorContainerFilter :
/** The constructor. */
ImageToVectorContainerFilter();
/** The destructor. */
virtual ~ImageToVectorContainerFilter() {}
~ImageToVectorContainerFilter() override {}

/** PrintSelf. */
void PrintSelf( std::ostream & os, Indent indent ) const;
void PrintSelf( std::ostream & os, Indent indent ) const override;

private:

Expand Down
Loading

0 comments on commit bb6bf2f

Please sign in to comment.