From aed9feec84c57cd702f46f22b1962ed14a642adf Mon Sep 17 00:00:00 2001 From: Cedric <cedric.traizet@c-s.fr> Date: Fri, 4 Jan 2019 13:18:47 +0100 Subject: [PATCH] ENH: remove otbOGRVersionProxy.h --- .../include/otbOGRDataSourceWrapper.h | 1 - .../GdalAdapters/include/otbOGRLayerWrapper.h | 1 - .../GdalAdapters/include/otbOGRVersionProxy.h | 84 ------------------- .../Adapters/GdalAdapters/src/CMakeLists.txt | 1 - .../GdalAdapters/src/otbOGRFieldWrapper.cxx | 1 - .../GdalAdapters/src/otbOGRVersionProxy.cxx | 54 ------------ Modules/IO/IOGDAL/include/otbOGRIOHelper.h | 1 - .../IO/IOGDAL/include/otbOGRVectorDataIO.h | 1 - Modules/IO/TestKernel/src/otbTestHelper.cxx | 1 - .../include/otbRasterizeVectorDataFilter.h | 1 - .../include/otbVectorDataToLabelImageFilter.h | 1 - 11 files changed, 147 deletions(-) delete mode 100644 Modules/Adapters/GdalAdapters/include/otbOGRVersionProxy.h delete mode 100644 Modules/Adapters/GdalAdapters/src/otbOGRVersionProxy.cxx diff --git a/Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.h b/Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.h index 98bb35c399..f3a149a974 100644 --- a/Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.h +++ b/Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.h @@ -45,7 +45,6 @@ #include "itkObjectFactory.h" // that should have been included by itkMacro.h #include "otbOGRLayerWrapper.h" -#include "otbOGRVersionProxy.h" #include "otbOGRExtendedFilenameToOptions.h" class OGRLayer; diff --git a/Modules/Adapters/GdalAdapters/include/otbOGRLayerWrapper.h b/Modules/Adapters/GdalAdapters/include/otbOGRLayerWrapper.h index 6b23090d10..7cce533131 100644 --- a/Modules/Adapters/GdalAdapters/include/otbOGRLayerWrapper.h +++ b/Modules/Adapters/GdalAdapters/include/otbOGRLayerWrapper.h @@ -36,7 +36,6 @@ #endif // #include "itkIndent.h", included from field #include "otbOGRFeatureWrapper.h" -#include "otbOGRVersionProxy.h" #include <string> // #include "ogr_core.h" // OGRwkbGeometryType, included from feature -> field diff --git a/Modules/Adapters/GdalAdapters/include/otbOGRVersionProxy.h b/Modules/Adapters/GdalAdapters/include/otbOGRVersionProxy.h deleted file mode 100644 index 5021d43978..0000000000 --- a/Modules/Adapters/GdalAdapters/include/otbOGRVersionProxy.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef otbOGRVersionProxy_h -#define otbOGRVersionProxy_h - -#include <string> -#include <vector> -#include "otbConfigure.h" -#include "itkMacro.h" - -#if defined(_MSC_VER) -#pragma warning ( push ) -#pragma warning ( disable: 4251 ) -#include "ogr_core.h" // OGR enums -#pragma warning ( pop ) -#else -#include "ogr_core.h" // OGR enums -#endif - -class GDALDataset; -class GDALDriver; -class OGRFeature; - -#include "OTBGdalAdaptersExport.h" - -namespace otb -{ -namespace ogr -{ -namespace version_proxy -{ - -/** - * This namespace holds proxy functions hiding interface changes in gdal 2.0 - * - * This namespace holds proxy functions hiding interface changes in OGR - * dataset between gdal 1.x (x>10) and gdal 2.x. It defines a common - * interface that should be used in place of calling directly the - * wrapped gdal functions. - * - * Whenever GDALDataset and GDALDriver have to be used to open a - * vector dataset (or OGRDataSource an OGRSFDriver for gdal 1.x), one - * should use ogr::version_proxy types GDALDataset and - * GDALDriver. - * - * See function documentation for details. - */ - - /** - * Return the list of files composing the dataset. - * - * Calls OGRDataSource::GetName() and wrap in string vector for gdal - * 1.x implementation, and GDALDataset::GetFileList and wrap in - * string vector for gdal 2.x implementation. - * - * \param dataset Pointer to the dataset to get the file list from. Will not be - * checked for null pointer. - * - * \return A vector of string containing the list of files. - */ - -} -} -} // end namespace otb - -#endif diff --git a/Modules/Adapters/GdalAdapters/src/CMakeLists.txt b/Modules/Adapters/GdalAdapters/src/CMakeLists.txt index a93505302f..b5d09907db 100644 --- a/Modules/Adapters/GdalAdapters/src/CMakeLists.txt +++ b/Modules/Adapters/GdalAdapters/src/CMakeLists.txt @@ -28,7 +28,6 @@ set(OTBGdalAdapters_SRC otbOGRDriversInit.cxx otbGeometriesToGeometriesFilter.cxx otbOGRDataSourceWrapper.cxx - otbOGRVersionProxy.cxx otbOGRExtendedFilenameToOptions.cxx otbOGRHelpers.cxx ) diff --git a/Modules/Adapters/GdalAdapters/src/otbOGRFieldWrapper.cxx b/Modules/Adapters/GdalAdapters/src/otbOGRFieldWrapper.cxx index 7e12f398ba..7bf292e901 100644 --- a/Modules/Adapters/GdalAdapters/src/otbOGRFieldWrapper.cxx +++ b/Modules/Adapters/GdalAdapters/src/otbOGRFieldWrapper.cxx @@ -37,7 +37,6 @@ #endif #include "otbOGRFeatureWrapper.h" #include "otbJoinContainer.h" -#include "otbOGRVersionProxy.h" #include <boost/array.hpp> /*===========================================================================*/ /*===========================[ Static Assertions ]===========================*/ diff --git a/Modules/Adapters/GdalAdapters/src/otbOGRVersionProxy.cxx b/Modules/Adapters/GdalAdapters/src/otbOGRVersionProxy.cxx deleted file mode 100644 index 479ecaf705..0000000000 --- a/Modules/Adapters/GdalAdapters/src/otbOGRVersionProxy.cxx +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES) - * - * This file is part of Orfeo Toolbox - * - * https://www.orfeo-toolbox.org/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "otbOGRVersionProxy.h" -#include "otbOGRHelpers.h" - -#include "itkMacro.h" - -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wshadow" -#if GDAL_VERSION_NUM<2000000 -#include "ogrsf_frmts.h" -#else -#include "gdal_priv.h" -#endif -#include "ogr_feature.h" -#pragma GCC diagnostic pop -#else -#if GDAL_VERSION_NUM<2000000 -#include "ogrsf_frmts.h" -#else -#include "gdal_priv.h" -#endif -#include "ogr_feature.h" -#endif // __GNUC__ || __clang__ - -namespace otbscon -{ -namespace ogr -{ -namespace version_proxy -{ -} -} -} // end namespace - diff --git a/Modules/IO/IOGDAL/include/otbOGRIOHelper.h b/Modules/IO/IOGDAL/include/otbOGRIOHelper.h index 0f5ceae562..5427f030c6 100644 --- a/Modules/IO/IOGDAL/include/otbOGRIOHelper.h +++ b/Modules/IO/IOGDAL/include/otbOGRIOHelper.h @@ -24,7 +24,6 @@ #include <vector> #include "otbVectorData.h" -#include "otbOGRVersionProxy.h" #include "OTBIOGDALExport.h" diff --git a/Modules/IO/IOGDAL/include/otbOGRVectorDataIO.h b/Modules/IO/IOGDAL/include/otbOGRVectorDataIO.h index ef1ca7bd50..d743bfa2b5 100644 --- a/Modules/IO/IOGDAL/include/otbOGRVectorDataIO.h +++ b/Modules/IO/IOGDAL/include/otbOGRVectorDataIO.h @@ -26,7 +26,6 @@ #include "otbVectorDataIOBase.h" #include "otbVectorData.h" -#include "otbOGRVersionProxy.h" #include "OTBIOGDALExport.h" diff --git a/Modules/IO/TestKernel/src/otbTestHelper.cxx b/Modules/IO/TestKernel/src/otbTestHelper.cxx index 8fa2f19aa5..e849b01295 100644 --- a/Modules/IO/TestKernel/src/otbTestHelper.cxx +++ b/Modules/IO/TestKernel/src/otbTestHelper.cxx @@ -48,7 +48,6 @@ #include "otbDifferenceImageFilter.h" #include "otbPrintableImageFilter.h" #include "otbStreamingShrinkImageFilter.h" -#include "otbOGRVersionProxy.h" #include "otbOGRHelpers.h" #include "otbConfigure.h" diff --git a/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.h b/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.h index 05bb3db516..f7fbf00ff5 100644 --- a/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.h +++ b/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.h @@ -31,7 +31,6 @@ #include "gdal.h" #include "gdal_alg.h" #include "ogr_srs_api.h" -#include "otbOGRVersionProxy.h" namespace otb { diff --git a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.h b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.h index bd85f0b618..d67617fc17 100644 --- a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.h +++ b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.h @@ -29,7 +29,6 @@ #include "gdal.h" #include "ogr_api.h" -#include "otbOGRVersionProxy.h" #include <string> namespace otb { -- GitLab