Commit 99fb09f5 authored by Antoine Regimbeau's avatar Antoine Regimbeau

REFAC: include what you use and remove itkNotUsed

parent 9974b898
...@@ -29,10 +29,10 @@ ...@@ -29,10 +29,10 @@
#include "itk_kwiml.h" #include "itk_kwiml.h"
#endif #endif
#include <string> #include <stdint.h> // for uint64_t
#include <boost/cstdint.hpp> #include <string> // for string
#include "itkLoggerBase.h" #include "OTBCommonExport.h" // for OTBCommon_EXPORT
#include "OTBCommonExport.h" #include "itkLoggerBase.h" // for LoggerBase, LoggerBase::PriorityLevelType
namespace otb namespace otb
{ {
......
...@@ -21,13 +21,14 @@ ...@@ -21,13 +21,14 @@
#ifndef otbExtendedFilenameHelper_h #ifndef otbExtendedFilenameHelper_h
#define otbExtendedFilenameHelper_h #define otbExtendedFilenameHelper_h
#include <map> #include <iosfwd> // for ostream
#include <vector> #include <string> // for string
#include <utility> // for pair
#include "itkObject.h"
#include "itkObjectFactory.h" #include "itkObjectFactory.h"
#include "OTBCommonExport.h" #include "itkMacro.h" // for itkGetStringMacro, ExtendedFilenameHelp...
#include <string> #include "itkSmartPointer.h" // for SmartPointer
#include "itkObject.h" // for Object
#include "OTBCommonExport.h" // for OTBCommon_EXPORT
namespace otb namespace otb
{ {
......
...@@ -22,11 +22,15 @@ ...@@ -22,11 +22,15 @@
#ifndef otbImageRegionAdaptativeSplitter_h #ifndef otbImageRegionAdaptativeSplitter_h
#define otbImageRegionAdaptativeSplitter_h #define otbImageRegionAdaptativeSplitter_h
#include "itkRegion.h" #include <iosfwd> // for ostream
#include "itkImageRegionSplitter.h" #include "itkImageRegion.h" // for ImageRegion
#include "itkIndex.h" #include "itkIndent.h" // for Indent
#include "itkSize.h" #include "itkMacro.h" // for itkGetConstReferenceMacro, itkSe...
#include "itkFastMutexLock.h" #include "itkSimpleFastMutexLock.h" // for SimpleFastMutexLock
#include "itkSmartPointer.h" // for SmartPointer
#include "itkImageRegionSplitter.h" // for ImageRegionSplitter
#include "itkIndex.h" // for Index
#include "itkSize.h" // for Size
namespace otb namespace otb
{ {
......
...@@ -22,11 +22,14 @@ ...@@ -22,11 +22,14 @@
#ifndef otbImageRegionNonUniformMultidimensionalSplitter_h #ifndef otbImageRegionNonUniformMultidimensionalSplitter_h
#define otbImageRegionNonUniformMultidimensionalSplitter_h #define otbImageRegionNonUniformMultidimensionalSplitter_h
#include "itkRegion.h" #include <iosfwd> // for ostream
#include "itkObjectFactory.h" #include "itkImageRegion.h" // for ImageRegion
#include "itkIndex.h" #include "itkIndent.h" // for Indent
#include "itkSize.h" #include "itkMacro.h" // for ITK_EXPORT, ImageRegionNonUnifor...
#include "itkImageRegionSplitter.h" #include "itkSmartPointer.h" // for SmartPointer
#include "itkImageRegionSplitter.h" // for ImageRegionSplitter
#include "itkIndex.h" // for Index
#include "itkSize.h" // for Size
namespace otb namespace otb
{ {
......
...@@ -22,11 +22,15 @@ ...@@ -22,11 +22,15 @@
#ifndef otbImageRegionSquareTileSplitter_h #ifndef otbImageRegionSquareTileSplitter_h
#define otbImageRegionSquareTileSplitter_h #define otbImageRegionSquareTileSplitter_h
#include "itkRegion.h" #include <iosfwd> // for ostream
#include "itkImageRegionSplitter.h" #include "itkFixedArray.h" // for FixedArray
#include "itkObjectFactory.h" #include "itkImageRegion.h" // for ImageRegion
#include "itkIndex.h" #include "itkIndent.h" // for Indent
#include "itkSize.h" #include "itkMacro.h" // for itkGetMacro, ITK_EXPORT, ImageRe...
#include "itkSmartPointer.h" // for SmartPointer
#include "itkImageRegionSplitter.h" // for ImageRegionSplitter
#include "itkIndex.h" // for Index
#include "itkSize.h" // for Size
namespace otb namespace otb
{ {
......
...@@ -63,7 +63,7 @@ ImageRegionSquareTileSplitter<VImageDimension> ...@@ -63,7 +63,7 @@ ImageRegionSquareTileSplitter<VImageDimension>
template <unsigned int VImageDimension> template <unsigned int VImageDimension>
itk::ImageRegion<VImageDimension> itk::ImageRegion<VImageDimension>
ImageRegionSquareTileSplitter<VImageDimension> ImageRegionSquareTileSplitter<VImageDimension>
::GetSplit(unsigned int i, unsigned int itkNotUsed(numberOfPieces), const RegionType& region) ::GetSplit(unsigned int i, unsigned int , const RegionType& region)
{ {
RegionType splitRegion; RegionType splitRegion;
IndexType splitIndex; IndexType splitIndex;
......
...@@ -22,11 +22,14 @@ ...@@ -22,11 +22,14 @@
#ifndef otbImageRegionTileMapSplitter_h #ifndef otbImageRegionTileMapSplitter_h
#define otbImageRegionTileMapSplitter_h #define otbImageRegionTileMapSplitter_h
#include "itkRegion.h" #include <iosfwd> // for ostream
#include "itkImageRegionSplitter.h" #include "itkImageRegion.h" // for ImageRegion
#include "itkObjectFactory.h" #include "itkIndent.h" // for Indent
#include "itkIndex.h" #include "itkMacro.h" // for ITK_EXPORT, ImageRegionTileMapSp...
#include "itkSize.h" #include "itkSmartPointer.h" // for SmartPointer
#include "itkImageRegionSplitter.h" // for ImageRegionSplitter
#include "itkIndex.h" // for Index
#include "itkSize.h" // for Size
namespace otb namespace otb
{ {
......
...@@ -21,11 +21,12 @@ ...@@ -21,11 +21,12 @@
#ifndef otbLogger_h #ifndef otbLogger_h
#define otbLogger_h #define otbLogger_h
#include <string> #include <string> // for string
#include "itkMacro.h" // for Logger::Clone, Logger::CreateAnother
#include "itkLoggerBase.h" #include "itkSmartPointer.h" // for SmartPointer
#include "itkLogger.h" #include "itkLogger.h" // for Logger
#include "OTBCommonExport.h" #include "itkLoggerBase.h" // for LoggerBase::PriorityLevelType
#include "OTBCommonExport.h" // for OTBCommon_EXPORT
namespace otb { namespace otb {
......
...@@ -21,9 +21,14 @@ ...@@ -21,9 +21,14 @@
#ifndef otbRectangle_h #ifndef otbRectangle_h
#define otbRectangle_h #define otbRectangle_h
#include "itkImageRegion.h" #include <iosfwd> // for ostream
#include "itkContinuousIndex.h" // for ContinuousIndex
#include "itkVectorContainer.h" #include "itkIndent.h" // for Indent
#include "itkMacro.h" // for itkGetMacro, itkSetMacro, ITK_EXPORT
#include "itkObject.h" // for Object
#include "itkSmartPointer.h" // for SmartPointer
#include "itkImageRegion.h" // for ImageRegion
#include "itkVectorContainer.h" // for VectorContainer
namespace otb namespace otb
{ {
......
...@@ -22,7 +22,10 @@ ...@@ -22,7 +22,10 @@
#ifndef otbStandardFilterWatcher_h #ifndef otbStandardFilterWatcher_h
#define otbStandardFilterWatcher_h #define otbStandardFilterWatcher_h
#include "otbFilterWatcherBase.h" #include <string> // for string
#include "OTBCommonExport.h" // for OTBCommon_EXPORT
#include "otbFilterWatcherBase.h" // for FilterWatcherBase
namespace itk { class ProcessObject; }
namespace otb namespace otb
{ {
......
...@@ -22,9 +22,10 @@ ...@@ -22,9 +22,10 @@
#ifndef otbStandardOneLineFilterWatcher_h #ifndef otbStandardOneLineFilterWatcher_h
#define otbStandardOneLineFilterWatcher_h #define otbStandardOneLineFilterWatcher_h
#include <iosfwd> #include <string> // for string
#include "OTBCommonExport.h" // for OTBCommon_EXPORT
#include "otbFilterWatcherBase.h" #include "otbFilterWatcherBase.h" // for FilterWatcherBase
namespace itk { class ProcessObject; }
namespace otb namespace otb
{ {
......
...@@ -22,11 +22,10 @@ ...@@ -22,11 +22,10 @@
#ifndef otbStandardWriterWatcher_h #ifndef otbStandardWriterWatcher_h
#define otbStandardWriterWatcher_h #define otbStandardWriterWatcher_h
#include <iosfwd> #include <string> // for string
#include "OTBCommonExport.h" // for OTBCommon_EXPORT
#include "otbWriterWatcherBase.h" #include "otbWriterWatcherBase.h" // for WriterWatcherBase
namespace itk { class ProcessObject; }
#include "OTBCommonExport.h"
namespace otb namespace otb
{ {
......
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
#ifndef otbStringToHTML_h #ifndef otbStringToHTML_h
#define otbStringToHTML_h #define otbStringToHTML_h
#include <string> #include <iosfwd> // for ostream
#include <string> // for string
#include "OTBCommonExport.h" #include "OTBCommonExport.h" // for OTBCommon_EXPORT
namespace otb namespace otb
{ {
......
...@@ -21,13 +21,10 @@ ...@@ -21,13 +21,10 @@
#ifndef otbSystem_h #ifndef otbSystem_h
#define otbSystem_h #define otbSystem_h
#include <string> #include <string> // for string
#include <vector> #include <vector>
#include "itksys/SystemTools.hxx" #include "itksys/SystemTools.hxx"
#include "itkMacro.h" #include "OTBCommonExport.h" // for OTBCommon_EXPORT
#include "OTBCommonExport.h"
namespace otb namespace otb
{ {
......
...@@ -21,11 +21,9 @@ ...@@ -21,11 +21,9 @@
#ifndef otbUtils_h #ifndef otbUtils_h
#define otbUtils_h #define otbUtils_h
#include <sstream> #include <sstream> // for stringstream
#include <string> #include <string> // for string
#include "OTBCommonExport.h" // for OTBCommon_EXPORT
#include "itkMacro.h"
#include "OTBCommonExport.h"
namespace otb namespace otb
{ {
...@@ -38,10 +36,10 @@ namespace otb ...@@ -38,10 +36,10 @@ namespace otb
* *
* \ingroup OTBCommon * \ingroup OTBCommon
*/ */
namespace Utils namespace Utils OTBCommon_EXPORT
{ {
/** Check that the values for lon, lat are reasonable */ /** Check that the values for lon, lat are reasonable */
bool OTBCommon_EXPORT IsLonLatValid(double lon, double lat); bool IsLonLatValid(double lon, double lat);
template <class T> template <class T>
inline std::string ConvertToString (const T& v) inline std::string ConvertToString (const T& v)
...@@ -52,11 +50,11 @@ namespace Utils ...@@ -52,11 +50,11 @@ namespace Utils
} }
/** Function that prints nothing (useful to disable libsvm logs)*/ /** Function that prints nothing (useful to disable libsvm logs)*/
void OTBCommon_EXPORT PrintNothing(const char *s); void PrintNothing(const char *s);
extern OTBCommon_EXPORT bool const TrueConstant; extern bool const TrueConstant;
extern OTBCommon_EXPORT bool const FalseConstant; extern bool const FalseConstant;
} }
} // namespace otb } // namespace otb
......
...@@ -18,21 +18,16 @@ ...@@ -18,21 +18,16 @@
* limitations under the License. * limitations under the License.
*/ */
#include "otbConfigurationManager.h" #include <string> // for string
#include "itkLoggerBase.h" // for LoggerBase, LoggerBase::::INFO, LoggerBas...
#include "otbMacro.h"
#include "otbLogger.h"
#include "itksys/SystemTools.hxx" #include "itksys/SystemTools.hxx"
#include "otbConfigurationManager.h"
#include <cstdlib> #include "otbMacro.h" // for otbLogMacro
#include <algorithm>
#include <string>
namespace otb namespace otb
{ {
namespace ConfigurationManager namespace ConfigurationManager OTBCommon_EXPORT
{ {
std::string GetDEMDirectory() std::string GetDEMDirectory()
......
...@@ -19,15 +19,12 @@ ...@@ -19,15 +19,12 @@
*/ */
#include "otbExtendedFilenameHelper.h" #include "otbExtendedFilenameHelper.h"
#include <cassert>
#include <ostream>
#include <stdexcept>
#include <string>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <cassert> // for assert
#include <ostream> // for ostream
#include <stdexcept> // for range_error
#include <string> // for string
#include "otb_boost_string_header.h" #include "otb_boost_string_header.h"
#include "otbStringUtils.h" #include "otbStringUtils.h"
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
*/ */
#include "otbFilterWatcherBase.h" #include "otbFilterWatcherBase.h"
namespace itk { class ProcessObject; }
namespace otb namespace otb
{ {
......
...@@ -18,13 +18,13 @@ ...@@ -18,13 +18,13 @@
* limitations under the License. * limitations under the License.
*/ */
#include <iostream> // for ostringstream
#include "otbLogger.h" #include "otbLogger.h"
#include "itksys/SystemTools.hxx" #include "itkStdStreamLogOutput.h" // for StdStreamLogOutput, StdStreamLogO...
#include "otbConfigurationManager.h" #include "otbConfigurationManager.h"
#include "itkStdStreamLogOutput.h"
#include <iostream>
#include "gdal.h" #include "gdal.h"
#include "itkMultiThreader.h" #include "itkMultiThreader.h"
#include "itksys/SystemTools.hxx"
namespace otb namespace otb
{ {
......
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
*/ */
#include "otbStandardFilterWatcher.h" #include "otbStandardFilterWatcher.h"
#include <iostream> // for cout
#include "otbStopwatch.h" // for Stopwatch
namespace itk { class ProcessObject; }
namespace otb namespace otb
{ {
......
...@@ -19,11 +19,10 @@ ...@@ -19,11 +19,10 @@
* limitations under the License. * limitations under the License.
*/ */
#include <iostream>
#include <sstream>
#include "otbStandardOneLineFilterWatcher.h" #include "otbStandardOneLineFilterWatcher.h"
#include "otbStopwatch.h" #include <iostream> // for cout
#include "otbStopwatch.h" // for Stopwatch
namespace itk { class ProcessObject; }
namespace otb namespace otb
{ {
......
...@@ -19,10 +19,11 @@ ...@@ -19,10 +19,11 @@
* limitations under the License. * limitations under the License.
*/ */
#include <iostream>
#include "otbStandardWriterWatcher.h" #include "otbStandardWriterWatcher.h"
#include "otbStopwatch.h" #include <iosfwd> // for ostringstream
#include <iostream> // for cout
#include "otbStopwatch.h" // for Stopwatch
namespace itk { class ProcessObject; }
namespace otb namespace otb
{ {
......
...@@ -18,12 +18,11 @@ ...@@ -18,12 +18,11 @@
* limitations under the License. * limitations under the License.
*/ */
#include "otbStopwatch.h"
#include <chrono> #include <chrono>
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
#include "otbStopwatch.h"
namespace otb namespace otb
{ {
void void
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
#include "otbSystem.h" #include "otbSystem.h"
#include <string> // strdup #include <cstddef> // for size_t
#include <cstdlib> #include <string> // for string
#if (defined(WIN32) || defined(WIN32CE)) && !defined(__CYGWIN__) && !defined(__MINGW32__) #if (defined(WIN32) || defined(WIN32CE)) && !defined(__CYGWIN__) && !defined(__MINGW32__)
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
namespace otb namespace otb
{ {
namespace System namespace System OTBCommon_EXPORT
{ {
//GetRootName from uiig library. //GetRootName from uiig library.
std::string GetRootName(const std::string& filename) std::string GetRootName(const std::string& filename)
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
namespace otb namespace otb
{ {
namespace Utils namespace Utils OTBCommon_EXPORT
{ {
bool IsLonLatValid(double lon, double lat) bool IsLonLatValid(double lon, double lat)
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
*/ */
#include "otbWriterWatcherBase.h" #include "otbWriterWatcherBase.h"
namespace itk { class ProcessObject; }
namespace otb namespace otb
{ {
......
...@@ -28,7 +28,7 @@ typedef RegionType::SizeType SizeType; ...@@ -28,7 +28,7 @@ typedef RegionType::SizeType SizeType;
typedef RegionType::IndexType IndexType; typedef RegionType::IndexType IndexType;
int otbImageRegionAdaptativeSplitter(int itkNotUsed(argc), char * argv[]) int otbImageRegionAdaptativeSplitter(int , char * argv[])
{ {
SizeType regionSize, tileHint; SizeType regionSize, tileHint;
IndexType regionIndex; IndexType regionIndex;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include "otbImageRegionNonUniformMultidimensionalSplitter.h" #include "otbImageRegionNonUniformMultidimensionalSplitter.h"
#include <fstream> #include <fstream>
int otbImageRegionNonUniformMultidimensionalSplitter(int itkNotUsed(argc), char * argv[]) int otbImageRegionNonUniformMultidimensionalSplitter(int , char * argv[])
{ {
const int Dimension = 2; const int Dimension = 2;
typedef otb::ImageRegionNonUniformMultidimensionalSplitter<Dimension> FilterType; typedef otb::ImageRegionNonUniformMultidimensionalSplitter<Dimension> FilterType;
......
...@@ -75,7 +75,7 @@ int TestSplitter(const RegionType& region, unsigned int PixelSize, unsigned int ...@@ -75,7 +75,7 @@ int TestSplitter(const RegionType& region, unsigned int PixelSize, unsigned int
} }
int otbImageRegionSquareTileSplitter(int itkNotUsed(argc), char * argv[]) int otbImageRegionSquareTileSplitter(int , char * argv[])
{ {
std::ofstream outfile(argv[1]); std::ofstream outfile(argv[1]);
RegionType region; RegionType region;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include "otbImageRegionTileMapSplitter.h" #include "otbImageRegionTileMapSplitter.h"
#include <fstream> #include <fstream>
int otbImageRegionTileMapSplitter(int itkNotUsed(argc), char * argv[]) int otbImageRegionTileMapSplitter(int , char * argv[])
{ {
const int Dimension = 2; const int Dimension = 2;
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "otbRGBAPixelConverter.h" #include "otbRGBAPixelConverter.h"
int otbRGBAPixelConverter(int itkNotUsed(argc), char * itkNotUsed(argv) []) int otbRGBAPixelConverter(int , char * [])
{ {
typedef unsigned int PixelType0; typedef unsigned int PixelType0;
typedef double PixelType1; typedef double PixelType1;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
int otbRectangle(int itkNotUsed(argc), char * argv[]) int otbRectangle(int , char * argv[])
{ {
const char * outfname = argv[1]; const char * outfname = argv[1];
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "otbStandardFilterWatcher.h" #include "otbStandardFilterWatcher.h"
#include "itkGradientMagnitudeImageFilter.h" #include "itkGradientMagnitudeImageFilter.h"
int otbStandardFilterWatcherNew(int itkNotUsed(argc), char * argv[]) int otbStandardFilterWatcherNew(int , char * argv[])
{ {
const unsigned int Dimension = 2; const unsigned int Dimension = 2;
typedef unsigned char PixelType; typedef unsigned char PixelType;
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "otbStandardOneLineFilterWatcher.h" #include "otbStandardOneLineFilterWatcher.h"
#include "itkGradientMagnitudeImageFilter.h" #include "itkGradientMagnitudeImageFilter.h"
int otbStandardOneLineFilterWatcherTest(int itkNotUsed(argc), char * argv[]) int otbStandardOneLineFilterWatcherTest(int , char * argv[])
{ {
const unsigned int Dimension = 2; const unsigned int Dimension = 2;
typedef unsigned char PixelType; typedef unsigned char PixelType;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "otbImageFileWriter.h" #include "otbImageFileWriter.h"
#include "otbImageFileWriter.h" #include "otbImageFileWriter.h"
int otbStandardWriterWatcher(int itkNotUsed(argc), char * argv[])