diff --git a/Code/BasicFilters/otbFastICAImageFilter.txx b/Code/BasicFilters/otbFastICAImageFilter.txx index 242aabcfea2c90cee21bd9b20fa164fc01e2c746..06540a8d66f8cf9fa04371afc418c54497ef66ad 100644 --- a/Code/BasicFilters/otbFastICAImageFilter.txx +++ b/Code/BasicFilters/otbFastICAImageFilter.txx @@ -65,9 +65,9 @@ FastICAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation > { Superclass::GenerateOutputInformation(); - switch ( DirectionOfTransformation ) + switch ( static_cast<int>(DirectionOfTransformation) ) { - case Transform::FORWARD: + case static_cast<int>(Transform::FORWARD): { if ( m_NumberOfPrincipalComponentsRequired == 0 || m_NumberOfPrincipalComponentsRequired @@ -81,7 +81,7 @@ FastICAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation > m_NumberOfPrincipalComponentsRequired ); break; } - case Transform::INVERSE: + case static_cast<int>(Transform::INVERSE): { unsigned int theOutputDimension = 0; if ( m_GivenTransformationMatrix ) @@ -113,17 +113,17 @@ void FastICAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation > ::GenerateData () { - switch ( DirectionOfTransformation ) - { - case Transform::FORWARD: + switch ( static_cast<int>(DirectionOfTransformation) ) + { + case static_cast<int>(Transform::FORWARD): return ForwardGenerateData(); - case Transform::INVERSE: + case static_cast<int>(Transform::INVERSE): return ReverseGenerateData(); default: throw itk::ExceptionObject(__FILE__, __LINE__, - "Class should be templated with FORWARD or INVERSE only...", - ITK_LOCATION ); - } + "Class should be templated with FORWARD or INVERSE only...", + ITK_LOCATION ); + } } template < class TInputImage, class TOutputImage, diff --git a/Code/BasicFilters/otbMNFImageFilter.txx b/Code/BasicFilters/otbMNFImageFilter.txx index 07b3fd668ed21aeca604869f44043db0908a3451..69d6028b0df8c64542949f43f4a804614129a579 100644 --- a/Code/BasicFilters/otbMNFImageFilter.txx +++ b/Code/BasicFilters/otbMNFImageFilter.txx @@ -65,9 +65,9 @@ MNFImageFilter< TInputImage, TOutputImage, TNoiseImageFilter, TDirectionOfTransf { Superclass::GenerateOutputInformation(); - switch ( DirectionOfTransformation ) + switch ( static_cast<int>(DirectionOfTransformation) ) { - case Transform::FORWARD: + case static_cast<int>(Transform::FORWARD): { if ( m_NumberOfPrincipalComponentsRequired == 0 || m_NumberOfPrincipalComponentsRequired @@ -81,7 +81,7 @@ MNFImageFilter< TInputImage, TOutputImage, TNoiseImageFilter, TDirectionOfTransf m_NumberOfPrincipalComponentsRequired ); break; } - case Transform::INVERSE: + case static_cast<int>(Transform::INVERSE): { unsigned int theOutputDimension = 0; if ( m_GivenTransformationMatrix ) @@ -122,14 +122,14 @@ MNFImageFilter< TInputImage, TOutputImage, TNoiseImageFilter, TDirectionOfTransf { switch ( DirectionOfTransformation ) { - case Transform::FORWARD: - return ForwardGenerateData(); - case Transform::INVERSE: - return ReverseGenerateData(); - default: // should not go so far - throw itk::ExceptionObject(__FILE__, __LINE__, - "Class should be templated with FORWARD or INVERSE only...", - ITK_LOCATION ); + case static_cast<int>(Transform::FORWARD): + return ForwardGenerateData(); + case static_cast<int>(Transform::INVERSE): + return ReverseGenerateData(); + default: // should not go so far + throw itk::ExceptionObject(__FILE__, __LINE__, + "Class should be templated with FORWARD or INVERSE only...", + ITK_LOCATION ); } } diff --git a/Code/BasicFilters/otbPCAImageFilter.txx b/Code/BasicFilters/otbPCAImageFilter.txx index b5b9bea86507e2215f977b22fe6bf66c4794d86b..05060c3026a79962e8a9c080b5d14b898b764275 100644 --- a/Code/BasicFilters/otbPCAImageFilter.txx +++ b/Code/BasicFilters/otbPCAImageFilter.txx @@ -57,55 +57,54 @@ template < class TInputImage, class TOutputImage, void PCAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation > ::GenerateOutputInformation() -// throw itk::ExceptionObject { Superclass::GenerateOutputInformation(); - switch ( DirectionOfTransformation ) - { - case Transform::FORWARD: + switch ( static_cast<int>(DirectionOfTransformation) ) + { + case static_cast<int>(Transform::FORWARD): { - if ( m_NumberOfPrincipalComponentsRequired == 0 - || m_NumberOfPrincipalComponentsRequired - > this->GetInput()->GetNumberOfComponentsPerPixel() ) + if ( m_NumberOfPrincipalComponentsRequired == 0 + || m_NumberOfPrincipalComponentsRequired + > this->GetInput()->GetNumberOfComponentsPerPixel() ) { - m_NumberOfPrincipalComponentsRequired = - this->GetInput()->GetNumberOfComponentsPerPixel(); + m_NumberOfPrincipalComponentsRequired = + this->GetInput()->GetNumberOfComponentsPerPixel(); } - - this->GetOutput()->SetNumberOfComponentsPerPixel( - m_NumberOfPrincipalComponentsRequired ); - break; + + this->GetOutput()->SetNumberOfComponentsPerPixel( + m_NumberOfPrincipalComponentsRequired ); + break; } - case Transform::INVERSE: + case static_cast<int>(Transform::INVERSE): { - unsigned int theOutputDimension = 0; - if ( m_GivenTransformationMatrix ) + unsigned int theOutputDimension = 0; + if ( m_GivenTransformationMatrix ) { - theOutputDimension = m_TransformationMatrix.Rows() >= m_TransformationMatrix.Cols() ? - m_TransformationMatrix.Rows() : m_TransformationMatrix.Cols(); + theOutputDimension = m_TransformationMatrix.Rows() >= m_TransformationMatrix.Cols() ? + m_TransformationMatrix.Rows() : m_TransformationMatrix.Cols(); } - else if ( m_GivenCovarianceMatrix ) + else if ( m_GivenCovarianceMatrix ) { - theOutputDimension = m_CovarianceMatrix.Rows() >= m_CovarianceMatrix.Cols() ? - m_CovarianceMatrix.Rows() : m_CovarianceMatrix.Cols(); + theOutputDimension = m_CovarianceMatrix.Rows() >= m_CovarianceMatrix.Cols() ? + m_CovarianceMatrix.Rows() : m_CovarianceMatrix.Cols(); } - else + else { - throw itk::ExceptionObject(__FILE__, __LINE__, - "Covariance or transformation matrix required to know the output size", - ITK_LOCATION); + throw itk::ExceptionObject(__FILE__, __LINE__, + "Covariance or transformation matrix required to know the output size", + ITK_LOCATION); } - - this->GetOutput()->SetNumberOfComponentsPerPixel( theOutputDimension ); - - break; + + this->GetOutput()->SetNumberOfComponentsPerPixel( theOutputDimension ); + + break; } default: throw itk::ExceptionObject(__FILE__, __LINE__, - "Class should be templeted with FORWARD or INVERSE only...", - ITK_LOCATION ); - } + "Class should be templeted with FORWARD or INVERSE only...", + ITK_LOCATION ); + } } template < class TInputImage, class TOutputImage, @@ -114,11 +113,11 @@ void PCAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation > ::GenerateData () { - switch ( DirectionOfTransformation ) + switch ( static_cast<int>(DirectionOfTransformation) ) { - case Transform::FORWARD: + case static_cast<int>(Transform::FORWARD): return ForwardGenerateData(); - case Transform::INVERSE: + case static_cast<int>(Transform::INVERSE): return ReverseGenerateData(); default: throw itk::ExceptionObject(__FILE__, __LINE__,