From cf68b6bc0e28e80e8604322b03b79d42c06fe5a6 Mon Sep 17 00:00:00 2001 From: OTB Bot <otbbot@orfeo-toolbox.org> Date: Wed, 18 Apr 2012 19:57:46 +0200 Subject: [PATCH] STYLE --- .../DisparityMap/otbDisparityMapToDEMFilter.h | 6 +-- .../otbDisparityMapToDEMFilter.txx | 50 +++++++++---------- .../OGRAdapters/otbOGRDataSourceWrapper.cxx | 6 +-- .../OGRAdapters/otbOGRFeatureWrapper.cxx | 4 +- .../OGRAdapters/otbOGRFeatureWrapper.h | 4 +- .../OGRAdapters/otbOGRLayerWrapper.cxx | 2 +- .../OGRAdapters/otbOGRLayerWrapper.h | 8 +-- 7 files changed, 40 insertions(+), 40 deletions(-) diff --git a/Code/DisparityMap/otbDisparityMapToDEMFilter.h b/Code/DisparityMap/otbDisparityMapToDEMFilter.h index 45d44e19e0..e90afed262 100644 --- a/Code/DisparityMap/otbDisparityMapToDEMFilter.h +++ b/Code/DisparityMap/otbDisparityMapToDEMFilter.h @@ -31,8 +31,8 @@ namespace otb /** \class DisparityMapToDEMFilter * \brief Project an input disparity map into a regular DEM * - * This filter uses an input disparity map (horizontal and vertical) to produce a DEM with a regular sampling - * in the chosen map projection system. The elevation is computed from the triangulation of the "left-right" pairs + * This filter uses an input disparity map (horizontal and vertical) to produce a DEM with a regular sampling + * in the chosen map projection system. The elevation is computed from the triangulation of the "left-right" pairs * of pixels matched. When several elevations are possible on a DEM cell, the highest is kept. * * The inputs are: @@ -54,7 +54,7 @@ namespace otb * \ingroup Threaded * */ -template <class TDisparityImage, class TInputImage, class TOutputDEMImage = TDisparityImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage = TDisparityImage, class TEpipolarGridImage = TDisparityImage, class TMaskImage = otb::Image<unsigned char> > class ITK_EXPORT DisparityMapToDEMFilter : public itk::ImageToImageFilter<TDisparityImage,TOutputDEMImage> diff --git a/Code/DisparityMap/otbDisparityMapToDEMFilter.txx b/Code/DisparityMap/otbDisparityMapToDEMFilter.txx index 378a186bd9..6aa95419b9 100644 --- a/Code/DisparityMap/otbDisparityMapToDEMFilter.txx +++ b/Code/DisparityMap/otbDisparityMapToDEMFilter.txx @@ -27,7 +27,7 @@ namespace otb { -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> ::DisparityMapToDEMFilter() @@ -50,13 +50,13 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri m_GeoidFile = ""; } -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> ::~DisparityMapToDEMFilter() {} -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> void DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> @@ -66,7 +66,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri this->SetNthInput(0, const_cast<TDisparityImage *>( hmap )); } -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> void DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> @@ -76,7 +76,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri this->SetNthInput(1, const_cast<TDisparityImage *>( vmap )); } -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> void DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> @@ -86,7 +86,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri this->SetNthInput(2, const_cast<TInputImage *>( image )); } -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> void DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> @@ -96,7 +96,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri this->SetNthInput(3, const_cast<TInputImage *>( image )); } -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> void DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> @@ -106,7 +106,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri this->SetNthInput(4, const_cast<TEpipolarGridImage *>( grid )); } -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> void DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> @@ -116,7 +116,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri this->SetNthInput(5, const_cast<TEpipolarGridImage *>( grid )); } -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> void DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> @@ -126,7 +126,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri this->SetNthInput(6, const_cast<TMaskImage *>( mask )); } -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> const TDisparityImage * DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> @@ -139,7 +139,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri return static_cast<const TDisparityImage *>(this->itk::ProcessObject::GetInput(0)); } -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> const TDisparityImage * DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> @@ -152,7 +152,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri return static_cast<const TDisparityImage *>(this->itk::ProcessObject::GetInput(1)); } -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> const TInputImage * DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> @@ -165,7 +165,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri return static_cast<const TInputImage *>(this->itk::ProcessObject::GetInput(2)); } -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> const TInputImage * DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> @@ -178,7 +178,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri return static_cast<const TInputImage *>(this->itk::ProcessObject::GetInput(3)); } -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> const TEpipolarGridImage * DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> @@ -191,7 +191,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri return static_cast<const TEpipolarGridImage *>(this->itk::ProcessObject::GetInput(4)); } -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> const TEpipolarGridImage * DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> @@ -204,7 +204,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri return static_cast<const TEpipolarGridImage *>(this->itk::ProcessObject::GetInput(5)); } -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> const TMaskImage * DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> @@ -217,7 +217,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri return static_cast<const TMaskImage *>(this->itk::ProcessObject::GetInput(6)); } -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> const TOutputDEMImage * DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> @@ -230,7 +230,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri return static_cast<const TOutputDEMImage *>(this->itk::ProcessObject::GetOutput(0)); } -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> TOutputDEMImage * DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> @@ -243,7 +243,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri return static_cast<TOutputDEMImage *>(this->itk::ProcessObject::GetOutput(0)); } -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> void DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> @@ -369,13 +369,13 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri outputPtr->SetNumberOfComponentsPerPixel(1); } -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> void DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> ::GenerateInputRequestedRegion() { - // For the epi grid : generate full buffer + // For the epi grid : generate full buffer TEpipolarGridImage * leftGrid = const_cast<TEpipolarGridImage*>(this->GetLeftEpipolarGridInput()); TEpipolarGridImage * rightGrid = const_cast<TEpipolarGridImage*>(this->GetRightEpipolarGridInput()); @@ -486,7 +486,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri minGridIndex[0] = static_cast<int>(gridRegion.GetIndex(0)); minGridIndex[1] = static_cast<int>(gridRegion.GetIndex(1)); - for (unsigned int k=0 ; k<8 ; k++) + for (unsigned int k=0; k<8; k++) { // compute left image coordinate TDPointType tmpSensor = groundToLeftTransform->TransformPoint(corners[k]); @@ -496,7 +496,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri gridIndex[1] = minGridIndex[1]; //we assume 3 iterations are enough to find the 4 surrounding pixels - for (unsigned int s=0 ; s<2 ; s++) + for (unsigned int s=0; s<2; s++) { gridIndexU[0] = gridIndex[0] + 1; gridIndexU[1] = gridIndex[1]; @@ -603,7 +603,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri } } -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> void DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> @@ -612,7 +612,7 @@ DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGri // TODO } -template <class TDisparityImage, class TInputImage, class TOutputDEMImage, +template <class TDisparityImage, class TInputImage, class TOutputDEMImage, class TEpipolarGridImage, class TMaskImage> void DisparityMapToDEMFilter<TDisparityImage,TInputImage,TOutputDEMImage,TEpipolarGridImage,TMaskImage> diff --git a/Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx b/Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx index a19f14da31..34829c8065 100644 --- a/Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx +++ b/Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx @@ -226,8 +226,8 @@ int otb::ogr::DataSource::GetLayersCount() const } otb::ogr::Layer otb::ogr::DataSource::ExecuteSQL( - std::string const& statement, - OGRGeometry * poSpatialFilter, + std::string const& statement, + OGRGeometry * poSpatialFilter, char const* pszDialect) { assert(m_DataSource && "Datasource not initialized"); @@ -238,7 +238,7 @@ otb::ogr::Layer otb::ogr::DataSource::ExecuteSQL( #if defined(PREFER_EXCEPTION) itkExceptionMacro( << "Unexpected error: cannot execute the SQL request <" << statement << "> in the OGRDataSource <" << m_DataSource->GetName() << ">."); -#else +#else // Cannot use the deleter made for result sets obtained from // OGRDataSource::ExecuteSQL because it checks for non-nullity.... // *sigh* diff --git a/Code/UtilitiesAdapters/OGRAdapters/otbOGRFeatureWrapper.cxx b/Code/UtilitiesAdapters/OGRAdapters/otbOGRFeatureWrapper.cxx index e8d10ad15b..d294d8465c 100644 --- a/Code/UtilitiesAdapters/OGRAdapters/otbOGRFeatureWrapper.cxx +++ b/Code/UtilitiesAdapters/OGRAdapters/otbOGRFeatureWrapper.cxx @@ -74,8 +74,8 @@ bool otb::ogr::operator==(otb::ogr::Feature const& lhs, otb::ogr::Feature const& OGRFeature * r = const_cast<OGRFeature*>(rhs.m_Feature.get()); return (l == r ) // incl. ==0 - || + || (l && r && l->Equal(r)) // must be non-null to compare them with Equal - ; + ; } diff --git a/Code/UtilitiesAdapters/OGRAdapters/otbOGRFeatureWrapper.h b/Code/UtilitiesAdapters/OGRAdapters/otbOGRFeatureWrapper.h index 8b84d43bbd..f035997065 100644 --- a/Code/UtilitiesAdapters/OGRAdapters/otbOGRFeatureWrapper.h +++ b/Code/UtilitiesAdapters/OGRAdapters/otbOGRFeatureWrapper.h @@ -69,8 +69,8 @@ private: }; -} // ogr namespace -} // otb namespace +} // ogr namespace +} // otb namespace #ifndef OTB_MANUAL_INSTANTIATION diff --git a/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.cxx b/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.cxx index fe0ac9cb36..0bcd62ca4f 100644 --- a/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.cxx +++ b/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.cxx @@ -115,7 +115,7 @@ std::string otb::ogr::Layer::GetName() const assert(m_Layer && "null layer"); #if GDAL_VERSION >= 10800 return m_Layer->GetName(); -#else +#else return GetLayerDefn().GetName(); #endif } diff --git a/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.h b/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.h index 443a28a9cf..c2f4170c9b 100644 --- a/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.h +++ b/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.h @@ -170,11 +170,11 @@ public: template <class OtherValue> bool equal(feature_iter<OtherValue> const& other) const { return other.m_Crt == m_Crt; } void increment() - { + { assert(m_Layer && "cannot increment end()"); m_Crt = m_Layer->GetNextFeature(); } - Value & dereference() const + Value & dereference() const { return m_Crt; } otb::ogr::Layer * m_Layer; @@ -187,9 +187,9 @@ public: const_iterator begin () const { return cbegin(); } const_iterator end () const { return cend (); } - const_iterator cbegin() const; + const_iterator cbegin() const; const_iterator cend () const { return iterator(); } - iterator begin (); + iterator begin (); iterator end () { return iterator(); } //@} -- GitLab